Josephus problem: Difference between revisions

Content added Content deleted
No edit summary
Line 1,480: Line 1,480:
foreach($prisoners as $thisPrisoner=>$dead){
foreach($prisoners as $thisPrisoner=>$dead){
if(!$dead){//so yeah...if not dead...
if(!$dead){//so yeah...if not dead...
if($deadpool==$k){//if thier time is up in the deadpool...
if($deadpool==$k){//if their time is up in the deadpool...
$order++;
$order++;
//set the deadpool value or enumerate as survivor
//set the deadpool value or enumerate as survivor