Wednesday, March 10, 2010

ngbasic

BASIC for Javascript

 NGbasic 0.2.18 beta released

  Posted by ngbasic
 Feb-14-2009

 NGbasic forums online

  Posted by ngbasic
 Feb-1-2009

 NG-Basic’s New Home!

  Posted by ngbasic
 Feb-1-2009

 Welcome to NGbasic!

  Posted by ngbasic
 Jan-20-2009

tutorial

Posted by ngbasic On February - 1 - 2009

Heres a few quick and easy tutorials on how to start programming using NGbasic! We will add more tutorials over time so bear with us here!

Tutorial 1 : The Endless Loop

1. Start the NGbasic interpreter

2. Type CLEAR to clear the screen

3. Type LIST to see if anything is in memory, it should come up blank.

4. Lets get started, type the following in one line at a time!


10 REM *** MY FIRST PROGRAM! ***
20 X=0
30 PRINT X
40 X=X+5
50 GOTO 30

Thats it, this creates a endless loop, basically it drives the computer nuts as its stuck adding numbers forever.

5. To see your program type LIST

If you got anything wrong just retype the line, for example if on line 50 you entered GOGO instead of GOTO you just need to retype that line end it will be overwritten.

6. To run your program type RUN

You should see lots of numbers start to fill up your screen if you got it right! Since it wont stop you need to press CTRL C to kill it.

7. The breakdown

Heres a quck breakdown of the program and whats happening:

Line 10 is just a comment you can actually leave it out if you like
Line 20 sets the variable X to be zero so we can use it as a counter.
Line 30 prints out the value of X
Line 40 adds 5 to the current value of X (so 0 .. 5 ..
Line 50 redirects the program back to line 30 creating the endless loop!

Popularity: 6% [?]

Add A Comment

You must be logged in to post a comment.