| Author |
Comment/Response |
Rhyannon
|
10/15/99 11:19pm
I want to design a simple recursive program that tells whether a
word is a palindrome or not. I do not understand where to increment
''i''. My program is now as follows:
palindrome[] = ''Your Word is a Palindrome'';
palindrome[d] = ''Your Word is a Palindrome'';
palindrome[''word''_] :=
Module[{n, i = 1, i++},
n = StringLength[''word''];
If[StringTake[''word'', {i}] == StingTake[''word'', {-i}],
i++, Return[''Try Again'']
]
]
I have played around with this above program for hours; can you
give me a hint?
Thanks!
URL: , |
|