KermMartian wrote:
Spyro543 wrote:
That would be hard. The syntax, however similar, is also way different.
Can you clarify what you mean by that? Is program flow vastly different?*cough* TI-BASIC is not BASIC. Feel free to port BASIC-256 programs to BBC BASIC, however, as that is BASIC!
Code:
10 DEF PROC_exit MODE 0:CLS:END
20 ON ERROR IF ERR=17 PROC_exit ELSE MODE 0:CLS:REPORT:PRINT" at line ";ERL:END
30 :
40 MODE 3
50 VDU 28,12,9,23,0
60 VDU 24,0;0;192;256;
70 :
80 REPEAT
90 CLS
100 PRINT "GRAPHER"
110 PRINT "by Spyro543"
120 PRINT "1 Line"
130 PRINT "2 Point"
140 PRINT "3 Rectangle"
150 PRINT "4 Circle"
160 PRINT "5 Text"
170 PRINT "6 Erase Part";
180 PRINT "7 Erase All"
190 ON GET-ASC("0") PROC_drawline, PROC_drawpoint, PROC_drawrect, PROC_drawcircle, PROC_drawtext, PROC_erasepart, PROC_eraseall ELSE
200 UNTIL FALSE
210 END
220 :
230 DEF PROC_drawline
240 CLS
250 PRINT "Draw a line:"
260 INPUT "Start of line x-axis: " x1
270 INPUT "Start of line y-axis: " y1
280 INPUT "End of line x-axis: " x2
290 INPUT "End of line y-axis: " y2
300 MOVE x1, y1 : DRAW x2, y2
310 ENDPROC
320 :
330 DEF PROC_drawpoint
340 CLS
350 PRINT "Draw a single point:"
360 INPUT "x-axis: " x
370 INPUT "y-axis: " y
380 PLOT x, y
390 ENDPROC
400 :
410 DEF PROC_drawrect
420 CLS
430 PRINT "Draw a rectangle:"
440 INPUT "x-axis: " x1
450 INPUT "y-axis: " y1
460 INPUT "Width: " x2
470 INPUT "Height: " y2
480 RECTANGLE FILL x1, y1, x2, y2
490 ENDPROC
500 :
510 DEF PROC_drawcircle
520 CLS
530 PRINT "Draw a circle:"
540 INPUT "x-axis: " x
550 INPUT "y-axis: " y
560 INPUT "Radius: " r
570 CIRCLE FILL x, y, r
580 ENDPROC
590 :
600 DEF PROC_drawtext
610 CLS
620 PRINT "Draw text:"
630 INPUT "x-axis: " x
640 INPUT "y-axis: " y
650 INPUT "Text: " t$
660 VDU 5
670 MOVE x, y PRINT t$
680 VDU 4
690 ENDPROC
700 :
710 DEF PROC_erasepart
720 CLS
730 PRINT "Partial erase:"
740 INPUT "x-axis: " x1
750 INPUT "y-axis: " y1
760 INPUT "Width: " x2
770 INPUT "Height: " y2
780 GCOL 127
790 RECTANGLE FILL x1, y1, x2, y2
800 GCOL 1
810 ENDPROC
820 :
830 DEF PROC_eraseall
840 CLS
850 PRINT "Erase all:"
860 done=FALSE
870 REPEAT
880 INPUT "Are you sure? [Y/N] " yn$
890 IF yn$ = "Y" OR yn$ = "y" CLG : done=TRUE
900 IF yn$ = "N" OR yn$ = "n" done=TRUE
910 UNTIL done
920 ENDPROC
I had to make some changes to account for differences between the two but the overall structure is very similar.