文件名称:guess-number
-
所属分类:
- 标签属性:
- 上传时间:2013-04-17
-
文件大小:741byte
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
猜数字游戏
用户开始有100元钱,没有钱了或不玩了就退出。
每一轮先问用户赌多少钱,如果输入0则结束游戏,赌注必须是正的且少于现有的钱数,然后猜一个1到10 的数,用这个数与计算机产生的数比较,如果猜对了,用户赢赌注这么多钱,如果猜错了,用户损失钱,损失的钱数是 赌注/5*(用户猜的数与计算机数之差)
例如赌注是50,计算机产生的是5,用户猜的是7,则损失20元,因为 50/5 * (7-5) = 20
如果损失72,而用户只有50,则损失50
-Guessing game users began to 100 dollars, no money, or do not play on the exit. Each round to ask users to bet on how much money, If you enter a 0 to the end of the game, the stakes must be positive and less than the number of existing money, then guess a number from 1 to 10, with the number of computer generated comparison, if guessed it, the users win bet so much money, if you guess wrong, the user loss of money, loss of money is bet/5* (user guess the difference of the number and the computer number) for example, the wager is 50, the computer-generated 5 , user guess is 7, then the loss of $ 20, $ 50/5* (7-5) = 20 If the loss of 72, while the user is only 50, the loss of 50
用户开始有100元钱,没有钱了或不玩了就退出。
每一轮先问用户赌多少钱,如果输入0则结束游戏,赌注必须是正的且少于现有的钱数,然后猜一个1到10 的数,用这个数与计算机产生的数比较,如果猜对了,用户赢赌注这么多钱,如果猜错了,用户损失钱,损失的钱数是 赌注/5*(用户猜的数与计算机数之差)
例如赌注是50,计算机产生的是5,用户猜的是7,则损失20元,因为 50/5 * (7-5) = 20
如果损失72,而用户只有50,则损失50
-Guessing game users began to 100 dollars, no money, or do not play on the exit. Each round to ask users to bet on how much money, If you enter a 0 to the end of the game, the stakes must be positive and less than the number of existing money, then guess a number from 1 to 10, with the number of computer generated comparison, if guessed it, the users win bet so much money, if you guess wrong, the user loss of money, loss of money is bet/5* (user guess the difference of the number and the computer number) for example, the wager is 50, the computer-generated 5 , user guess is 7, then the loss of $ 20, $ 50/5* (7-5) = 20 If the loss of 72, while the user is only 50, the loss of 50
(系统自动生成,下载前可以参看下载内容)
下载文件列表
guess number.txt
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.