[Newbies] Translation from old basic program

kirand kirandev at ukr.net
Sun Jul 4 15:36:33 UTC 2010


Hi!

Is anybody remember basic?

I am a beginner and cant understand how to make this program in Smalltalk. I 
found it in old magazine from 80-th years :)
So, this is the program. It makes interest graphics.

10 INPUT "Enter a number"; N
20 DIM X(N), Y(N)
30 R = 120
40 DT = 2 * 3,1416 /N
50 T = 0
60 FOR I = 1 TO N
70 T = T + DT
80 X(I) = 160 + R*COS (T): Y(I) = 125 - R*SIN (T)
90 NEXT I
95 CLSZ
100 FOR I = 1 TO N-1
110 FOR J= I+1 TO N
120 PLOT X(I), Y(I), 3
130 LINE X(J), Y(J)
140 NEXT J
150 NEXT I
160 STOP

Some remarks can help. PLOT+LINE is BitBlt>>drawFrom:to:. DIM X(N), Y(N) is 
PointArray instance.

If anobody make it pls give me a code to see how. 




More information about the Beginners mailing list