JavaScript seems to be a small language that cannot come out of the hall, but it does not shine like a star language, but at least the web page still needs it. At the same time, it is a very practical language. Online demo
I usually like to use it to write some practical tools or applications. This article demonstrates how to use JavaScript to guess the number of games in the "open-mouth" of "the invincible Referer, in the future, I will upload my own little things, all of which will be a little bit of work.
Iron armor invincible prize winner is a TVB variety show. Hong Kong Artist Zeng Zhiwei is an important host. The show contains many interesting and exciting games, one of them is the function of this article, which is called "open-mouth. The general rule of the game is: first, the computer selects a number from 1 to 100 as the final answer (this answer is unknown at the beginning ), then, the guests call numbers ranging from 1 to 100 in turn. If the answer is not the answer, they will narrow down the scope to the number that the guest calls until someone calls the answer, the person who finally calls the answer should accept the game. If the game passes the game, no penalty is required. Otherwise, the game will be fined.
The HTML and JavaScript code of the webpage are as follows, which is very simple and has been commented out. If you are interested, take a look:
The Code is as follows:
Use JavaScript to implement the "open" quiz game of "Invincible Referer"
1 → 100
0
State: waiting to start the game
Evangelist blog: http://blog.csdn.net/webflash </a>