Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Help with Tic Tac Toe game
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
slipstream




PostPosted: 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)????
Sponsor
Sponsor
Sponsor
sponsor
person




PostPosted: Wed Jan 25, 2006 5:37 pm   Post subject: (No subject)

yes, just replace it with the key u want
slipstream




PostPosted: Wed Jan 25, 2006 7:49 pm   Post subject: (No subject)

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




PostPosted: Wed Jan 25, 2006 8:33 pm   Post subject: (No subject)

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




PostPosted: Wed Jan 25, 2006 8:55 pm   Post subject: (No 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
person




PostPosted: Wed Jan 25, 2006 8:58 pm   Post subject: (No subject)

look at ur code and tell me y it doesnt compile
slipstream




PostPosted: Wed Jan 25, 2006 9:09 pm   Post subject: (No 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?
person




PostPosted: Wed Jan 25, 2006 9:14 pm   Post subject: (No 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
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 8 Posts ]
Jump to:   


Style:  
Search: