首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2SE开发 >

Java佳作业,来看看吧,求思路…

2012-12-16 
Java大作业,来看看吧,求思路……美国大学计算机专业大学一年期末作业 在15*15的格子里,在300步内,120秒内,看

Java大作业,来看看吧,求思路……
美国大学计算机专业大学一年期末作业 在15*15的格子里,在300步内,120秒内,看谁走过的格子数多,每个机器有自己的颜色,红或蓝. 1.车子可以射斑点去攻击对手,射中对手的话,对手将走你的颜色,持续20步。 2.可射斑点数为30。 3.若撞到墙,游戏结束,你自动输了。 4.若撞到另外一个车,游戏停止,画多格子的车胜。 5.游戏版面包含有石头的格子,撞到的输,如墙 6.射的斑点不能过石头 7.每次控制算法下个格去哪它会接受周围5*5的格子。车子在中间格,指向面对方向。这个叫做短范围浏览。 8.你的算法可以有限制次数的长范围浏览。范围为15*15。(看下面)你可以得到一个长范围浏览可以在你上一步行走时要求他。限制30个。 9.游戏版面包含有雾的格子。如果雾没有笼罩石头,那任何车子将跟画其他格子一样画那个格子。然而,长范围浏览不能显示雾下面是什么。但短浏览可以显示什么在雾下面。雾会漂流,扩张,或者缩短在运行中。 10.车子将在每个格子决定它的下一步怎么走。

真快疯了……来大神指点一下,感激不尽!
[最优解释]
我去你这学校不错啊 比国内脑残题强多了 找几个同学切磋一下啊 哎 这么好的机会自己研究一下 啊
[其他解释]
这个要想应付一下很简单 只要不撞对方车 可能的情况就射击他 由于还有雾这一说 设计ai可能需要实验 我就不写了 没有环境 不过我感觉这么多的随机条件你能不撞墙 射击他 还是有胜算的 雾什么的不考虑了 
[其他解释]
总之,这个游戏要写出来,细节上会有很多,写好不容易,但是可以分开一个功能一个功能的先写好,例如扫描的动画,移动绘制,撞到石头,射击,然后再组合,尤其是中间的动画,要对线程的使用比较熟悉,而且为了性能考虑,不能每个东西都用一个线程,需要合理的决定使用线程。
不过这种方式对设计能力有一定的要求,因为是最后组合,所以设计的时候,接口就要求设计得合理。
[其他解释]

引用:
引用:
这个问题我感觉应该不难吧。
应该是类似于一个俄罗斯方块的小游戏。
我想问的楼主想问的是技术实现方面的还是逻辑实现方面的?应该是技术方面吧,逻辑估计问题不是很大,关键是怎么实现它

技术上没感觉到有难度的。应该JDK1.4之前的内容就足够了。
你尝试着先一点点写着吧,遇到不会的解不开的在发帖问。自己做和看别人做收获差别是很大的。
如果让我做,我会设计一个15*15的JLabel,225个Jlabel分别控制自己的格子显示相应的内容就行了。
剩余的就是逻辑层的显示了。
[其他解释]
还不如英文原题好理解
[其他解释]
引用:
还不如英文原题好理解
英文原版在这里:
The Paintbot game is played on a 15 by 15 grid on which the two robots reside and compete. 
Only one robot may occupy a square at a time. (If two robots try to occupy the same square at 
the same time, they crash. There is more about this later.)  Robots may turn 90 degrees left, 90 
degrees right, move forward one square, move backward one square, or stay in the same spot. In 
addition, at any of these moves, the robot may fire a blob of paint, red or blue. At the beginning 
of the game, all squares on the board are painted white (a neutral color) and each robot is 
randomly assigned a paint color of red or blue. The game lasts for 300 moves, and both robots 
move simultaneously.  During each turn or move of the simulation, the robot may make a move, 
given by its control algorithm (the class you are writing). If the robot moves out of a square, the 
square that it leaves is turned the robot’s color. The goal of the game is to have more squares on 
the board painted your color than your robot opponent’s color. This is accomplished by moving 


around the board and painting the squares. Thus, it is good to paint over squares colored your 
opponents color, as it adds a square that is your color and takes one away from your opponent. 
There are of course some wrinkles.  
1. You may shoot a blob of paint, and if you hit your opponent’s robot, that robot will paint your 
color instead of its own when it moves. This will last for 20 moves. Shooting takes place at the 
end of the move. 
2. You have only a limited number of paint blobs that you may shoot. This number is 30.  
3. If you run into a wall, the game will end and your robot loses automatically.  4. If you run into the other robot, the game will end immediately and the robot with the most 
squares painted its color at that point will win. 
5. The game board contains squares that have rocks in them. Neither robot may enter these 
squares, and running into a square with rocks will terminate the game with a loss for the player 
that runs into the rock. (Just like running into a wall.)  
6. You cannot fire through a rock.  
7. Each time your control algorithm decides on the next move, it has access to its current 
surroundings in the form of a 5 by 5 square. The robot you are controlling is at the center of the 
square, and the direction it is facing is always considered “up.”  This is called a short-range or 
local scan  
8. Your control algorithm may also receive a limited number of long-range scans which gives the 
contents of the entire 15 by 15 board.  A long-range scan is available to you with any move. You 
are limited to 30 long-range scans.  
10. At the beginning of the simulation, rocks are placed randomly on the board and the two robots in 
competition are placed at a random position on the board.
[其他解释]
该回复于2012-11-24 09:58:00被管理员删除
[其他解释]

