ผลต่างระหว่างรุ่นของ "01219245/javascript1/tutorial1"
ไปยังการนำทาง
ไปยังการค้นหา
Jittat (คุย | มีส่วนร่วม) |
Jittat (คุย | มีส่วนร่วม) |
||
แถว 2: | แถว 2: | ||
We will write a simple number guessing game in JavaScript. Your goal is to guess a number between 1 - 100. If you guess incorrectly, a hint is given to you: if your guess is too high or too low. The game proceeds until you guess correctly. | We will write a simple number guessing game in JavaScript. Your goal is to guess a number between 1 - 100. If you guess incorrectly, a hint is given to you: if your guess is too high or too low. The game proceeds until you guess correctly. | ||
+ | |||
+ | An example of the interaction is given below: | ||
+ | |||
+ | Round 1, your guess? | ||
+ | 40 | ||
+ | Too low. | ||
+ | Round 2, your guess? | ||
+ | 90 | ||
+ | Too high. | ||
+ | Round 3, your guess? | ||
+ | 75 | ||
+ | Too high. | ||
+ | Round 4, your guess? | ||
+ | 55 | ||
+ | Great that's correct. | ||
+ | |||
+ | == Let's get started == | ||
+ | |||
+ | == First sketch == | ||
+ | |||
+ | == Main loop == |
รุ่นแก้ไขเมื่อ 14:54, 9 มกราคม 2557
- This is part of 01219245
We will write a simple number guessing game in JavaScript. Your goal is to guess a number between 1 - 100. If you guess incorrectly, a hint is given to you: if your guess is too high or too low. The game proceeds until you guess correctly.
An example of the interaction is given below:
Round 1, your guess? 40 Too low. Round 2, your guess? 90 Too high. Round 3, your guess? 75 Too high. Round 4, your guess? 55 Great that's correct.