times table
Author |
Message |
WooFerPPK
|
Posted: Tue Oct 01, 2002 7:01 am Post subject: times table |
|
|
i have to make a program that displays a time table, now i need it to count from 12 to 1. i got this so far
code: |
var gnumber : real
put "Please enter the number"
get gnumber
for decreasing times : 12 .. 1
locate (times, 1)
put times, " * ", gnumber, " = ", times * gnumber
delay (100)
end for
|
now i instead of it going like this
1
2
3
i want the numbers to go down like this
3
2
1
what am i doing worng? |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Tony
|
Posted: Tue Oct 01, 2002 9:14 am Post subject: (No subject) |
|
|
well here's your problem:
since you count downwards then it will first print on 12th line and go up.
what you can do is to set up a separate counter that will add 1 every time for loop starts.
code: | for decreasing times : 12 .. 1
line := line +1
locate (line, 1)
put times, " * ", gnumber, " = ", times * gnumber
delay (100)
end for
|
|
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
WooFerPPK
|
Posted: Tue Oct 01, 2002 11:32 am Post subject: (No subject) |
|
|
Thanks again tony |
|
|
|
|
|
|
|