| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1396 人关注过本帖
标题:求java井字棋
取消只看楼主 加入收藏
zhuang0812
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2007-9-26
收藏
 问题点数:0 回复次数:0 
求java井字棋

谁有java井字棋小游戏的代码啊??人与电脑下,用O和X符号

按要求井字棋要有两个classes
第一是 Board 要有这些功能
reset: 还原到开始全空的格子.
status: to find the current status of a specified square of the board.

Try: to temporarily insert a symbol in a square. The method will return the
number of straight lines passing through the square that have 3 identical
symbols on the line – this value can be 0, 1, or 2. Method clear undoes the
effect of a try.

Place: places the specified symbol in an unoccupied square. The method
returns value Continue, Drawn or Win depending on the state of the board
after new symbol has been placed on the board. (In the following description I
use the words try and place with the meanings described in these dot points)

Trying to place a symbol in an occupied square by method try or place
should raise an exception.

第二个是 Class Strategy
方法move要有以下功能
1,如果中间的格子是空的,电脑就要在那格标记.
2,反复插入电脑和符号到空的格子,寻找可以一个就赢,电脑就下这一格.


小弟是新手..有人可以帮我写这两个class么?

搜索更多相关主题的帖子: java 
2007-09-26 22:13
快速回复:求java井字棋
数据加载中...
 
   



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

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