Advertisement
Guest User

loops

a guest
Oct 4th, 2015
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.36 KB | None | 0 0
  1. print("For Loop Sample")
  2.  
  3. for i = 0, 5  do
  4.   print("Current Position: "..i)
  5.    
  6. end
  7.  
  8. local x = 0
  9.  
  10. while x < 10 do
  11.   print("x="..x)
  12.   x = x+1
  13. end
  14.  
  15. local password = ""
  16. while password ~= "dw20" do
  17.      term.write("Enter Password:")
  18.      password = read()
  19. end
  20.  
  21. local y = 6
  22.  
  23. repeat
  24.   print("Y: "..y)
  25. until y > 5
  26.  
  27.  
  28.  
  29. print("Correct Password!!!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement