Original Post
hi have anyone done a tic-tac-toe before,can you guy teach me how to begin to write it since i''m a beginner.by the way i''m using C to begin to write this game.
if x = 1, o = -1, and blank = 0
__
_____| 3|
| o x| 0|
|o x o|-1|
|x____| 1|
|0_0_0__1|
quote:
Original post by Punty50
Yeah, but who wants to play against an AI that will automatically win if you make one mistake? Instead, do things like search depth proportional to difficulty, or let it learn which moves are bad or good by a training process. This method is obviously far more difficult to implement, but I think it will make for a far more enjoyable game.
Brendan
quote:
Original post by RPGeezus
Use MinMax with AlphaBeta pruning to build a tree of the entire game and choose the best good move available. Plays perfectly. Can easily be extended to Four-In-A-Row.
Will
quote:
Original post by RPGeezus
It''s really hard to explain, especially in a forum. There are some excellent online examples of MinMax and AlphaBeta though, many with source examples. Do a search on Goggle for "MinMax AlphaBeta Java".
Cheers,
Will
quote:
1. Make a winning move.
2. Block the player''s winning move.
3. Get the first available corner.
4. Get the first available non corner.
5. Get the center.
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more