Kaatoz

bridge

Dec 5th, 2012
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1. --VARIABLES
  2.  
  3. local length = ""
  4. local width = ""
  5. local answer = ""
  6. local correct = "y"
  7. local x = 1
  8.  
  9. -- Functions
  10. function dim()
  11. term.write("How long is bridge? :")
  12.    length = read()
  13. term.write("How wide is bridge? :")
  14.    width = read()
  15.  
  16. print("These are the dimensions of the Bridge:")
  17. print("Length = "..length)
  18. print("Width = "..width)
  19. print("Shall I proceed? : y/n")
  20. answer = read()
  21. return length, width, answer
  22. End
  23.  
  24. --Main Program
  25.  
  26. dim()
  27.  
  28.  
  29. while answer ~=correct do
  30.    if answer == correct then
  31.                  print ("Awesome!! Let's build!!")
  32.     else
  33.                  print ("Well, then I'm not sure what to do let's start over.")
  34.                  dim()
  35.     end
  36. end
  37.  
  38. end
Advertisement
Add Comment
Please, Sign In to add comment