Hi,
I in the beginning of LUA script learning (sorry for bad sentences error as I was not in America or UK.). As I going to give away 1 code that useful for some sort of programs. I going to give a code called repeating (Some person called it loops) code pieces..
repeat
----(this is where you can code anything after add repeat)----
until nil (nil = infinite. )
You can experiment if you want because it just a little code pieces for beginner (like me) as this is a Program Library for small demonstration or small Info for scripts.
Here is my small demo in repeating (loops) program:
repeat
print "001010100001010100000101010101"
sleep(0.5)
print "000101010100010101010100010101"
sleep(0.5)
print "000101010001010100000101010000"
sleep(0.5)
print "000101010110000000101010100101"
sleep(0.5)
until nil
result:
001010100001010100000101010101
000101010100010101010100010101
000101010001010100000101010000
000101010110000000101010100101
001010100001010100000101010101
000101010100010101010100010101
000101010001010100000101010000
000101010110000000101010100101
all the way to infinite.. (be careful, it will not stopping until you break the program or use scripted floppy disk act like anti virus. (it also use like "SPAM VIRUS" as for mean hackers if they wanted to.)
signature:
-alfieq-
Repeating program
Started by alfieq, Mar 25 2012 02:02 PM
4 replies to this topic
#1
Posted 25 March 2012 - 02:02 PM
#2
Posted 25 March 2012 - 05:37 PM
what is the difference between that and "while" or "for"?...
looks to me like a normal "for" loop
looks to me like a normal "for" loop
#3
Posted 26 March 2012 - 07:59 AM
If you know English language, you already know
/>
Here is my example from a script and from normal language:
script:
repeat
print "I like things"
until(10)
English:
Repeat this word "I like things" Until 10 times
Here is my example from a script and from normal language:
script:
repeat
print "I like things"
until(10)
English:
Repeat this word "I like things" Until 10 times
#4
Posted 26 March 2012 - 05:07 PM
alfieq, on 26 March 2012 - 07:59 AM, said:
If you know English language, you already know
/>
Here is my example from a script and from normal language:
script:
repeat
print "I like things"
until(10)
English:
Repeat this word "I like things" Until 10 times
Here is my example from a script and from normal language:
script:
repeat
print "I like things"
until(10)
English:
Repeat this word "I like things" Until 10 times
a = 0 repeat SOMETHING() a + 1 until a == something
#5
Posted 27 March 2012 - 02:15 PM
alfieq, on 26 March 2012 - 07:59 AM, said:
If you know English language, you already know
/>
Here is my example from a script and from normal language:
script:
repeat
print "I like things"
until(10)
English:
Repeat this word "I like things" Until 10 times
Here is my example from a script and from normal language:
script:
repeat
print "I like things"
until(10)
English:
Repeat this word "I like things" Until 10 times
you can do
for i=0 ,10 do
print "i like things"
end
which will be exactly the same...
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











