scribbledecobble
scribbledecobble.blogspot.com
Pages
Home
Contents
A
…
K
Hello, Goodbye
README
See Also
Hello, Goodbye
The Caverners
Code
<!-- HTML --> Steps <!-- an ordered list --> <ol> <li>You say: Yes.</li> <li>I say: No.</li> </ol> <script> /* JavaScript */ /* You say: Yes. * I say: No. * OK? */ alert("You say: Yes."); // This is you saying Yes. alert("I say: No."); // This is me saying No. </script>
<!-- HTML --> Steps <ol> <!-- You say: Stop. --> <li>You say: Stop.</li> <!-- I say: Go. (three times) --> <li>I say: Go.</li> <li>I say: Go.</li> <li>I say: Go.</li> </ol> <script> /* JavaScript */ /* You say: Stop. * I say: Go. (three times) * OK? */ alert("You say: Stop."); // This is you saying Stop. alert("I say: Go."); // This is me saying Go the first time. alert("I say: Go."); // This is me saying Go the second time. alert("I say: Go."); // This is me saying go the third time. </script>
<!-- HTML --> Steps <ol> <!-- You say: Stop. --> <li>You say: Stop.</li> <!-- I say: Go. (three times) --> <li>I say: Go.</li> <li>I say: Go.</li> <li>I say: Go.</li> </ol> <script> /* JavaScript */ function say(who, what) { alert(who + " say: " + what + "."); } say("You", "Stop"); say("I", "Go"); say("I", "Go"); say("I", "Go"); </script>
<!-- HTML --> Steps <ol> <!-- If it's confirmed that you said: Stop... --> <li>If confirmed you said: Stop, then:</li> <!-- Then I say Go three times. --> <ol type="a"> <li>I say Go.</li> <li>I say Go.</li> <li>I say Go.</li> </ol> </ol> <script> /* JavaScript */ function confirmSaid(who, what) { return confirm(who + " say: " + what + "."); } function say(who, what) { alert(who + " say: " + what + "."); } if (confirmSaid("You", "Stop")) { say("I", "Go"); say("I", "Go"); say("I", "Go"); } </script>
Steps <ol> <!-- If it's confirmed that you said: Stop... --> <li>If confirmed you said: Stop, then:</li> <!-- Then I say Go three times. --> <ol type="a"> <li>I say Go.</li> <li>I say Go.</li> <li>I say Go.</li> </ol> </ol> <script> function confirmSaid(who, what) { return confirm(who + " say: " + what + "."); } function say(who, what) { alert(who + " say: " + what + "."); } function repeat(who, what, times) { while (times > 0) { say(who, what); times = times - 1; } } if (confirmSaid("You", "Stop")) { repeat("I", "Go", 3); } </script>
Newer Post
Older Post
Home