Computer Science Canada

TIC TAC TOE

Author:  notleetprogrammer [ Fri Jun 09, 2006 5:30 pm ]
Post subject:  TIC TAC TOE

HEY...i came to this site with possebly the worst looking Tic Tac Toe game ever...but now it is finished and way better than my fist one ever was...

Author:  notleetprogrammer [ Fri Jun 09, 2006 5:33 pm ]
Post subject: 

This was how this game started
code:


left click is x
right click is y


var x, y, button : int
var buttonnumber, buttonupdown : int
var font1 : int
var check : boolean := false
drawbox (300, 300, 100, 100, black)
drawline (235, 300, 235, 100, black)
drawline (160, 300, 160, 100, black)
drawline (300, 235, 100, 235, black)
drawline (300, 170, 100, 170, black)
font1 := Font.New ("serif:40:bold")
mousewhere (x, y, button)
buttonchoose ("multibutton")

loop
check := false
loop
buttonwait ("down", x, y, buttonnumber, buttonupdown)
if buttonnumber = 1 and buttonupdown = 1 then
drawfilloval (x, y, 20, 20, black)
check := true
end if
exit when check = true
end loop
check := false
loop
buttonwait ("down", x, y, buttonnumber, buttonupdown)
if buttonnumber = 3 and buttonupdown = 1 then
Font.Draw ("X", x, y, font1, red)
check := true
end if
exit when check = true
end loop
end loop
code:

Author:  upthescale [ Fri Jun 09, 2006 9:18 pm ]
Post subject: 

nice man, awsome game, cept when i hit no to paly again, it still played lol but good job

Author:  notleetprogrammer [ Fri Jun 09, 2006 9:30 pm ]
Post subject: 

thnx man...took me a while to make it..cause i just started this turing thing...lol this was for my final proj. umm to not play again it's supposed to be "No" not "no"

Author:  upthescale [ Fri Jun 09, 2006 10:24 pm ]
Post subject: 

wut u can do is go
if answer = "No " or answer "no" then
code
end if


or u can use an upper string btu i dont no howe to use it

Author:  TheOneTrueGod [ Sat Jun 10, 2006 9:22 am ]
Post subject: 

neurgh, no upthescale, thats not what you should do. You shoule use

code:

Str.Upper(s : string)


where s is the string you want to check. This way, it covers entries like "nO" or "NO" as well.

Author:  notleetprogrammer [ Sat Jun 10, 2006 9:41 am ]
Post subject: 

thnx for ur help...but i dunno how to use the
code:
Str.Upper(s : string)

Author:  TheOneTrueGod [ Sat Jun 10, 2006 9:44 am ]
Post subject: 

code:

put Str.Upper("hi, tHis cOuLd be an ExAmple Of WHAT STRUPPER does")


Try out some other examples, like using it with a variable. Its not too hard to figure out Wink

Author:  notleetprogrammer [ Sat Jun 10, 2006 10:16 am ]
Post subject: 

lol thnx..i'll try it

Author:  notleetprogrammer [ Mon Jun 12, 2006 7:54 pm ]
Post subject: 

comon ppl i need feeeedaback


: