Add tasks for all the new languages

This commit is contained in:
Tina Müller 2016-12-05 23:44:36 +01:00
parent 9dc3c2bb62
commit bba7bfd280
13208 changed files with 134745 additions and 0 deletions

View file

@ -0,0 +1,25 @@
--constant TRUE = (1=1), -- 1 internally \ now pre-
-- FALSE = not TRUE -- 0 internally / defined
type boolean(object b)
return integer(b) and find(b,{TRUE,FALSE})!=0
end type
function logicop(boolean a, boolean b)
return {a, b, a and b, a or b, not a, a xor b, a=b, a!=b}
end function
function TF(sequence tf)
boolean tfi
for i=1 to length(tf) do
tfi = tf[i]
tf[i] = iff(tfi?'T','F')
end for
return tf
end function
printf(1," a b and or not xor = !=\n")
for a=FALSE to TRUE do -- nb: TRUE to FALSE would need a "by -1".
for b=FALSE to TRUE do
printf(1,"%2c %2c %c %c %c %c %c %c\n",TF(logicop(a,b)))
end for
end for

View file

@ -0,0 +1,10 @@
function logiicop(integer a, integer b)
return {a, b, a and b, a or b, not a, a xor b, a=b, a!=b}
end function
printf(1," a b and or not xor = !=\n")
for a=0 to 1 do
for b=0 to 1 do
printf(1,"%2d %2d %d %d %d %d %d %d\n",logiicop(a,b))
end for
end for