OK I've decided to make a tic tac toe game for my fx-9750g+ using a matrix to store the positions, the only problem was that I didn't know how to use a matrix.
So far I've worked out that you can:
- Set a matrix using {x,y}->Dim Mat A.
- Use Mat A[2,3]->Z to get the value at 2 across, 3 down, stored under Z.
- Set a number on the Matrix using x->Mat A[2,3]
My code I've got so far is basically as follows:
 
1->B ----- B determines whether its a O or X
{3,3}->Dim Mat A. ----- To set a 3x3 grid to store which squares have been taken.
Using F-lines to draw the grid on the screen
start loop
    If getkey=71 and Mat A[1,3]=0 ----- If key '1' is pressed and the according square is free:
        then 1->Mat A[1,3] ----- Change the matrix value to show that it is now taken
        B=1=>Circle (co-ordinates) ----- If it's 'O' turn then draw a circle
        B=2=>F-line to draw cross ----- If it's 'X' turn draw a cross
        3-B->B ----- Changing the turn e.g. Making B=2 if it previously equaled 1
    IfEnd ----- This is repeated for each of the keys 1->9
Endloop
I'm getting a Syntax error after the graph is drawn, so once the loop has started. I'm guessing it's to do with the matrix.
Any help would be much appreciated.


 
	 
			
			
			
				 
					 
			
			 
				
				
			

 
				
				
			 
  
	 
	 Answered
 Answered 
	 
	 
	
