Androcles, see some tight code.
"Ken S. Tucker" wrote in message
ups.com...
| Hey Andro,
| Try running this little program, far below.
| If it works I have another better one.
| Ken
| PS: maybe this will keep the kids from breaking
| your windows!
My grandson broke his father's shed window, not mine. He has goal posts
on the lawn with a net now. :-)
[snip intro]
Jeez... I haven't seen
Beginners
All-purpuse
Symbolic
Instruction
Code
like that in over 30 years, let alone programmed it.
I gave up programming in C++ when I retired. Let's see if I can still
read it.
|
| 5 ' Craters. Ken and Travis Tucker. Approx 1988.
| 10 CLEAR : SCREEN 7, 0, 0, 0: KEY OFF: CLS
| 12 PCOPY 0, 1: PCOPY 0, 2: PCOPY 0, 3: VIEW PRINT 1 TO 25
| 21 C = 1: GOSUB 22: C = 9: GOSUB 22: GOTO 25
| 22 FOR A = 1 TO 100: X = RND * 320: Y = RND * 200
| 23 PSET (X, Y), C: NEXT A: RETURN
That's scatter a hundred dots, colour unspecified, on a 320x200 screen.
Dunno what C is, it has values 1 and 9. The routine is called twice.
Looks like it may be syntax error... should it be PSET (X, Y, C)
perhaps?
I'm lost on what C is.
| 25 DR = 3.141592 / 180: R = 10
| 30 RANDOMIZE TIMER
| 35 DIM X(500), Y(500)
| 40 CIRCLE (160, 100), 90, 8
Lost on that, too. Origin, radius perhaps? Maybe an ellipse even.
| 45 PAINT (160, 100), 4, 8: PAINT (160, 100), 8, 8
Lost... fill a bounded area with colour?
| 100 R = INT(RND * RND * RND * RND * 20) + 1:
That's just plain silly. RND returns a real between 0 and 1.
LO = RND * 170 - 85
???
Nope. I can't read it. What is it supposed to do?
Androcles.
| 105 LA = RND * 140 - 70: C = 8
| 110 X0 = 90 * SIN(DR * LO) * COS(DR * LA) + 160
| 112 Y0 = 76 * SIN(LA * DR) + 100
| 115 GOSUB 300: IF R = 1 THEN PSET (X0, Y0), 14: GOTO 100
| 120 C = 12: GOSUB 130: PAINT (X0, Y0), 4, 12: GOSUB 600:
| 125 PAINT (X0, Y0), 7, 12: GOSUB 400: GOSUB 500: GOTO 180
| 130 N = 0: S = 36 / R: FOR A = 1 TO 360 STEP S: N = N + 1
| 140 U = R * SIN(A * DR) + LO: V = R * COS(A * DR) + LA
| 150 X = 90 * SIN(DR * U) * COS(DR * V) + B: Y = 76 * SIN(V * DR)
| 155 X(N) = X: Y(N) = Y
| 160 PSET (X + 160, Y + 100), C
| 170 NEXT A: RETURN
| 180 PSET (X0, Y0), 15
| 200 GOTO 100
| 300 PCOPY 0, 1: DX = X0 - 160: DY = Y0 - 100
| 305 LINE (DX * 10, DY * 10)-(X0, Y0), 14: GOSUB 600: PCOPY 1, 0
| 310 FOR A = 1 TO R * 4: X1 = X0 + RND * 4 * R - 2 * R
| 315 Y1 = Y0 + 4 * RND * R - 2 * R
| 320 LINE (X0, Y0)-(X1, Y1), 4: NEXT A: GOSUB 600: PCOPY 1, 0: RETURN
| 400 FOR A = 1 TO N: X = X(A): Y = Y(A)
| 410 IF X = 0 OR Y = 0 THEN 420
| 412 PSET (X + 160 + X / ABS(X), Y + 100 + Y / ABS(Y)), 0
| 420 NEXT A: RETURN
| 500 FOR A = 1 TO N: X = X(A): Y = Y(A)
| 510 PSET (X + 160, Y + 100), 14
| 520 NEXT A: RETURN
| 600 FOR DE = 1 TO 5: T = TIMER: WHILE TIMER = T: WEND: NEXT: RETURN
|
| ---------------------------------------------------------
|
|