Data update

This commit is contained in:
Ingy döt Net 2026-02-01 16:33:20 -08:00
parent 5150844a7d
commit 4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions

View file

@ -1,28 +0,0 @@
with Ada.Text_IO;
procedure Test_Function is
function Palindrome (Text : String) return Boolean is
begin
for Offset in 0 .. Text'Length / 2 - 1 loop
if Text (Text'First + Offset) /= Text (Text'Last - Offset) then
return False;
end if;
end loop;
return True;
end Palindrome;
str1 : String := "racecar";
str2 : String := "wombat";
begin
begin
pragma Assert(False); -- raises an exception if assertions are switched on
Ada.Text_IO.Put_Line("Skipping the test! Please compile with assertions switched on!");
exception
when others => -- assertions are switched on -- perform the tests
pragma Assert (Palindrome (str1) = True, "Assertion on str1 failed");
pragma Assert (Palindrome (str2) = False, "Assertion on str2 failed");
Ada.Text_IO.Put_Line("Test Passed!");
end;
end Test_Function;

View file

@ -1,5 +0,0 @@
function Palindrome (Text : String) return Boolean
with Post => Palindrome'Result =
(Text'Length < 2 or else
((Text(Text'First) = Text(Text'Last)) and then
Palindrome(Text(Text'First+1 .. Text'Last-1))));

View file

@ -1,10 +0,0 @@
--unittest in standard library 4.0+
include std/unittest.e
include palendrome.e --routines to be tested
object p = "12321"
test_equal("12321", 1, isPalindrome(p))
test_equal("r12321", 1, isPalindrome(reverse(p)))
test_report()

View file

@ -1,6 +1,6 @@
IsPal ← ≍⇌.+×32<@a.▽:⟜∊:/⊂+⊙¤"Aa"⇡26
---
⍤⟜≍: 1 IsPal "tacocat"
⍤⟜≍: 1 IsPal "A man, a plan, a canal: Panama!"
⍤⟜≍: 1 IsPal "acrobat" # throws error
---
IsPal ← ≍⇌.+×32<@a.▽:⟜˜∊:/⊂+⊙¤"Aa"⇡26
┌─╴test
⍤⟜≍: 1 IsPal "tacocat"
⍤⟜≍: 1 IsPal "A man, a plan, a canal: Panama!"
⍤⟜≍: 1 IsPal "acrobat" # throws error
└─╴