Advertisement
Eco

Lua for loop

Eco
Jun 15th, 2012
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.33 KB | None | 0 0
  1. function hi()
  2.  
  3.     print("Type a number, any number: ")
  4.     maxInt = io.read()
  5.     print(maxInt)
  6.    
  7.     print("What should you count by: ")
  8.     step = io.read()
  9.     print(step)
  10.    
  11.     for i = 0, maxInt, step do
  12.         io.write("hi ".." maxInt: "..maxInt.."    step: "..step.."   i: ",i,"\n")
  13.         -- it appears .. and , do the same thing
  14.    
  15.     end
  16. end
  17.  
  18. hi ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement