Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
14
Task/Four-is-magic/Zkl/four-is-magic-1.zkl
Normal file
14
Task/Four-is-magic/Zkl/four-is-magic-1.zkl
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
fcn fourIsMagic(int){
|
||||
if(int==0) return("Zero is four, four is magic.");
|
||||
string:="";
|
||||
while(1){ c:=nth(int,False);
|
||||
string+="%s is ".fmt(c);
|
||||
if(int = ( if(int==4) 0 else c.len() )){
|
||||
string+="%s, ".fmt(nth(int,False));
|
||||
}else{
|
||||
string+="magic.";
|
||||
break;
|
||||
}
|
||||
}
|
||||
string[0].toUpper() + string[1,*]
|
||||
}
|
||||
3
Task/Four-is-magic/Zkl/four-is-magic-2.zkl
Normal file
3
Task/Four-is-magic/Zkl/four-is-magic-2.zkl
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
foreach n in (T(0,4,6,11,13,75,337,-164,9876543209)){
|
||||
println(fourIsMagic(n),"\n")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue