-
-
Save hughfdjackson/1674220 to your computer and use it in GitHub Desktop.
kayseebee - pastebin.com/m8jye8Y0
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
| <script type="text/javascript"> | |
| var counter = 0; | |
| function execLot() | |
| { | |
| var grpNums1 = new Array(1,2,3,4,5,6,7,8,9,10); | |
| var index1 = Math.floor(Math.random()*grpNums1.length); | |
| var grpNums2 = new Array(1,2,3,4,5,6,7,8,9,10); | |
| var index2 = Math.floor(Math.random()*grpNums2.length); | |
| var match = false; | |
| while (match == false) | |
| { | |
| if (grpNums1[index1] == grpNums2[index2]) | |
| { | |
| match = true; | |
| alert("You won!"); | |
| } | |
| else | |
| { | |
| match = false; | |
| counter++; | |
| } | |
| } | |
| } | |
| function execStopSim() | |
| { | |
| alert("The simulator ran " + counter + " times."); | |
| } | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment