BASIC Programming

35,441

38

13

Introduction: BASIC Programming

Hi! I will show you today how to program in BASIC.
(BASIC=Beginner's All-Purpose Symbolic Instruction Code)

Step 1: How to Get BASIC-256

You can download it here:
Windows
http://downloads.sourceforge.net/kidbasic/basic256-0_9_2.zip
Sourcecode
http://downloads.sourceforge.net/kidbasic/basic256-0.9.2.tar.gz
Ubuntu Linux
Go to Applications / Add/Remove
Now make sure all applications are displayed
Search for basic-256
And install it.
(see picture)

Step 2: Text 1 - Hello, World!

Start BASIC-256 (for Ubuntu users: It's in Applications / Education.
Now enter into the programming window:

clg
cls
print "Hello, world!"

and run the program.
Output:

Hello, world!

Step 3: Text 2 - Math

The new program:

clg
cls
print "1 + 3"
print 1 + 3
print "7 - 5"
print 7 - 5
print "9 * 7"
print 9 * 7
print "5 / 4"
print 1 / 1

And the output:

1 + 3
4
7 - 5
2
9 * 7
63
5 / 4
1

Rule:
The "print" command prints a message exactly when it is enclosed in "quotation marks".
If not, you can do math with numbers and variables.

Step 4: Graphics 1 - a Circle!

Now add to the beginning of the code:

fastgraphics

and to the end:

color black
circle 145, 145, 145
refresh

so that it looks like this:

fastgraphics
clg
cls
print "Hello, world!"
color black
circle 145, 145, 145
refresh

Run it, and you see a big circle in the graphics window.

Step 5: Graphics 2 - a Rectangle!

Replace "circle 145, 145, 145" with "rect 0, 0, 290, 290"
And what do you see? A square instead of a circle!

Step 6: Graphics 3 - All Colors...

white
black
red
darkred
green
darkgreen
blue
darkblue
cyan
darkcyan
purple
darkpurple
yellow
darkyellow
orange
darkorange
gray
darkgray
clear

"clear" isn't really a color. You can erase other colors with it.
Try it out! Replace "color black" in the program with "color blue", for example.

Step 7: Finish!

That's it for now. I'll make a second instructable as soon as possible.

3 People Made This Project!

Recommendations

  • Potato Speed Challenge

    Potato Speed Challenge
  • Mason Jar Speed Challenge

    Mason Jar Speed Challenge
  • Bikes Challenge

    Bikes Challenge

13 Discussions

0
johnwhitney9
johnwhitney9

8 months ago

For windows development Visual Basic is supported by Microsoft Visual Studio. a free download from microsoft. it is an interpreter and complier and can target windows, = OS\x, lynux and android.
can interface with cloud and SQL and a way to use OOP and gentle transition to other languages
this is where heavyweight basic programers go ;)

0
mcaballero4
mcaballero4

4 years ago

Cool language to teach kids. There is no swift2 for Windows yet (the lab runs on windows), but the kids loves to make cool graphics with it, music, and paint with the mouse (mouseX, MouseY).

It's cool and fun for 4th, 5th and 6th graders, and I am writing a blog in spanish about each class for them, please visit. I hope you find it fun too (by the way, I earn basic on a Texas Instruments TI-99/4)

http://basic256-esc31.blogspot.com.ar

0
lemonie
lemonie

11 years ago on Introduction

Oh () not "hello world"? I think that may actually predate the internet.. To stop being flippant and be serious - who uses basic for anything these days? The that time I touched BASIC was to modify MS "Gorillas" (QBASIC) such that the gorilla got totally nuked on the banana-throw. And I'm certain that MS stopped shipping QBASIC a long time ago... L

0
NachoMahma
NachoMahma

Reply 11 years ago on Introduction

. I can remember using "Hello, World!" in the '70s.
. I doubt if anyone does any serious work with BASIC any more. I helped write a billing program in AppleBASIC (circa 1983), but BASIC would be nowhere on my list of language candidates for such a project today. I miss HyperTalk. :(
. BTW, you can d/l QBASIC 1.1 from MS for free. Link at the bottom of the Wikipedia article on QBASIC. I don't know if it works with current versions of Windows. Scanning the article, it looks like it may.

0
lemonie
lemonie

Reply 11 years ago on Introduction

Ah, but can I download Gorillas? Otherwise I'm not interested... L

0
mcaballero4
mcaballero4

Reply 4 years ago

that was the angry birds of our days

0
lemonie
lemonie

Reply 11 years ago on Introduction

I think I will at some point, thanks L

0
NachoMahma
NachoMahma

Reply 11 years ago on Introduction

. BTW, I meant getting the files, not programming. :) . It's been years since I did any real programming (been doing a little bit of work with PHP, but nothing serious). But there may still be a few bits of BASIC still rattling around in my brain that I can dredge up. . I'd be interested in knowing how the install goes. There's a few things I've been trying to do with PHP (eg, merging slightly disparate data files) that might be easier to do (for me) with BASIC.

0
PKM
PKM

Reply 11 years ago on Introduction

who uses basic for anything these days?

. I doubt if anyone does any serious work with BASIC any more.

I have spent the last 10 months or so writing a commercial software product almost entirely in VBA (Visual Basic for Applications)- it's an add in for Excel that lets you do funky things with tables you import from the web. When I had to pick up Perl to write some QA stuff I had forgotten that real programming languages end lines with semicolons :$

I suspect you may be right that no-one seriously uses BASIC basic, but Microsoft's weird insistence on beating the dead horse of VBscript, VBA and VB.NET means that something very much like BASIC is still very much in use. I do know, however, that the size and complexity of my project puts me almost in uncharted territory- I haven't come across a single other person on the web trying to do nearly as much with VBA as this product.

So, there you go- PKM's employers use BASIC, no-one else in the world does :)

0
Pazzerz
Pazzerz

Reply 11 years ago on Introduction

Most of the shop machines I run in my shop are run by 'discarded' computers. Using QuickBasic 4.5 is easy and lets me program all of the machines to accept Gcodes, etc. Who uses BASIC? Many more people than they think. I took classes in college for programming in C. It sucked. When the language gets to the point of being cryptic, its no longer an easy to use interface. I've seen C programming that may as well have just been done in machine code (which I think is easier to look at).

0
Spartan 117
Spartan 117

Reply 11 years ago on Introduction

PICAXE use BASIC and they're one of the most usefull IC's around. Aaron