如何在带有IA的9x9板中编写Tic tac toe游戏 [英] How do I code a Tic tac toe game in a 9x9 board with an IA

查看:82
本文介绍了如何在带有IA的9x9板中编写Tic tac toe游戏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



对于一个学校项目,我必须使用minimax算法和alpha在9行9列的游戏中制作游戏tic tac toe -beta狡猾的人工智能与电脑对战。



如果玩家成功对齐4 X或O,则该玩家获胜。在游戏开始时,电路板的所有方框都已启用,但在第一次播放后,我禁用所有内容并仅启用相邻的框,依次激活框...



游戏应该有3个级别,能够对抗计算机(IA)或同一台PC上的朋友,或局域网上的其他玩家,使用套接字(玩家是服务器和另一个是客户端)



对于GUI我将只使用java swing我猜



任何人都已经像这个项目一样?如果可能的话,我需要建议,有用的链接或教程。 Thaks:)

Hello,

For a school project I have to make the game tic tac toe on a board 9 line by 9 column in java using the minimax algorithm and alpha-beta prunning for artificial intelligence to play against the computer.

The player wins if he successfully aligned 4 X or O . At the beginning of the game, all boxes of the board are enabled, but after the first play , I disable everything and leaves only the adjacent boxes enabled, and so on the boxes are activated ...

The game should have 3 levels and the ability to play either against the computer (IA) or against a friend on the same pc, or with another player on a LAN network , using sockets (a player is the server and the other one is a client)

For the GUI I will use only java swing I guess

Anyone have already made like this project ? I need advices , useful links or tutorials if possible . Thaks :)

推荐答案

从这里开始: Tic_Tac_Toe上的维基百科 [ ^ ]



他们很好地解释了这个游戏。



你应该扩展GUI的组件,使它们满足你的需求。

你可以创建一个方形的按钮,上面有以太标记X或O ......
Start here: wikipedia on Tic_Tac_Toe[^]

They explain the game pretty well.

You should extend the components for the GUI to make them fit your needs.
You can for example create a button that is square and has ether mark X or O on it...


这篇关于如何在带有IA的9x9板中编写Tic tac toe游戏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