Computer Science Canada Tic tac toe AI Help |
Author: | RicardoB [ Thu Sep 02, 2010 9:27 pm ] |
Post subject: | Tic tac toe AI Help |
Hi, I want to implement my current program to use AI so I can do human vs CPU. First I will like to hear some ideas from where to start I know i Need the concepts of min max, also alpha beta pruning. I have to overlook 3 ways on the tree. Ill post my code... file:///H:/tictactoe.java I dont have a clear idea how to do it. NO im not asking for someone to do it for me or code it for me I need ideas pseudo code .. from there on i will start.. thank you. |
Author: | andrew. [ Thu Sep 02, 2010 9:37 pm ] |
Post subject: | RE:Tic tac toe AI Help |
I'm sorry that I cannot help you with your problem, but I just wanted to point out that your "attached" file is not actually attached. You can't just paste the local location of the file, you must upload it using the upload button when you create or edit a post. |
Author: | TerranceN [ Thu Sep 02, 2010 9:44 pm ] | ||||
Post subject: | RE:Tic tac toe AI Help | ||||
Well what do you do when you play Tic Tac Toe? Go through it step by step and there's your ai. If that isn't enough then work backwards from the winning move all the way to the starting move. What patterns do you see? How can your ai use those patterns to its advantage? Also the path to a file on your computer will not allow us to get to it. Just use java tags and just paste your code like this
which will then look like this
Hope that helps. |
Author: | RicardoB [ Thu Sep 02, 2010 11:15 pm ] | ||
Post subject: | Re: Tic tac toe AI Help | ||
Im sorry i didnt look at that here it is.
|
Author: | Nai [ Fri Sep 03, 2010 5:46 pm ] |
Post subject: | Re: Tic tac toe AI Help |
I had to do a similar project in grade 10 using Turing. I pretty much just created the AI by first covering the basics (if the cpu has 2 in a row then take the third, if the player has two then block him) and then I googled tic tac toe strategies and did trial and error for the rest of it. If your interested in seeing my turing code you can find it here: http://compsci.ca/v3/viewtopic.php?p=188183#188183 |
Author: | RicardoB [ Mon Sep 06, 2010 5:04 am ] |
Post subject: | RE:Tic tac toe AI Help |
I have been working on it and some other things but ill try to check it since it has gui's and i dont need them but same concept ill post what i have hope someone can give me like pseudo code or ideas to do the min max or the pruning |
Author: | Barbarrosa [ Mon Sep 06, 2010 12:49 pm ] |
Post subject: | Re: Tic tac toe AI Help |
I've written Tic Tac Toe 3x. All you really need to do for AI is cause it to place a valid move on the board while alternating turns with the player. You can implement these strategies pretty easily: http://en.wikipedia.org/wiki/Tic-tac-toe#Strategy You can disable some strategies to make the game easier. |
Author: | RicardoB [ Mon Sep 06, 2010 7:15 pm ] |
Post subject: | RE:Tic tac toe AI Help |
Well I have made the progress to do it with little AI which is just makign the cpu generate random integers and being a valid move. Now i want to do the Min Max... but im stuck.... |
Author: | RicardoB [ Mon Sep 06, 2010 10:06 pm ] |
Post subject: | Re: Tic tac toe AI Help |
Barbarrosa @ Mon Sep 06, 2010 12:49 pm wrote: I've written Tic Tac Toe 3x. All you really need to do for AI is cause it to place a valid move on the board while alternating turns with the player. You can implement these strategies pretty easily:
http://en.wikipedia.org/wiki/Tic-tac-toe#Strategy You can disable some strategies to make the game easier. I coming with an idea based on your response which i think it might be useful but did you considered before advising me that i do need to use the min max and pruning to complete the assignment. If you considered this then it might work if i can come up wit a good idea that which im thinking of ill let you know if this is what u mean. Note.. for people who might i say i want them to do it for me thats not the case lol. |