Home

Egg Directory / Search

New Eggs / Best of New

New Blogs / Pics / Activity
New Files / Movies
Community Forum

Group Directory

Stickers

 


 
DROPPED
This Egg was not accepted into the Egg Directory. It did not have a sufficient rating or was rejected by an Egg Moderator
Edit PageMessage Dist719Add CommentAdd to FavoritesEmail to Friend

BASIC programming guide

DO NOT TRY THIS AT HOME : Our text files and message bases are for INFORMATIONAL PURPOSES ONLY. DO NOT undertake any project based upon any information obtained from this or any other web site.We are not responsible for, nor do we assume any liability for, damages resulting from the use of any information on this site.
(89 votes)
Published: Aug 25, 2007 11:16 p.m.
Viewed 390 times




1. Intro

BASIC stands for Beginners All-Purpose Symbolic Instruction Code.
This is a basic programming language that i always recommend to people who are looking to start programming.
It is not visual basic, it may look somewhat simular, but is different in may ways.
For beginners, please learn what a variable is before moving on (try google).

NOTE ON BASIC VARIABLES:
For variables that contain letters, they must start with a $. Variables that contain only numbers do not have to start with anything. Variables are CaSe SeNsItIvE and may contain no numbers or spaces, only letters.

2. Basic Program

Lets start with a program that will ask someones name, then greet them.
CODE :

[ask]
input"Please tell me your name:"; $name

[greet]
cls
print"Hello, "; $name
print
input"Press enter to continue"; $DummyVariable
end


Now, lets go over this...

CODE :
[ask]

this is a label, labels are like shortcuts to certain parts of your code. you MUST use labels. More of this will be explained sooner.

CODE :

input"Please tell me your name:"; $name

"input" means that the user is alowed to type, and his/her response will be saved as a variable. The program will not continue until the user enters some type of input and presses enter. The text in between the quotes is the text that will be shown to the person running the program. The ; just means that there is going to be another command on that line. "$name" is the variable that the user input will be stored at.

CODE :

[greet]

Another Label, just like the first one.

CODE :

cls

This clears the screen.

CODE :

print "Hello, "; $name

"print" displays whatever is in between the quotes to the person running the program, just like input. But, this does not allow the user to put in any input. Nor does the program wait for input, it will just print it and go to the next command. "Hello, " is telling print to print everything inside the quotes to the user. ; just means there is going to be another command on the same line. "$name" prints whatever text is in that variable to the user. It prints this info because it is on the same line as print.

CODE :

print

Because this print command has no quotation marks it will just skip a line and the next line of code will operate on the line below it.

CODE :

input"Press enter to continue"; $DummyVariable

Now, this is just a common sense thing i picked up. this line prints press enter to continue and stores their input in $DummyVariable. im not planning to use $DummyVariable for anything, but the program can’t continue until they put in some kind of input. The end command is next so if i just left my dummy line out, then the user would not get a chance to read the programs greeting as it would close to fast.

CODE :

end

I kinda gave away what it does above, but the end command safely closes the program for the user.

3. Outcome of chapter 2

The program prints to me:

Please tell me your name:

I enter my name (mr.toes)

The screen clears

The program prints to me:

Hello, mr.toes

Press enter to Continue

I press enter and the program closes.

TaDa!

4. A bit More Learning
Now this is why we need labels.... What it i took the program i had and chnaged it to this:
CODE :


[ask]
input"Please tell me your name:"; $name

[greet]
cls
print"Hello, "; $name
print
input"Press enter to continue"; $DummyVariable

[choose]
input "Are You Sure thats your name?:"; $Sure
if instr ("YESyes", $sure) then goto [yes]
if instr {"NOno", $Sure) then goto [ask]
goto [end]

[yes]
cls
Print "Really? If you say so..."
print
print "press enter to close this program."; $dummyvariable
end

[end]
print "You were supposed to tell me yes or no!"
print
input "Press enter to quit"; $DummyVariable
end


Now, since this is a bit longer than the first program, i will only go over the new parts.

CODE :

goto [end]

the goto command tells the program to goto the label called end. This is why labels are important, they let you manuver around your code.

CODE :

if instr ("YESyes", $sure) then goto [yes]

I use this line of code the most, lets break it down.
If = it just means if, but you must have it
instr = means in string, you must have this as well
("YESyes", $sure) = this part means that if the letters Y, E, S, y, e, s, are found in the variable $sure then execute the command(s) after this (on the same line only). If not, then simply ignore the rest of this line and continue the code. the brackets, quotes, and comma must be in the right place on this.
then = must have this
goto [yes] = this is the rest of the line, tells the program to goto the label [yes]

so the whole line means: is YES or yes is found in the variable $sure then goto the label [yes] if not, continue the code

from those last two explinations you should be able to figue out the program.

5. Version

There are many versions on BASIC, this one is liberty basic.
(www.libertybasic.com)
If you download the program at the site it comes with a compiler and program maker, it is free to use, as well.

6. conslusion

This brings my article to an end, i hope you enjoyed it and if its requested, i will make a second article thats longer and covers a bit move advanced stuff, mabey even some GUI.
 

Add Egg To Watchlist

LanSLIde

Aug 25, 2007 11:26 pm -
C/P
0*

http://www.hackth ssite.org/articles/read/82


LanSLIde

Aug 25, 2007 11:31 pm -
C/P
0*

http://www.hackth ssite.org/articles/read/82


DaDevil

Aug 25, 2007 11:43 pm -
C/P


FAIL!
FAIL!
FAIL!
F IL!
FAIL!
FAIL!


baddspella

A g 26, 2007 12:19 am -
bahahah owned budddddyy! 0!


Lisk

Aug 26, 2007 7:13 am -
The code looks more like JustBasic to me. I usedd to use that alot its the excat some code....WOW copy and paste huh? ZERO stars here AND on EVERYTHING including profile.
Never copy and paste bud.


Pirate_Astronaut

Aug 26, 2007 8:15 am -
c/p 0**
c/p 0**
c/p 0**


-Blackhawk-

Aug 26, 2007 9:05 am -
You will be raped in your asshole.


aLL_MuST_DiE

Aug 26, 2007 10:44 am -
hahahahaha you didnt even change the name from mr.toes to watever urs is.


St00pK1d

Aug 27, 2007 9:41 am -
5

 


Home | Contact Us | Sign Up | Advertise Here
Visit our companion site, Prankpedia.com
Please read the LEGAL DISCLAIMER & CONTENT GUIDELINES
© 2008 rotteneggs.com - A Social Network for Pranksters.
4.528161 (Server 2)