| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 655 人关注过本帖
标题:火柴的游戏
只看楼主 加入收藏
jotn26
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2006-3-1
收藏
 问题点数:0 回复次数:4 
火柴的游戏
Assignment 1
Context
The game of Nim is a simple game played between two (2) players. Twenty one
(21) matches are arranged into positions on a triangular grid of locations. Each
player takes turns removing either one (1), two (2), or three (3) matches from a
location on the grid. The player that removes the last match loses.
An example implementation of the Nim game is the following:
The application of this game to computing is the design of a program that
allows a human to play against the computer.
以上的是要求 ,请高手帮帮忙 急需 先在这里谢谢了
搜索更多相关主题的帖子: 火柴 游戏 
2006-04-18 19:54
Goldgulf
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2006-4-6
收藏
得分:0 

思路:每次留给对方的火柴数为1,5,9,13,17,21,则对方一定输。
证明:“1”显然成立;
“5”不管对方去多少,我都可以留“1”根火柴给对方,
“9”不管对方去多少,我都可以留“5”根火柴给对方,
。。。。。。。。

2006-04-18 21:54
★王者至尊★
Rank: 1
等 级:新手上路
帖 子:528
专家分:0
注 册:2006-3-28
收藏
得分:0 
递归
.............

------Java 爱好者,论坛小混混,学习中------
2006-04-18 23:08
千里冰封
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:灌水之王
等 级:版主
威 望:155
帖 子:28477
专家分:59
注 册:2006-2-26
收藏
得分:0 
楼主的要求不是去实现算法,而是去实现玩家和电脑对战的过程
不过算法也重要

可惜不是你,陪我到最后
2006-04-19 10:44
jotn26
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2006-3-1
收藏
得分:0 

谁能帮我编下代码 感激不尽啊
要求不一定与电脑
可以两个人玩 不过这些都没有关系
本来还用到ADT做图象的 这个先不管 了
先谢过了

2006-04-19 12:40
快速回复:火柴的游戏
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014599 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved