Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Tic tac toe on 5x5 board


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
12 replies to this topic

#1 patishi   Members   -  Reputation: 212

Like
0Likes
Like

Posted 18 August 2013 - 05:19 AM

Hi all.   I started my journey into AI board games with a simple tic tac toe (alphaBeta) implementation in java,and than i continued to the more challenging connect 4 game also in java.   The latter obviously demanded much more time and learning , and my knowledge is a lot more because of that (and thanks to a lot of help from certain forum's members).      
Now i am starting to learn some objective-C (and as a consequence some c) and i wanted to practice the language syntax with another little and not too difficult to program board game (chess was originally my next step,but it will have to wait for later).     I so what can be more easy to implement than a tic tac toe game, but this time, in order for it to be a little more challenging and less boring, i though of making a 5x5 board tic t ac toe.   

but i have some questions:   
1.  is it best to play for 4 in a row in 5x5 board?  or maybe  5 in a row?   ( or stay with the default 3? )

 

2.  second,  do you think that in case of 5x5 board it would be possible to have perfect alpha beta (full game search)  in short time ,   i did it this way in the normal TTT 3x3 board, pure alpha beta without transposition tables,heuristic evaluations functions...nothing!    but i wander if this can be done in a bigger 5x5 board.  
 

Any more advices and insites are welcome  :)   thx!



Sponsor:

#2 Álvaro   Crossbones+   -  Reputation: 13645

Like
0Likes
Like

Posted 18 August 2013 - 06:58 AM

What does tic-tac-toe on a 5x5 board mean? It doesn't look like you know. Designing interesting board games is not a trivial task, so I suggest you pick some well-known game instead of making your own.

If chess is what you want to work on (and given that you have done some work on connect-4 already), go work on chess. The Chess Programming Wiki has a lot of useful info to get you started and then entertained for a few years.

#3 patishi   Members   -  Reputation: 212

Like
0Likes
Like

Posted 18 August 2013 - 07:20 AM

Chess is to complicated right now and i still needs much more practice in coding in c/objective C.    so far i have practiced in some basic coding exercises (mainly from Cprogramming  site),   but i want to do something a little more complicated than that the requires creating classes and more complex structures and functions.    but i don't want it to be too complicated so i will be able to concentrate mainly on learning the language.    

5x5  tic tac toe is just a normal tic tac toe on a 5x5 board (same rules).  this is not my invention,i heard about it from other sources, although it is not that common.       I can maybe try to do checkers, but i think that it is getting to be too complicated for me right now.
I just wasn't sure if 5x5 board tic tac toe will be the same as a normal tic tac toe in the sense that it will not add nothing to the complexity of the game, and in that case there is no point in me doing this.   otherwise i would just make a regular tic tac toe and get over with this...

again,this is mainly for practicing the language.  I  know that tic tac toe will not challange me too much at this point,but it could be a nice language practice.



#4 jakson15   Members   -  Reputation: 301

Like
0Likes
Like

Posted 18 August 2013 - 07:37 AM

Tic Tac Toe wouldn't work properly as a 3 in a row on a 5x5 grid.

The first will always win if they place a piece in the center or the middle ring.

No matter where the second person goes the first person will be able to place a piece on the center/middle ring, the second person has two options to block, and the first person wins on the third go.

A 4 in a row on a 5x5 grid may be a little harder but the first person will always be in the lead as the second person will have to block every single turn instead of trying to score a 4 in a row.

 

5 in a row, will end in more stalemates as there are more places for each other to block and only 12 ways to win.



#5 patishi   Members   -  Reputation: 212

Like
0Likes
Like

Posted 18 August 2013 - 07:43 AM

Thanks for the comment.  I guess there is not substitute for the original 4 in a row (connect 4) smile.png   So i guess it is not the best idea after all      well,  maybe i will just go with checkers or something...     Although i would really love to work on a chess engine of my own someday,  right now i just want to do something not to difficult just to learn the c/objective C language.    
maybe checkers will do fine for a little learning project.    it seems to me like not too hard to implement game,or am i wrong...

I also thought about gomoku (a 13x13 five in a row)  but i realized that it can be much more trickier than i think


Edited by patishi, 18 August 2013 - 07:46 AM.


