Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
New and improved SICK project
#30
I converted to "SIC" format a graphics program. It comes from a book called "MORE TRS-80 BASIC" by D.Inman, R.Zamora and B.Albrecht. (c)1981 "Wiley self-teaching guides".

It fakes TRS-80 Model III graphics, which was produced from CHR$(128) to CHR$(191). That's why the "SIC" code doesn't bother checking for value greater than 191 in the "GOSUB" subroutine. I purposely tried to center the graphics on a much-larger screen than the ancient one. I added the check for "S" going below one but maybe it's not necessary. I also added the delay loop and poll for escape key to press to quit the program.

The original source code is listed first but commented out. The converted code that runs follows.

Code: (Select All)
'20 cls
'25 s=10
'30 for n=0 to 330 step 66
'35 for r=0 to s
'40 a=rnd(2)-1
'b=rnd(2)-1
'c=rnd(2)-1
'd=rnd(2)-1
'e=rnd(2)-1
'f=rnd(2)-1
'50 if n=0 then m=0 else m=62*(n/66)
'100 ul=128+a+2*b+(2*c)^2+(2*d)^3+(2*e)^4+(2*f)^5
'110 ur=128+b+2*a+(2*d)^2+(2*c)^3+(2*f)^4+(2*e)^5
'120 ll=128+e+2*f+(2*c)^2+(2*d)^3+(2*a)^4+(2*b)^5
'130 lr=128+f+2*e+(2*d)^2+(2*c)^3+(2*b)^4+(2*a)^5
'210 print @544,chr$(191);
'print @144+n+r,chr$(ul);
'220 print @176+m-r,chr$(ur);
'print @912-m+r,chr$(ll);
'230 print @944-n-r,chr$(lr);
'235 next r
'237 s=s-1
'240 next n
'250 for wait=1 to 200: next wait
'300 goto 10

10 SCREEN 12
20 DO
30     P=544
40     Q=191
50     GOSUB 480
60     S=10
70     FOR N=0 TO 330 STEP 66
80         FOR R=0 TO S
90             A=INT(RND*2)
100            B=INT(RND*2)
110            C=INT(RND*2)
120            D=INT(RND*2)
130            E=INT(RND*2)
140            F=INT(RND*2)
150            IF N=0 THEN
160                M=0
170            ELSE
180                M=62*(N/66)
190            END IF
200            P=144+N+R
210            Q=128+A+2*B+(2*C)^2+(2*D)^3+(2*E)^4+(2*F)^5
220            GOSUB 480
230            P=176+M-R
240            Q=128+B+2*A+(2*D)^2+(2*C)^3+(2*F)^4+(2*E)^5
250            GOSUB 480
260            P=912-M+R
270            Q=128+E+2*F+(2*C)^2+(2*D)^3+(2*A)^4+(2*B)^5
280            GOSUB 480
290            P=944-N-R
300            Q=128+F+2*E+(2*D)^2+(2*C)^3+(2*B)^4+(2*A)^5
310            GOSUB 480
320        NEXT
330        S=S-1
340        IF S<1 THEN
350            EXIT FOR
360        END IF
370    NEXT
380    P=0
390    FOR Q=1 TO 10
400        PAUSE 0.05
410        IF INKEY$=CHR$(27) THEN
420            P=1
430            EXIT FOR
440        END IF
450    NEXT
460 LOOP UNTIL P=1
470 END
480 X=(MOD(P,64)+1)*8+48
490 Y=((P\64)+1)*12+120
500 LINE X,Y,STEP 7,11,0,"FB"
510 IF AND(Q,1)<>0 THEN
520     LINE X,Y,STEP 3,3,7,"FB"
530 END IF
540 IF AND(Q,2)<>0 THEN
550     LINE X+4,Y,STEP 3,3,7,"FB"
560 END IF
570 IF AND(Q,4)<>0 THEN
580     LINE X,Y+4,STEP 3,3,7,"FB"
590 END IF
600 IF AND(Q,8)<>0 THEN
610     LINE X+4,Y+4,STEP 3,3,7,"FB"
620 END IF
630 IF AND(Q,16)<>0 THEN
640     LINE X,Y+8,STEP 3,3,7,"FB"
650 END IF
660 IF AND(Q,32)<>0 THEN
670     LINE X+4,Y+8,STEP 3,3,7,"FB"
680 END IF
690 RETURN
Reply


Messages In This Thread
New and improved SICK project - by eoredson - 09-20-2022, 04:44 AM
RE: New and improved SICK project - by mnrvovrfc - 09-24-2022, 02:52 AM
RE: New and improved SICK project - by mnrvovrfc - 09-24-2022, 08:06 PM
RE: New and improved SICK project - by eoredson - 09-27-2022, 06:21 AM
RE: New and improved SICK project - by eoredson - 09-28-2022, 03:11 AM
RE: New and improved SICK project - by mnrvovrfc - 09-28-2022, 04:39 AM
RE: New and improved SICK project - by eoredson - 09-28-2022, 05:03 AM
RE: New and improved SICK project - by mnrvovrfc - 10-06-2022, 11:34 PM
RE: New and improved SICK project - by mnrvovrfc - 09-28-2022, 07:02 PM
RE: New and improved SICK project - by Pete - 09-28-2022, 03:48 PM
RE: New and improved SICK project - by aurel - 09-28-2022, 09:34 PM
RE: New and improved SICK project - by eoredson - 09-29-2022, 04:45 AM
RE: New and improved SICK project - by Pete - 09-28-2022, 09:46 PM
RE: New and improved SICK project - by mnrvovrfc - 09-30-2022, 04:25 PM
RE: New and improved SICK project - by eoredson - 10-01-2022, 02:30 AM
RE: New and improved SICK project - by eoredson - 10-01-2022, 03:58 AM
RE: New and improved SICK project - by mnrvovrfc - 10-04-2022, 02:20 PM
RE: New and improved SICK project - by eoredson - 10-06-2022, 12:44 AM
RE: New and improved SICK project - by mnrvovrfc - 10-06-2022, 05:12 AM
RE: New and improved SICK project - by aurel - 10-06-2022, 07:09 PM
RE: New and improved SICK project - by mnrvovrfc - 10-06-2022, 08:05 PM
RE: New and improved SICK project - by bplus - 10-06-2022, 07:46 PM
RE: New and improved SICK project - by aurel - 10-07-2022, 11:39 AM
RE: New and improved SICK project - by aurel - 10-07-2022, 12:00 PM
RE: New and improved SICK project - by mnrvovrfc - 10-07-2022, 11:41 PM
RE: New and improved SICK project - by mnrvovrfc - 10-12-2022, 05:19 PM
RE: New and improved SICK project - by eoredson - 10-21-2022, 03:15 AM
RE: New and improved SICK project - by mnrvovrfc - 10-21-2022, 07:03 AM
RE: New and improved SICK project - by eoredson - 03-11-2023, 04:34 AM
RE: New and improved SICK project - by eoredson - 04-07-2023, 03:52 AM
RE: New and improved SICK project - by eoredson - 09-15-2023, 12:17 AM



Users browsing this thread: 1 Guest(s)