
-----------------------------------
hpdudette
Tue May 27, 2003 6:18 pm

loop program
-----------------------------------
how do i make a loop program so that in one loop from 1 to 80 the out put the number and square the number and display it like this:
Num  Square  Num  Square  Num Square  Num Square
1       1           21     441       41    1681     61   3721
2       4           22     484       42    1764     62   3864
continue through
20     200        40    1600      60    3600     80   6400

-----------------------------------
Blade
Tue May 27, 2003 6:33 pm


-----------------------------------
i think this is what you want.... but i dont know how you want it displayed because that confused the hell outta me trying to read that question. plz try to be more clear lol or organize your data correctly

for i:1..20
put i, " ",i*2
end for


-----------------------------------
krishon
Tue May 27, 2003 6:33 pm


-----------------------------------
is this wut u want?

for i : 1..80
    put (i), " "..
    put (i**2), " "..
    delay (30)
end for


-----------------------------------
Blade
Tue May 27, 2003 6:53 pm


-----------------------------------
haha i beat you :D:D:D:D

-----------------------------------
hpdudette
Tue May 27, 2003 6:54 pm


-----------------------------------
sorry bout that the output should look like the attachment

-----------------------------------
Tony
Tue May 27, 2003 6:58 pm


-----------------------------------
so its

for c:1..3
for r:1..20
locate(r,c*10)
put r+c*20
end for
end for


-----------------------------------
hpdudette
Tue May 27, 2003 7:14 pm


-----------------------------------
thanks for your help u guys but its not suppose to look like that ... can n/e one else help

-----------------------------------
Asok
Tue May 27, 2003 7:20 pm


-----------------------------------
to be totally fair, you should be able to do the spacing yourself, you've been given the methods to find the values, you can figure out how to format it into whatever way you want. I'm not saying this to be mean but come on, at least try.

-----------------------------------
void
Tue May 27, 2003 8:00 pm


-----------------------------------
i agree with asok...but i couldnt help feeling sorry for u...so i decided to get you started...the first 2 colums of stuff has been done....just use the same pattern to do the spacing...its little programs like this that end up helping you understand the easy crap so that in the future with major programs, you can focus on the harder shit

locate (1, 1)
put "NUM"
for a : 1 .. 20
    locate (a + 1, 1)
    put a : 3
end for
locate (1, 7)
put "SQUARE"
for a : 1 .. 20
    locate (a + 1, 10)
    put a ** 2 : 3
end for

