Answers for "forever loop lua"

C
1

forever loop in lua

while( true )
do
   print("This loop will run forever.")
end
Posted by: Guest on July-24-2020
1

infinite loop lua

-- We need to create a wait function to slow down the while true do loop.
-- The loop will run so fast, that we need to slow it down. Otherwise, it'll crash.

function wait(seconds)
  local start = os.time() 
  repeat until os.time() > start + seconds
end

while true do -- Create the infinite loop
	print("Hello World")
   	
    wait(1) -- The number you place in the paramater is how many seconds it will wait until looping again.
end
Posted by: Guest on September-26-2020
0

for loop lua

for x = 0, 10, 1 do
	print(x)
end
Posted by: Guest on April-21-2021

Code answers related to "C"

Browse Popular Code Answers by Language