Data update
This commit is contained in:
parent
29a5eea0d4
commit
5c1bb7bfa9
2011 changed files with 35081 additions and 3229 deletions
37
Task/Palindrome-detection/Refal/palindrome-detection.refal
Normal file
37
Task/Palindrome-detection/Refal/palindrome-detection.refal
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
$ENTRY Go {
|
||||
= <Test 'rotor'>
|
||||
<Test 'racecar'>
|
||||
<Test 'RACEcar'>
|
||||
<Test 'level'>
|
||||
<Test 'rosetta'>
|
||||
<Test 'A man, a plan, a canal: Panama'>
|
||||
<Test 'Egad, a base tone denotes a bad age'>
|
||||
<Test 'This is not a palindrome'>;
|
||||
};
|
||||
|
||||
Test {
|
||||
e.W, <Palindrome e.W> <InexactPalindrome e.W>: {
|
||||
True s.1 = <Prout e.W ': exact palindrome'>;
|
||||
s.1 True = <Prout e.W ': inexact palindrome'>;
|
||||
False False = <Prout e.W ': not a palindrome'>;
|
||||
};
|
||||
};
|
||||
|
||||
InexactPalindrome {
|
||||
e.W = <Palindrome <Filter ('ABCDEFGHIJKLMNOPQRSTUVWXYZ') <Upper e.W>>>;
|
||||
};
|
||||
|
||||
Filter {
|
||||
(e.Keep) = ;
|
||||
(e.Keep) s.C e.W, e.Keep: {
|
||||
e.1 s.C e.2 = s.C <Filter (e.Keep) e.W>;
|
||||
e.1 = <Filter (e.Keep) e.W>;
|
||||
};
|
||||
};
|
||||
|
||||
Palindrome {
|
||||
= True;
|
||||
s.C = True;
|
||||
s.C e.W s.C = <Palindrome e.W>;
|
||||
e.X = False;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue