Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- numbers = #(1,2,3,4,5,6,7,8,9,10)
- colours = #("Red","Orange","Yellow","Green","Blue","Indigo","Violet","Cyan","Magenta","Brown")
- things =#("Hand","Car","Bottle","Torch","Wheel","Leaf","Bike","Shoe","Bird","Robot")
- --
- for num in numbers do print num
- --
- for col in colours do print col
- --
- for num in numbers do
- (
- for col in colours do
- (
- print (num as string + " " + col)
- )
- )
- --
- for col in colours do
- (
- for num in numbers do
- (
- print (col + " " + num as string)
- )
- )
- --this next one may help in seeing how 3 loops are working
- for num1 in numbers do
- (
- for num2 in numbers do
- (
- for num3 in numbers do
- (
- print (num1 as string + " " + num2 as string + " " + num3 as string)
- --like how you were envisaging a flexible function, you can see how you can add syntax between the variables to run something useful.
- )
- )
- )
- --okay 3 loops
- for num in numbers do
- (
- for col in colours do
- (
- for thing in things do
- (
- print (num as string + " " + col + " " + thing)
- )
- )
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement