Skip to content

Instantly share code, notes, and snippets.

@nauman
Created April 12, 2012 08:29
Show Gist options
  • Save nauman/2365619 to your computer and use it in GitHub Desktop.
Save nauman/2365619 to your computer and use it in GitHub Desktop.
<?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