Computer Science Canada

Help with Tic Tac Toe game

Author:  slipstream [ Wed Jan 25, 2006 5:29 pm ]
Post subject:  Help with Tic Tac Toe game

alright im still trying to get the buttons to work so im trying something new. What i need to know is how to make it so that when i push the Number 1 key it'll draw a X at a certain spot.
all i know how to set something similiar to this is when u push the arrow keys but i dont know how to set it for the number keys.
this is what i got for arrow keys


code:

Var Key:array char of boolean
        if key (LEFT_BUTTON) then
        draw X
        drawline (100,100,175,175,blue)
        drawline (100,175,175,100,blue)

I chose to just draw out the line other than useing Font but i just need help how to identify the number keys or even the first 9 letters of the alphebet. Do i just replace the (LEFT_BUTTON) with (1)????

Author:  person [ Wed Jan 25, 2006 5:37 pm ]
Post subject: 

yes, just replace it with the key u want

Author:  slipstream [ Wed Jan 25, 2006 7:49 pm ]
Post subject: 

hmm its saying Draw is not a procedure and hence cannot be called..
how i fix this?

Author:  person [ Wed Jan 25, 2006 8:33 pm ]
Post subject: 

use Font.Draw
if u dont know wat it is, F10 it

Author:  slipstream [ Wed Jan 25, 2006 8:55 pm ]
Post subject: 

i cant figure wats wrong...when i push the right arrow key the X still dont appear...what am i missing?

code:

var keys:array char of boolean
    if keys (KEY_RIGHT_ARROW) then
    drawline (110,110,145,145,blue)
    drawline (110,145,145,110,blue)
    end if

Author:  person [ Wed Jan 25, 2006 8:58 pm ]
Post subject: 

look at ur code and tell me y it doesnt compile

Author:  slipstream [ Wed Jan 25, 2006 9:09 pm ]
Post subject: 

i need to declare the arrow keys??? but what if i dont wanna use the arrow keys and i want to use numbers instead??? how will that work?

Author:  person [ Wed Jan 25, 2006 9:14 pm ]
Post subject: 

1) an if statement checks if a condition is true
2) arrow keys and any char on the keyboard are the same concept
3) no offense, but i think making tic-tac-toe may be too advanced for ur level
4) look up these in F10 or tutorials in compsci: Input.KeyDown; Decision Structures


: