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. Rolling Eyes 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.
cool. looks like fun Smile
Sorry for necropost, but I randomly remembered this program today and made a TI-BASIC version. Very Happy
Sorry, it's not the best screenshot. (I'm really bad at making screenshots.)


Code:
:AxesOn
:GridOff
:Lbl M
:ClrHome
:Menu("GRAPHER","LINE",L,"CIRCLE",C,"RECTANGLE",R,"POINT",P,"FUNCTION",F,"CLEAR",CL,"DISPLAY",D)
:Lbl L
:Disp "LINE"
:Input "X1? ",A
:Input "Y1? ",B
:Input "X2? ",D
:Input "Y2? ",E
:Line(A,B,D,E
:Goto M
:Lbl C
:Disp "CIRCLE"
:Input "X? ",A
:Input "Y? ",B
:Input "R? ",R
:Circle(A,B,R
:Goto M
:Lbl R
:Disp "RECTANGLE"
:Input "X1? ",A
:Input "Y1? ",B
:Input "X2? ",D
:Input "Y2? ",E
:Line(A,B,D,B
:Line(A,B,A,E
:Line(A,E,D,E
:Line(D,B,D,E
:Goto M
:Lbl P
:Disp "POINT"
:Input "X? ",A
:Input "Y? ",B
:Pt-On(A,B
:Goto M
:Lbl F
:Disp "FUNCTION
:Input "FUNC? ",Str1
:String►Equ(Str1,Y1
:Goto M
:Lbl CL
:ClrDraw
:Goto M
:Lbl D
:DispGraph
:While getKey=0
:End
:Goto M

Download link: http://www.mediafire.com/?eb6tqo6i387dbjz
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement