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,23 @@
blocks:List Tuple Symbol:= _
[(B,O),(X,K),(D,Q),(C,P),(N,A),(G,T),(R,E),(T,G),(Q,D),(F,S), _
(J,W),(H,U),(V,I),(A,N),(O,B),(E,R),(F,S),(L,Y),(P,C),(Z,M)]
findComb(l:List List NNI):List List NNI ==
#l=0 => []
#l=1 => [[s] for s in first l]
r:List List NNI:=[]
for y in findComb(rest l) repeat
r:=concat(r,[concat(x,y) for x in first l])
return r
canMakeWord?(word,blocks) ==
word:=upperCase word
bchr:=[map(char,map(string,s::List(Symbol))) for s in blocks]
c:=[[j for j in 1..#blocks | member?(word.k,bchr.j)] for k in 1..#word]
reduce(_or,[test(#removeDuplicates(l)=#word) for l in findComb(c)])
Example:=["a","bark","book","treat","common","squad","confuse"]
[canMakeWord?(s,blocks) for s in Example]