Online demo demoI usually like to use it to write some practical tools or applications. This article demonstrates the "Opening" guessing game of "Iron Armored Prize Doorman" implemented in JavaScript. I will do it again in the future. I have been uploading small things I have written one after another. They are all small works after work.
"The Invincible Doorman" is a TVB variety show. Hong Kong artist Eric Tsang is an important host. There are many fun and exciting games in the show, among which there is a guessing game called "Opening". This is the function to be achieved in this article. The rules of the game are roughly as follows: first, the computer selects a number between 1 and 100 as the final answer (the guests do not know this answer at the beginning), and then the guests take turns shouting a number between 1 and 100. Each time they shout, if it is not the answer, they will Narrow the range to the number shouted by the guest until someone calls out the correct answer. The person who finally calls out the correct answer must accept to play the game. If the game passes, there is no penalty, otherwise he will be punished.
The HTML and JavaScript code of the webpage are as follows. It is very simple and has comments. If you are interested, take a look:
用JavaScript实现《铁甲无敌奖门人》“开口中”猜数游戏 🎜>
저자: WebFlash
출처: http://webflash.cnblogs.com