Posted 05 January 2013 - 01:03 PM
So,Im trying to make an Guess the number pro edition,and when I start the program,after the intro,the computer freezes and just turns off.Here is the code:
--To set off stuff
ver = ("v.1.0")
maxt = ("11")
tr = ("1")
win = ("false")
numb = math.random(1,1000)
--Intro
term.clear()
sleep(1)
term.setCursorPos(21,9)
textutils.slowPrint("P4 studios")
sleep(3)
term.clear()
--GTN Intro
term.setCursorPos(17,9)
textutils.slowPrint( [[ ------------------
Guess That Number!
------------------ ]] )
term.setCursorPos(18,12)
sleep(1)
print("Pro e. "..ver)
term.setCursorPos(16,15)
sleep(1)
print("Press Enter To Continue!")
io.read(enter)
--Game
term.clear()
term.setCursorPos(1,1)
print("Welcome!Pick a number from 1-1000!")
print("You have 10 tries.")
while true do
if tr > maxt then
guess = io.read()
guess = tonumber(guess)
if guess == numb then
win = ("true")
else
print("You got this one wrong,But try again!")
if guess > numb then
print("Your guess was to high!")
else
if guess < numb then
print("Your guess was to low!")
else
print("Ok?Invalid input?")
end
end
end
end
end
--results
if win == true then
print("You won!")
end
if win == false then
print("You lost!")
end
Mainly were it sais "–Game"Is were it shuts off.So,Is there any thing im doing wrong?