Computer Science Canada Creating system to record mouse click spots Tic Tac Toe |
Author: | icsguy123 [ Mon Jan 21, 2013 11:47 am ] | ||||
Post subject: | Creating system to record mouse click spots Tic Tac Toe | ||||
What is it you are trying to achieve? Creating a recording system for Tic Tac Toe for where the player clicks What is the problem you are having? I can't figure out why it isn't working. I've created a record system, but am having trouble figuring out how to initialize it, and to make it work. Describe what you have tried to solve this problem I've tried creating a function to tell me when the board is full, but that dosent work with Tic Tac Toe. The other idea I tried is whats included in the text provided, makig a record for the spots. Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Please specify what version of Turing you are using Turing 4.1.1 Please Help I hope somebody can help, I am a noob at this so please don't give me a hard time! Thanks! |
Author: | Raknarg [ Mon Jan 21, 2013 5:07 pm ] |
Post subject: | RE:Creating system to record mouse click spots Tic Tac Toe |
First of all... Why are you making an array of 81 slots? You can just use an array 1 .. 9, or an array 1 .. 3, 1 .. 3 |
Author: | icsguy123 [ Mon Jan 21, 2013 5:24 pm ] |
Post subject: | RE:Creating system to record mouse click spots Tic Tac Toe |
Oops.Did I mention I was a noob? lol so I've sorted that out, now Ive initialized the array, but where should I place it in the program for it to take affect? In the loop? |
Author: | Raknarg [ Tue Jan 22, 2013 8:51 pm ] |
Post subject: | RE:Creating system to record mouse click spots Tic Tac Toe |
Wherever it's needed, whenever you need to access it. For instance lets say on o's turn the player selects the top left corner. WE could say slots (1, 1) = "O" or something. or if X selects the middle right, you would set slots (3, 2) to "X". You can put it wherever you want. Remember this is basically a set of instructions. Think about what you want to do exactly and tell your program to do exactly that. |