引用:
这个要想应付一下很简单 只要不撞对方车 可能的情况就射击他 由于还有雾这一说 设计ai可能需要实验 我就不写了 没有环境 不过我感觉这么多的随机条件你能不撞墙 射击他 还是有胜算的 雾什么的不考虑了
嗯,正在讨论,这种作业都不让讨论,要自己完成,不过基本上每次都会讨论……
------其他解决方案--------------------


引用:
总之,这个游戏要写出来,细节上会有很多,写好不容易,但是可以分开一个功能一个功能的先写好,例如扫描的动画,移动绘制,撞到石头,射击,然后再组合,尤其是中间的动画,要对线程的使用比较熟悉,而且为了性能考虑,不能每个东西都用一个线程,需要合理的决定使用线程。
不过这种方式对设计能力有一定的要求,因为是最后组合,所以设计的时候,接口就要求设计得合理。
……好高深的样子,线程是啥玩意?现在才刚刚学完继承……
[其他解释]
引用:
引用:这个要想应付一下很简单 只要不撞对方车 可能的情况就射击他 由于还有雾这一说 设计ai可能需要实验 我就不写了 没有环境 不过我感觉这么多的随机条件你能不撞墙 射击他 还是有胜算的 雾什么的不考虑了嗯,正在讨论,这种作业都不让讨论,要自己完成,不过基本上每次都会讨论……

不是不让讨论,而是需要提出自己的看法,大家在看哪里不好,哪里好,怎么选择,很多不让讨论,是指直接要代码的
[其他解释]
第7点第8点没看懂什么意思,short-range , local scan  是什么意思呢?
[其他解释]
引用:
引用:引用:这个要想应付一下很简单 只要不撞对方车 可能的情况就射击他 由于还有雾这一说 设计ai可能需要实验 我就不写了 没有环境 不过我感觉这么多的随机条件你能不撞墙 射击他 还是有胜算的 雾什么的不考虑了嗯,正在讨论,这种作业都不让讨论,要自己完成,不过基本上每次都会讨论……
不是不让讨论,而是需要……
……我是说我们老师不让讨论,但是没人听他的……
[其他解释]
引用:
第7点第8点没看懂什么意思,short-range , local scan  是什么意思呢?
short range就是5*5,local scan不清楚……
[其他解释]
Mark下,真是不容易的题目
[其他解释]
刚学java,来凑个热闹。
[其他解释]
还是看中文吧~
[其他解释]
这个问题我感觉应该不难吧。
应该是类似于一个俄罗斯方块的小游戏。
我想问的楼主想问的是技术实现方面的还是逻辑实现方面的?
[其他解释]
引用:
引用:总之,这个游戏要写出来,细节上会有很多,写好不容易,但是可以分开一个功能一个功能的先写好,例如扫描的动画,移动绘制,撞到石头,射击,然后再组合,尤其是中间的动画,要对线程的使用比较熟悉,而且为了性能考虑,不能每个东西都用一个线程,需要合理的决定使用线程。
不过这种方式对设计能力有一定的要求,因为是最后组合,所以设计的时候,接口……

我表示有点蛋疼咯
[其他解释]
感觉很有趣,也想弄弄看
[其他解释]
引用:
第7点第8点没看懂什么意思,short-range , local scan  是什么意思呢?
刚刚找到的,LocalScan是一个class,所有和这个程序相关的class信息都在这里:http://www.cs.iastate.edu/~cs227/assignments/assignment3/doc/paintbots/
[其他解释]
引用:
这个问题我感觉应该不难吧。
应该是类似于一个俄罗斯方块的小游戏。
我想问的楼主想问的是技术实现方面的还是逻辑实现方面的?
应该是技术方面吧,逻辑估计问题不是很大,关键是怎么实现它
[其他解释]
该回复于2012-11-26 09:41:32被管理员删除
[其他解释]
引用:
Mark下,真是不容易的题目
还有请忽略掉第9条关于雾的设计,作业里没有这一条,中文是从网上找的,英文是我们学校的assignment3.pdf里面复制粘贴过来的
[其他解释]
这个虽然是Java作业,不过发到“人工智能”或者“算法”之类的板块可能更有帮助。

热点排行
Bad Request.