Menu

Learning BASIC for the first time: graphics

Anonymous
2017-08-23
2017-08-24
  • Anonymous

    Anonymous - 2017-08-23

    Hello. I'm learning BASIC for the first time and found your awesome emulator. First off, THANKS for all you've done here!

    So far I've taken a few tutorials here and there online. Right now I'm going thru the Usborne books from the 80's that the company is offering for free PDF download: https://usborne.com/browse-books/features/computer-and-coding-books/ . The book I'm currently playing around with is Introduction to Computer Programming, BASIC for Beginners.

    I am stuck on a particular lesson requiring the use of PLOT. The book tries to account for machine differences (back then), and states that some machines also require the use of MODE, and to consult the user's manual. I looked thru the documentation - no PLOT, but info on MODE and SCREEN that I really don't understand.

    Here is the code in the lesson, it's very simple:

    10 PRINT "Type in two numbers"
    20 INPUT X
    30 INPUT Y
    40 PLOT (X,Y)
    50 GOTO 10

    How would I make this work in PCbasic? Is there a tutorial somewhere that can help me fill in the gaps of my understanding?

     
  • Rob Hagemans

    Rob Hagemans - 2017-08-23

    Hi, there is indeed no PLOT statement in PC-BASIC, but you can use PSET instead. You'll need a SCREEN command first to enter graphics mode. Your program could be changed like so:

    5 SCREEN 9
    10 PRINT "Type in two numbers"
    20 INPUT X
    30 INPUT Y
    40 PSET (X,Y)
    50 GOTO 10
    

    To find tutorials and examples, it's probably best to search the web for 'GW-BASIC'. Note that GW-BASIC predates the Web so a lot of the better material is not online. There's lots of second hand books available on the cheap though. Also check out the links at https://github.com/robhagemans/pcbasic

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.