Introduction to BASIC

From GPWiki

Files:GUITutorial_warn.gif The Game Programming Wiki has moved! Files:GUITutorial_warn.gif

The wiki is now hosted by GameDev.NET at wiki.gamedev.net. All gpwiki.org content has been moved to the new server.

However, the GPWiki forums are still active! Come say hello.

Introduction to BASIC

In BASIC, you accomplish almost everything. An unlimited and flexible language, at the same time being high-level enough for even a child will understand. I remember when I first picked up programming. I wanted to create the greatest game ever, with sleek commercial-grade graphics with nice special effects with an intriguing storyline. Well, I was 10, and I still believe that BASIC can create anything.

I strongly recommend using the freeBASIC compiler with the FBIDE. FreeBASIC is a dialect of a BASIC that is very much like Quickbasic, and seems to retain the standard of BASIC programming. Or, if you're more of a DOS programmer, use qbasic, which you can find over the internet for free. Keep in mind that the tutorials will require you to know how to use an IDE.

Let's get started, shall we?

Open freeBASIC and start up a new source file. Enter the following information:

print "hello world"

and press F5, or under the menu RUN goto Quick Run. You should see a blinking fast window that closes almost instantly. Within it, you may have caught the words hello world.

In BASIC, there are commands, or statements that will allow you to do something. For example, you can probably guess that print "hello world" means to print hello world on the screen. Ignore the quotes for right now.

Okay, you are finished! Try the next couple of tutorials.