Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
17
Task/Palindrome-detection/SNOBOL4/palindrome-detection.sno
Normal file
17
Task/Palindrome-detection/SNOBOL4/palindrome-detection.sno
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
define('pal(str)') :(pal_end)
|
||||
pal str notany(&ucase &lcase) = :s(pal)
|
||||
str = replace(str,&ucase,&lcase)
|
||||
leq(str,reverse(str)) :s(return)f(freturn)
|
||||
pal_end
|
||||
|
||||
define('palchk(str)tf') :(palchk_end)
|
||||
palchk output = str;
|
||||
tf = 'False'; tf = pal(str) 'True'
|
||||
output = 'Palindrome: ' tf :(return)
|
||||
palchk_end
|
||||
|
||||
* # Test and display
|
||||
palchk('Able was I ere I saw Elba')
|
||||
palchk('In girum imus nocte et consumimur igni')
|
||||
palchk('The quick brown fox jumped over the lazy dogs')
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue