0 LIKES LikeUnLike
<html><script type="JavaScript">var myArray = new Array(300);for i = 0 to 299;myArray[i] = "h";next i;for turn = 1 to 300; //who's turn it isfor flip = 0 to 299; //the command to flipif myArray[flip] == "h" then {myArray[flip] = "t";}else {myArray[flip] = "h";}document.write(myArray[flip]);flip = flip turn;next flip;next turn;</script></html>What I'm trying to do is solve a math puzzle. 300 people are standing in line. On a long table are 300 pennies. The first person flips every penny from heads to tails. The next person flips every 2nd penny. The third flips every third penny.The writeln is just to see if it's working. It's not printing anything.
Tags:
Report (0) (0) | earlier
Latest activity: earlier. This question has 2 answers.