tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
7
Task/Repeat-a-string/ActionScript/repeat-a-string-2.as
Normal file
7
Task/Repeat-a-string/ActionScript/repeat-a-string-2.as
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
function repeatRecursive(string:String, numTimes:uint):String
|
||||
{
|
||||
if(numTimes == 0) return "";
|
||||
if(numTimes & 1) return string + repeatRecursive(string, numTimes - 1);
|
||||
var tmp:String = repeatRecursive(string, numTimes/2);
|
||||
return tmp + tmp;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue