Write a predicate that tests whether a given string is palindromic or not. A string is palindromic if it reads the same in both directions. Accordingly, application of this
predicate should give the following results.
(palindromic? “madam”) Þ #t
(palindromic? “Madam”) Þ #t
(palindromic? “”) Þ #t
(palindromic? “chic”) Þ #f
(palindromic? “küçük”) Þ #t
HOW TO DEFİNE THIS FUNCTION IN THE SCHEME
DR SCHEME
Started by taha, Nov 22 2009 11:24 AM
1 reply to this topic
#1
Posted 22 November 2009 - 11:24 AM
|
|
|
#2
Posted 23 November 2009 - 08:30 AM
Well, you'll need it to ignore case, so first I would change the string to upper case.
You need to be able to compare the string to it's reverse, so a reversestring function might be nice.
If you show us the code you have so far, we may be able to help further.
You need to be able to compare the string to it's reverse, so a reversestring function might be nice.
If you show us the code you have so far, we may be able to help further.


Sign In
Create Account

Back to top









