Skip to content

Instantly share code, notes, and snippets.

@neilk
Created May 1, 2019 02:04
Show Gist options
  • Save neilk/9be7576541a58a582577f58bd3f19a71 to your computer and use it in GitHub Desktop.
Save neilk/9be7576541a58a582577f58bd3f19a71 to your computer and use it in GitHub Desktop.
Galaxy applesoft basic
10 HGR2: HCOLOR=3
11 R0 = 70
12 TAU = 6.282
13 SCREENX = 279: SCREENY = 191
15 CENTERX = INT(SCREENX / 2): CENTERY = INT(SCREENY / 2)
16 LINEDOTS = 3
17 R = R0
18 CIRCUM = TAU*R0: S = 1
19 J = 0:
20 REM J-LOOP
21 I = 0
22 REM I-LOOP
23 L = 1
25 THETA = (I + J)/R0
26 R = R0 * (I/R0/TAU) + (SIN(I/R0/TAU) * (R0/5))
27 X = INT((SIN(THETA) * R))
28 Y = INT((COS(THETA) * R / 1.61))
30 HPLOT CENTERX + X, CENTERY + Y
31 REM HPLOT CENTERX + X, CENTERY - Y
40 I = I + L
41 L = L + 0.25
50 IF I < CIRCUM GOTO 25
51 J = J + 6 + SIN(J/9)*3
52 IF J < CIRCUM GOTO 20
55 REM END J-LOOP
60 REM HPLOT CENTERX, CENTERY
70 REM HPLOT SCREENX, SCREENY
10 HGR2: HCOLOR=3
11 R0 = 70
12 TAU = 6.282
13 SCREENX = 279: SCREENY = 191
15 CENTERX = INT(SCREENX / 2): CENTERY = INT(SCREENY / 2)
16 LINEDOTS = 3
17 R = R0
18 CIRCUM = TAU*R0: S = 1
19 J = 0:
20 REM J-LOOP
21 I = 0
22 REM I-LOOP
23 L = 1
25 THETA = (I + J)/R0
26 R = R0 * (I/R0/TAU) + (SIN(I/R0/TAU) * (R0/5))
27 X = INT((SIN(THETA) * R))
28 Y = INT((COS(THETA) * R / 1.61))
30 HPLOT CENTERX + X, CENTERY + Y
31 REM HPLOT CENTERX + X, CENTERY - Y
40 I = I + L
41 L = L + 0.25
50 IF I < CIRCUM GOTO 25
51 J = J + 6 + SIN(J/9)*3
52 IF J < CIRCUM GOTO 20
55 REM END J-LOOP
60 REM HPLOT CENTERX, CENTERY
70 REM HPLOT SCREENX, SCREENY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment