Created
April 12, 2012 08:29
-
-
Save nauman/2365619 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Sentence{ | |
static $phrase = ""; | |
static $word1 = "eek"; | |
static $word2 = "eep"; | |
static $word3 = "yikis"; | |
static function callRecursive($x){ | |
//print $x."\n"; checking counter | |
if ($x % 6 == 0){ //every second loop 2nd loop 2*3=6 | |
print "eek".$x."\n"; | |
} | |
if ($x % 39 == 0){ //every 13th loop 13*3=39 | |
print "eep".$x."\n"; | |
} | |
if ($x % 51 == 0 ) { //every 17th loop 17*3=51 | |
print "yikis".$x."\n"; | |
} | |
if ($x >= 99){ | |
return $phrase; | |
}else{ | |
return self::callRecursive($x+3); | |
} | |
} | |
} | |
Sentence::callRecursive(0); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment