文件名称:nim-game
- 所属分类:
- 其他智力游戏
- 资源属性:
- [Windows] [Visual C] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 257kb
- 下载次数:
- 0次
- 提 供 者:
- y***
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
nim小游戏 可在dos系统下与计算机玩游戏
让计算机和人较量.在10到100之间生成一个随机数作为初始的石子数目.然后,随机产生0或1,以决定是计算机先玩还是人先玩.然后,再随机产生0或1,以决定计算机采用"聪明"还是"愚蠢"模式.在愚蠢模式中,在轮到计算机时,简单地取走随机数目(介于1到n/2之间)的石子 在聪明模式中,计算机每次取走一定数目的石子,使得剩下的石子数目是2的某次幂减1,例如3,7,15,31,63.这总是可行的,除非当前的石子数正好是2的某次幂减1.在这种情况下,计算机取走随机数目的石子.-nim game system in the dos and computer games to computers and people to compete. 10 to 100, generates a random number between the stones as the initial number. Then, random 0 or 1, to decide whether to play or the first computer people get to play. Then, again randomly generated 0 or 1, to determine the computer using " smart" or " stupid" mode. in stupid mode, turn the computer on, the simple removal of random number (between 1 and n/between 2) the stones in smart mode, the computer each time a certain number of stones removed, making the number of remaining stones of a power of 2 minus 1, for example, 3,7,15,31,63. This total is feasible, unless the current is just a few stones of a power of 2 minus 1. In this case, the computer random number of stones removed.
让计算机和人较量.在10到100之间生成一个随机数作为初始的石子数目.然后,随机产生0或1,以决定是计算机先玩还是人先玩.然后,再随机产生0或1,以决定计算机采用"聪明"还是"愚蠢"模式.在愚蠢模式中,在轮到计算机时,简单地取走随机数目(介于1到n/2之间)的石子 在聪明模式中,计算机每次取走一定数目的石子,使得剩下的石子数目是2的某次幂减1,例如3,7,15,31,63.这总是可行的,除非当前的石子数正好是2的某次幂减1.在这种情况下,计算机取走随机数目的石子.-nim game system in the dos and computer games to computers and people to compete. 10 to 100, generates a random number between the stones as the initial number. Then, random 0 or 1, to decide whether to play or the first computer people get to play. Then, again randomly generated 0 or 1, to determine the computer using " smart" or " stupid" mode. in stupid mode, turn the computer on, the simple removal of random number (between 1 and n/between 2) the stones in smart mode, the computer each time a certain number of stones removed, making the number of remaining stones of a power of 2 minus 1, for example, 3,7,15,31,63. This total is feasible, unless the current is just a few stones of a power of 2 minus 1. In this case, the computer random number of stones removed.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
nim 游戏\Debug\Main.obj
........\.....\Nim.exe
........\.....\Nim.ilk
........\.....\Nim.obj
........\.....\Nim.pch
........\.....\Nim.pdb
........\.....\vc60.idb
........\.....\vc60.pdb
........\Main.cpp
........\Nim.cpp
........\Nim.dsp
........\Nim.dsw
........\Nim.h
........\Nim.ncb
........\Nim.opt
........\Nim.plg
........\Debug
nim 游戏
........\.....\Nim.exe
........\.....\Nim.ilk
........\.....\Nim.obj
........\.....\Nim.pch
........\.....\Nim.pdb
........\.....\vc60.idb
........\.....\vc60.pdb
........\Main.cpp
........\Nim.cpp
........\Nim.dsp
........\Nim.dsw
........\Nim.h
........\Nim.ncb
........\Nim.opt
........\Nim.plg
........\Debug
nim 游戏