-
2.3
一个简单的猜数游戏程序:
利用Math.random()方法生成0-1之间的double型数dNum,将dNum转换为0-100之间的整数iNum。
利用KeyInput.readInt()方法接收键盘输入的整数inNum。如果inNum小于iNum,在屏幕上显示“输入的值小,请输入更大的数.”;如果inNum大于iNum,在屏幕上显示“输入的值大,请输入更小的数.”;如果inNum等于iNum,在屏幕上显示“猜对了.”,并结束运行。
猜测错误的时候,重新输入inNum,直到猜对为止。如果猜测10次后仍未猜对,显示“猜测次数已达10次,猜数失败.”,并结束程序的运行。
(A simple guessing game program: use Math.random () method to generate double-type numbers between 0-1 dNum, will dNum into an integer between 0-100 iNum. use KeyInput.readInt () method receives the keyboard input integer inNum. If inNum less than iNum, the screen " Enter the value of the small, enter the greater number." If inNum than iNum, the screen " Enter the value of the large number of smaller type." If inNum equal iNum, displayed on the screen, " guessed." and end the run. guess wrong, re-enter inNum, until you guess it right up. If the guess was right 10 times not to show " guess the number has reached 10 times, guess the number of failures." And end the program.)
- 2010-11-03 14:29:09下载
- 积分:1
-
xiangqi.tar
在vc平台下编写的一款简单的开源象棋游戏,人机对战模式。(A simple chess game)
- 2011-11-02 12:55:45下载
- 积分:1
-
PlantomGo
幻影围棋棋源代码,参加计算机博弈比大赛亚军的代码。(Phantom Go chess source code, to participate in a computer game than the runner-up code.)
- 2021-01-20 22:48:43下载
- 积分:1
-
Tetris游戏源代码
用VB编写的Tetris游戏(VB prepared by the Tetris game)
- 2004-12-08 12:37:04下载
- 积分:1
-
gobang-game
基于控制台的五子棋游戏,用easyX提供的图形接口进行编写,适合初学者,简单易懂,注释全面。注:安装图形库需要去EasyX官网下载“2012立冬版”,必须是这个版本,因为后来新的版本对有些函数做了调整,导致显示会有问题。(Console-based backgammon game, the graphical interface provided by easyX be written for beginners, easy to understand, comprehensive notes. Note: Installing graphics libraries need to EasyX official website to download " 2012 Lidong Edition" , must be this version, because the new version was made adjustments for some functions, resulting in the display there will be problems.)
- 2014-10-11 14:53:47下载
- 积分:1
-
pukepaidama
扑克牌游戏编程代码 行数不多但功能精确完好(pu ke pai you xi bian cheng dai ma )
- 2012-05-04 12:57:07下载
- 积分:1
-
suoermario
用c语言编写的超级玛丽源程序,非常具有探讨意义(Using c language source code Super Queen Mary, explore the very meaning of)
- 2008-03-29 12:44:30下载
- 积分:1
-
VCPPRpgGameStudy
使用VC++编写的,RPG游戏学习例子,简单演示了,地图上2个NPC(或主角人物)相互跑动的过程(Using VC++ written in RPG games learning example, a simple demo on the map two NPC (or protagonist) running each other)
- 2012-04-06 10:54:57下载
- 积分:1
-
Ptu
一款拼图游戏的基础代码,适合课堂初步教学时所用(A jigsaw puzzle of the underlying code for classroom use when the initial teaching)
- 2011-05-22 12:53:53下载
- 积分:1
-
mofangkuaiyuyinyue
说明: 这是个小小游戏,小时侯我们特爱玩的那种魔方块,不知大家玩过否?有什么改进希望大家能发信息给我,(This a small game, turkey we catch a special kind of magic squares, I do not know whether you have played? What we can hope to improve the information to me, thank you)
- 2006-03-25 10:10:25下载
- 积分:1