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
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Albrecd




PostPosted: Wed Jan 18, 2006 5:20 pm   Post subject: (No subject)

You are stuck because "button" will never = 2. If the left button is down it = 1, if the middle button is down it = 10, and if the right button is down it = 100.
Sponsor
Sponsor
Sponsor
sponsor
jam jam




PostPosted: Wed Jan 18, 2006 5:28 pm   Post subject: (No subject)

but it then says taken has not been declared yet. how do i fix that
Albrecd




PostPosted: Wed Jan 18, 2006 5:43 pm   Post subject: (No subject)

Do you have
Mouse.ButtonChoose ("multibutton")
in your code?
jam jam




PostPosted: Wed Jan 18, 2006 6:02 pm   Post subject: (No subject)

it doesn't seem to be working. Is this what i'm suppose to do?

function player_move :int
Mouse.ButtonChoose ("mulitbutton")
var x, y, button:int
loop
Mouse.Where (x,y,button)
if button=2 then
if x>=5 and x<205 and y>=5 and y<=205 then
if not (taken(6)) then
result 6
end if
elsif x>=205 and x<405 and y>205 and y <=205 then
if not (taken(5)) then
result 5
end if
elsif x>=405 and x<600 and y>=405 and y<=600 then
if not (taken(4))then
result 4
end if
elsif x>=5 and x<=205 and y>=205 and y<=405 then
if not (taken(7)) then
result 7
end if
elsif x>=5 and x<405 and y>=5 and y<=405 then
if not (taken(2)) then
result 2
end if
elsif x>=205 and x<=405 and y>=5 and y<=205then
if not (taken (1))then
result 1
end if
elsif x>205 and x<=405 and y>=405 and y<=600then
if not (taken (9))then
result 9
end if
elsif x>405 and x<600 and y>=5 and y<=206 then
if not (taken (8))then
result 8
end if
elsif x>=405 and x<600 and y >=205 and y<=405 then
if not (taken(3))then
result 3
end if
end if
end if

end loop
end player_move
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 2 of 2  [ 19 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: