How to use JavaScript to guess game _ javascript skills

Source: Internet
Author: User
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>







Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.