tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
17
Task/Palindrome-detection/REXX/palindrome-detection.rexx
Normal file
17
Task/Palindrome-detection/REXX/palindrome-detection.rexx
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
/*REXX program checks to see if a phrase is palindromic. */
|
||||
|
||||
y = 'In girum imus nocte et consumimur igni'
|
||||
|
||||
/*translation: We walk around in the night and */
|
||||
/* we are burnt by the fire (of love). */
|
||||
say 'string = ' y
|
||||
say
|
||||
if isPal(y) then say 'The string is palindromic.'
|
||||
else say "The string isn't palindromic."
|
||||
exit /*stick a fork in it, we're done.*/
|
||||
|
||||
/*──────────────────────────────────ISPAL subroutine────────────────────*/
|
||||
isPal: procedure; arg x /*uppercases the value of arg X. */
|
||||
x = space(x,0) /*removes all blanks (spaces). */
|
||||
return x==reverse(x) /*returns 1 if exactly equal, */
|
||||
/* " 0 if not equal. */
|
||||
Loading…
Add table
Add a link
Reference in a new issue