JavaScript Source Code 3000: Games: Fortune Teller
Fortune Teller
Just ask a yes or no question and the JavaScript fortune teller will reply. Neat!
Your question:
Your fortune teller says:
JavaScript Source Code 3000: Games: Fortune Teller
Simply click inside the window below, use your cursor to highlight the script, and copy (type Control-c or Apple-c) the script into a new file in your text editor (such as Note Pad or Simple Text) and save (Control-s or Apple-s). The script is yours!!!
<!-- TWO STEPS TO INSTALL FORTUNE TELLER:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Ronnie T. Moore -->
<!-- Web Site: JavaScript Source Code 3000 -->
<!-- Based on code by: Michael Carpenter -->
<!-- URL: http://www.michaelcarpenter.net -->
<! >
<! >
<!-- Begin
var answers = new Array(
"Without a doubt",
"Yes!",
"Probably so",
"It isn't likely",
"it's possible",
"Absolutely",
"Not a chance",
"Ask again",
"No",
"I doubt it",
"No Way"
);
function fortune() {
num = Math.round( (answers.length - 1) * Math.random());
return answers[num];
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<center>
<form>
Your question: <input type=text name=question size=40>
<input type=button name=ask value="Ask" onClick="if (this.form.question.value!='') this.form.answer.value = fortune();"><br>
Your fortune teller says: <input type=text name=answer size=40>
</form>
</center>
<!-- Script Size: 1.27 KB -->
Wyszukiwarka
Podobne podstrony:
fortunes of warfortuneChristie Ridgway Fate and FortunefortunesKornbluth, CM MS Found in a Fortune Cookie v1 0A Gentleman of FortuneMoreland, Peggy Groom of Fortune (SD)Synowie fortunyLa Fortune des Rougonwięcej podobnych podstron