#6 Álvaro   Crossbones+   -  Reputation: 13645

Like
0Likes
Like

Posted 18 August 2013 - 11:54 AM

I think writing your first chess program is easier than writing your first checkers program. You can start with a version of chess with no castling and no en-passant rule, which simplifies things quite a bit.

Another easy game to program is Mancala.

#7 patishi   Members   -  Reputation: 212

Like
0Likes
Like

Posted 18 August 2013 - 01:01 PM

sound interesting, i will look into it.   i am always anxious to learn new games :)



#8 Tom KQT   Members   -  Reputation: 1610

Like
0Likes
Like

Posted 20 August 2013 - 04:58 AM

In my country nobody plays the boring 3x3 tic-tac-toe, we know this version only from american movies. We play on "unlimited" board and the goal is to connect 5 symbols. That's quite hard and perfectly playable version.

Of course the board is not unlimited, but it's always larger than 5x5 of course. It can be anything, based on the squared paper that the players actually have available smile.png

On a computer, you even can make it unlimited, because the game never really takes too much place, so you can extend the borders in the code as needed. But if the board is limited, it serves also for gameplay purposes, the player has to count with the fact that he may not be able to connect 5 if he gets too close to the border.

 

Btw, I've done a simple (but working) AI for this game. It was just about traversing all squares and computing "offensive" and "defensive" numbers for each of them, then summing them and playing the square with the highest score.

Offensive is where you would make a longer line, defensive is where you would block the enemy's line. If a square can belong to more lines, then the scores are added together of course.

 

Situations like 4 symbols in a line with empty space on one side have a special bonus score, because you simply must play there (either to win or to block the enemy's winning move).

 

Or course this AI thinks only about the 1 following move, it cannot intentionally create something really clever, like some kind of trap.


Edited by Tom KQT, 20 August 2013 - 05:10 AM.


#9 Álvaro   Crossbones+   -  Reputation: 13645

Like
0Likes
Like

Posted 20 August 2013 - 05:04 AM

In my country nobody plays the boring 3x3 tic-tac-toe, we know this version only from american movies. We play on "unlimited" board and the goal is to connect 5 symbols. That's quite hard and perfectly playable version.

In my country we don't play the boring 3x3 tic-tac-toe either. We play on an 8x8 board with 8 pawns, 2 rooks, 2 knights, 2 bishops, a queen and a king per side, and instead of connecting 3 symbols the goal is to give checkmate.

#10 Tom KQT   Members   -  Reputation: 1610

Like
0Likes
Like

Posted 20 August 2013 - 05:12 AM

 

In my country nobody plays the boring 3x3 tic-tac-toe, we know this version only from american movies. We play on "unlimited" board and the goal is to connect 5 symbols. That's quite hard and perfectly playable version.

In my country we don't play the boring 3x3 tic-tac-toe either. We play on an 8x8 board with 8 pawns, 2 rooks, 2 knights, 2 bishops, a queen and a king per side, and instead of connecting 3 symbols the goal is to give checkmate.

 

But that's a completely different game.

And to play tic-tac-toe you need just one (or two) pens and a paper (preferably squared, but you can draw squares in a minute). You can play it on a train, bus, at school during the break or even during boring classes under the desk smile.png

To play chess you need much more and also much more time.

So sorry, but you cannot compare it.


Edited by Tom KQT, 20 August 2013 - 05:14 AM.


#11 Álvaro   Crossbones+   -  Reputation: 13645

Like
0Likes
Like

Posted 20 August 2013 - 06:30 AM

I see in your country they don't use sarcasm as much in mine.

 

Yes, chess is a completely different game, and so is gomoku (the game you described).



#12 Tom KQT   Members   -  Reputation: 1610

Like
0Likes
Like

Posted 20 August 2013 - 06:54 AM

You didn't know that sarcasm doesn't work on internet forums? It's quite impossible to detect it, usually. wink.png

 

Ouch, I didn't know the game was originally called Gomoku. Thanks for that. (no sarcasm smile.png )


Edited by Tom KQT, 20 August 2013 - 07:01 AM.


#13 Dannyli   Members   -  Reputation: 135

Like
0Likes
Like

Posted 26 August 2013 - 12:39 PM

tic tac toe is in 3x3 Right?






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS