HP-85 Lineart Program Message #1 Posted by Vassilis Prevelakis on 17 Mar 2006, 2:09 a.m.
The following is a graphics demo from the early 80s. I found the C version of it[1] and converted it to the HP-85.
Initially it precomputes a bunch of values (taking for ever, of course) and then starts creating graphics displays. After each display it beeps and waits 5 seconds, then starts on the next one.
The initial wait is long enough that I added a progress bar to let you know that its working, it prints "*" characters over a horizontal bar. When the bar is covered with (about 12 ) "*" the program is ready to start drawing.
Enjoy!
**vp
--------------------------------------------------------
1000 N0=12
1010 N1=343
1020 DIM F0(12,343)
1030 RAD
1040 GCLEAR @ SCALE 0,N0,0,10 @ XAXIS 0,1 @ MOVE 0,2 @ LABEL "Please Wait"
1050 FOR M=0 TO N0-1
1055 MOVE M+.4,1 @ LABEL "*"
1060 FOR X=0 TO N1-1
1070 ON M+1 GOTO 1110,1120,1130,1140,1150,1160,1170,1180,1190,1200,1210,1220
1110 F0(M,X)=SIN (2*PI *X/N1) @ GOTO 1300
1120 F0(M,X)=-SIN (2*PI *X/N1) @ GOTO 1300
1130 F0(M,X)=COS (2*PI *X/N1) @ GOTO 1300
1140 F0(M,X)=-COS (2*PI *X/N1) @ GOTO 1300
1150 F0(M,X)=SIN (4*PI *X/N1) @ GOTO 1300
1160 F0(M,X)=-SIN (4*PI *X/N1) @ GOTO 1300
1170 F0(M,X)=COS (4*PI *X/N1) @ GOTO 1300
1180 F0(M,X)=-COS (4*PI *X/N1) @ GOTO 1300
1190 F0(M,X)=SIN (6*PI *X/N1) @ GOTO 1300
1200 F0(M,X)=-SIN (6*PI *X/N1) @ GOTO 1300
1210 F0(M,X)=COS (6*PI *X/N1) @ GOTO 1300
1220 F0(M,X)=-COS (6*PI *X/N1) @ GOTO 1300
1300 NEXT X
1310 NEXT M
1400 ! ---------------
1410 DEF FNR(N) = INT (RND *(N-1))+1
2000 ! ---------------
2010 FOR C0=0 TO 100
2020 GCLEAR @ SCALE -1,1,-1,1
2030 I=FNR(N0)
2040 J=FNR(N0)
2050 IF I=J THEN 2040
2060 K=FNR(N0)
2070 L=FNR(N0)
2080 IF K=L THEN 2070
2090 FOR M=0 TO N1-1
2100 MOVE F0(I,M),F0(K,M)
2110 DRAW F0(J,M),F0(L,M)
2120 NEXT M
2130 BEEP @ WAIT 5000
2140 NEXT C0
2150 END
------------------------------------------------------------
[1] The original version was for the Sunview environment (a GUI for early SUN Microsystems workstations). SUN gave the source as an example of the graphics library supplied with these machines (Sun2 and Sun3 if you really want to know), and I have ported this to a number of systems over the years (BBC micro, TurboC for DOS, Pascal, etc.)
|