Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
15
Task/Best-shuffle/Phix/best-shuffle.phix
Normal file
15
Task/Best-shuffle/Phix/best-shuffle.phix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
constant tests = {"abracadabra", "seesaw", "elk", "grrrrrr", "up", "a"}
|
||||
string s,t
|
||||
for test=1 to length(tests) do
|
||||
s = tests[test]
|
||||
t = shuffle(s)
|
||||
for i=1 to length(t) do
|
||||
for j=1 to length(t) do
|
||||
if i!=j and t[i]!=s[j] and t[j]!=s[i] then
|
||||
{t[i], t[j]} = {t[j], t[i]}
|
||||
exit
|
||||
end if
|
||||
end for
|
||||
end for
|
||||
printf(1,"%s -> %s (%d)\n",{s,t,sum(sq_eq(t,s))})
|
||||
end for
|
||||
Loading…
Add table
Add a link
Reference in a new issue