2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
|
|
@ -1,5 +1,5 @@
|
|||
set str to "ha"
|
||||
set final_string to ""
|
||||
repeat 5 times
|
||||
set final_string to final_string & str
|
||||
set final_string to final_string & str
|
||||
end repeat
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
on run
|
||||
nreps("ha", 50000)
|
||||
end run
|
||||
|
||||
|
||||
-- String -> Int -> String
|
||||
on nreps(s, n)
|
||||
set o to ""
|
||||
if n < 1 then return o
|
||||
|
||||
repeat while (n > 1)
|
||||
if (n mod 2) > 0 then set o to o & s
|
||||
set n to (n div 2)
|
||||
set s to (s & s)
|
||||
end repeat
|
||||
return o & s
|
||||
end nreps
|
||||
Loading…
Add table
Add a link
Reference in a new issue