I'm having trouble with a program. And I can't figure it out. Help?
heres the program:
print("What would you like to eat today")
sleep(1)
print("Type C for cookies")
sleep(.5)
print("type P for pork")
sleep(.5)
print("And type A for apples")
term.write("Order:") then
if input = "C" then
rs.setOuput("top", true)
sleep(1)
rs.setOutput("top.false")
print("Thank for ordering!")
sleeep(1)
os.reboot()
else
if input = "P" then
rs.setOutput("left", true)
sleep(1)
redstone.setOutput("left", false)
print("Thank you for ordering!")
sleep(1)
os.reboot()
if input = "A" then
rs.setOutput("right", true)
sleep(1)
rs.setOutput("right", false)
print("Thank you for ordering!")
sleep(1)
os.reboot()
else
print("Sorry that is not a valid order!")
os.reboot()
When i submit this it says:
bios:206: [string "startup"]:8: unexpected symbol
But i can't find whats wrong. Although im sure theres more then one thing wrong in here.
Can i get some help please?
1. Please use CODE tags :)/>/>
print("What would you like to eat today")
sleep(1)
print("Type C for cookies")
sleep(.5)
print("type P for pork")
sleep(.5)
print("And type A for apples")
term.write("Order:") then
if input = "C" then
rs.setOuput("top", true)
sleep(1)
rs.setOutput("top.false")
print("Thank for ordering!")
sleeep(1)
os.reboot()
else
if input = "P" then
rs.setOutput("left", true)
sleep(1)
redstone.setOutput("left", false)
print("Thank you for ordering!")
sleep(1)
os.reboot()
if input = "A" then
rs.setOutput("right", true)
sleep(1)
rs.setOutput("right", false)
print("Thank you for ordering!")
sleep(1)
os.reboot()
else
print("Sorry that is not a valid order!")
os.reboot()
2. fixed code :
print("What would you like to eat today")
sleep(1)
print("Type C for cookies")
sleep(.5)
print("type P for pork")
sleep(.5)
print("And type A for apples")
term.write("Order:")
if input == "C" then
rs.setOuput("top", true)
sleep(1)
rs.setOutput("top.false")
print("Thank for ordering!")
sleeep(1)
os.reboot()
else
if input == "P" then
rs.setOutput("left", true)
sleep(1)
redstone.setOutput("left", false)
print("Thank you for ordering!")
sleep(1)
os.reboot()
if input == "A" then
rs.setOutput("right", true)
sleep(1)
rs.setOutput("right", false)
print("Thank you for ordering!")
sleep(1)
os.reboot()
else
print("Sorry that is not a valid order!")
os.reboot()
end
end
end
3. errors u had:
print("What would you like to eat today")
sleep(1)
print("Type C for cookies")
sleep(.5)
print("type P for pork")
sleep(.5)
print("And type A for apples")
term.write("Order:") then -- U SHALL NOT PUT A then AFTER A term.write()
if input = "C" then -- U SHALL USE == INSTEAD OF = WHEN USING IF
rs.setOuput("top", true)
sleep(1)
rs.setOutput("top.false")
print("Thank for ordering!")
sleeep(1)
os.reboot()
else
if input = "P" then
rs.setOutput("left", true)
sleep(1)
redstone.setOutput("left", false)
print("Thank you for ordering!")
sleep(1)
os.reboot()
if input = "A" then
rs.setOutput("right", true)
sleep(1)
rs.setOutput("right", false)
print("Thank you for ordering!")
sleep(1)
os.reboot()
else
print("Sorry that is not a valid order!")
-- U SHALL END UR IF`S WITH end
os.reboot()