Home > Web Front-end > JS Tutorial > body text

用JavaScript实现 铁甲无敌奖门人 “开口中”猜数游戏_javascript技巧

WBOY
Release: 2016-05-16 18:43:27
Original
2258 people have browsed it
在线演示demo
本人平时就喜欢拿它来写点实用工具或应用,本文演示用JavaScript实现的《铁甲无敌奖门人》“开口中”猜数游戏,以后我还会陆续上传自己写的小东西,都是些工作之余的小作。

《铁甲无敌奖门人》是TVB综艺节目,香港艺人曾志伟就是其中重要的主持人,节目中有众多好玩又刺激的游戏,其中有一个叫“开口中”的猜数游戏正是本文要实现的功能。游戏规则大致是:首先电脑在1到100内选一个数字作为最终答案(这个答案嘉宾一开始是不知道的),然后嘉宾轮流喊1到100以内的数字,每喊一次,如果不是答案,就把范围缩小到嘉宾喊的那个数,直到有人喊中答案为止,最后喊中答案的人要接受玩游戏,如果游戏过关了,不用罚,否则将要受罚。
用JavaScript实现 铁甲无敌奖门人 “开口中”猜数游戏_javascript技巧
网页HTML及JavaScript代码如下,非常简单,都写了注释,感兴趣的就看一下:
复制代码 代码如下:





用JavaScript实现《铁甲无敌奖门人》“开口中”猜数游戏






1 → 100


0








State:等待开始游戏



















































































































作者:WebFlash
出处:http://webflash.cnblogs.com
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!