• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

How do I do a horizontally scrolling sine wave in Applesoft BASIC?

DistantStar001

Well-known member
I tweaked this program from something I saw on the 8-bit Guy. Managed to get the wave to fill most of the screen, repeat, and end where it begins on the screen. However, I was wondering if I could get it to scroll horizontally across the screen? or draw from right to left? I don't know, I'm just playing with BASIC and wanted some pointers.

Program listing:
5 HGR
10 HCOLOR=3
20 FOR X=0 TO 278
30 LET Y=INT(-65*SIN(X*3.14/28))+70
40 HPLOT X,Y
50 NEXT X
60 GOTO 5
 
Top