
-----------------------------------
billsp
Wed Mar 12, 2003 4:57 pm

How do you close a window by pressing only 1 key?
-----------------------------------
I'm using Turing 3.1 and I'm not quite sure how to close the 1st window and get a 2nd one up. Thanks

-----------------------------------
Asok
Wed Mar 12, 2003 5:52 pm


-----------------------------------
I don't quite understand what specifically you're trying to do. If you can't open multiple windows then that is because Turing is running in Beginner mode and you can change that through prefferences. If your problem is something else please go in to more detail.

-----------------------------------
billsp
Wed Mar 12, 2003 6:19 pm

I need to make it so I can press any key instead of enter to
-----------------------------------
I need to make it so I can press any key instead of enter to get to the tic tac toe screen. Thanks

var w:=Window.Open("fullscreen")
var o1,o2,o3,o4:int
var x1,x2,x3,x4,x5:int
var junk:string
%-----------------------------------------------
drawfillbox (maxx,maxy,0,0,Yellow)
colour (green)
locate (maxrow div 2,maxcol div 2 -13)
put"Welcome to Tic Tac Toe!"
locate (maxrow,maxcol)
put"Press any key to begin playing Tic Tac Toe."
get junk:*
delay(200)
Window.Close(w)


%-----------------------------------------------
var h:=Window.Open("fullscreen")
drawfillbox (maxx,maxy,0,0,Yellow)
procedure Xi9                 %X In 9
    drawline(800,0,600,145,Black)
    drawline(775,145,600,0,Black)
end Xi9
procedure Xi8                 %X In 8
    drawline(300,0,500,145,Black)
    drawline(300,145,500,0,Black)
end Xi8
procedure Xi7                 %X In 7
    drawline(0,0,200,145,Black)
    drawline(0,145,200,0,Black)
end Xi7
procedure Xi6                 %X In 6
    drawline(800,200,600,400,Black)
    drawline(800,400,600,200,Black)
end Xi6
procedure Xi5                 %X In 5
    drawline(300,200,500,400,Black)
    drawline(300,400,500,200,Black)
end Xi5
procedure Xi4                 %X In 4
    drawline(0,200,200,400,Black)
    drawline(200,200,0,400,Black)
end Xi4
procedure Xi3                 %X In 3
    drawline(800,450,600,600,Black)
    drawline(800,600,600,450,Black)
end Xi3
procedure Xi2                 %X In 2
    drawline(300,450,500,600,Black)
    drawline(300,600,500,450,Black)
end Xi2
procedure Xi1                 %X In 1
    drawline(0,450,200,600,Black)
    drawline(0,600,200,450,Black)
end Xi1
procedure Oi1                 %O In 1
    drawoval(100,525,50,50,Red)
end Oi1
procedure Oi2                 %O In 2
    drawoval(400,525,50,50,Red)
end Oi2
procedure Oi3                 %O In 3
    drawoval(697,525,50,50,Red)
end Oi3
procedure Oi4                 %O In 4
    drawoval(100,300,50,50,Red)
end Oi4
procedure Oi5                 %O In 5
    drawoval(400,300,50,50,Red)
end Oi5
procedure Oi6                 %O In 6
    drawoval(697,300,50,50,Red)
end Oi6
procedure Oi7                 %O In 7
    drawoval(100,70,50,50,Red)
end Oi7
procedure Oi8                 %O In 8
    drawoval(400,70,50,50,Red)
end Oi8
%--------------------------------------
drawfillbox (200,0,250,700,Red)
drawfillbox (525,0,575,800,Red)
drawfillbox (0,400,800,450,Blue)
drawfillbox (0,150,800,200,Blue)


-----------------------------------
Tony
Wed Mar 12, 2003 11:05 pm


-----------------------------------
you want

getch() :wink:

just like a get, but it takes a single key as its input :D


var c:string(1)
put "press a key"
getch(c)
put "you pressed ", c


Note that its string(1) meaning its 1 character long. Turing will give you an error otherwise :?

-----------------------------------
billsp
Thu Mar 13, 2003 9:42 am


-----------------------------------
Thanks for the help. I understand now
