I am trying to script a game were a player chooses a number between 1-100.
A random number generator gives a number.
The player has up to 7 tries.
I have scripted the number generator like this
<script language="JavaScript">
counter = 0
while (counter < 7) {
var num = Math.round(100 * Math.random());
document.write("<br>Random number between 1 and 100: <b>" +num+ "</b>.")
counter++
}
</script>
Can anyone please help in how the player inputs the number and then it is checked to see if both numbers match?
All help much appreciated
A random number generator gives a number.
The player has up to 7 tries.
I have scripted the number generator like this
<script language="JavaScript">
counter = 0
while (counter < 7) {
var num = Math.round(100 * Math.random());
document.write("<br>Random number between 1 and 100: <b>" +num+ "</b>.")
counter++
}
</script>
Can anyone please help in how the player inputs the number and then it is checked to see if both numbers match?
All help much appreciated
Comment