| Learning BASIC is hard. | |
|
|
Author | Message |
---|
Letiger 888.com
Posts : 910 Prestige : 6492 Verve-Fame : 17 Join date : 2009-12-23 Age : 31 Location : Russia.
| Subject: Learning BASIC is hard. 7/6/2010, 8:18 am | |
| So after learning how to do a bit, I try to make a C to F and back calculator. It took 30 mintues after many errors including having it all refer to C, having C make errors, and just typos in programming declare sub main declare sub C declare sub F main sub main cls dim choice print "1. Celcius" print "2. Farenheight" input "1 or 2" ; choice if choice = 1 then C elseif choice = 2 then F else print "Dumbass." end if end sub sub C cls dim num1 dim answer dim a1 dim a2 input "What is the number" ; num1 a1 = num1 * 9 a2 = a1 / 5 answer = a2 + 32 print answer sleep end sub Sub F cls dim num2 dim answer2 dim a3 dim a4 input "What is the number" ; num2 a3 = num2 - 32 a4 = a3 / 9 answer2 = a4 * 5 print answer2 sleep end sub main sleep | |
|
| |
DarkKingBernard Boeing
Posts : 753 Prestige : 6290 Verve-Fame : 50 Join date : 2010-01-05 Age : 27 Location : Bosnia And Herzegovina
| Subject: Re: Learning BASIC is hard. 7/6/2010, 9:16 am | |
| Why is it called BASIC if it's HARD?
A difficult question has came to our universe, we have no idea if it's possible to answer O_o | |
|
| |
Letiger 888.com
Posts : 910 Prestige : 6492 Verve-Fame : 17 Join date : 2009-12-23 Age : 31 Location : Russia.
| Subject: Re: Learning BASIC is hard. 7/6/2010, 9:43 am | |
| It's hard if you're starting. It's called BASIC because it's the first computer code designed in the late 70's I think. | |
|
| |
Letiger 888.com
Posts : 910 Prestige : 6492 Verve-Fame : 17 Join date : 2009-12-23 Age : 31 Location : Russia.
| Subject: Re: Learning BASIC is hard. 7/6/2010, 9:45 am | |
| I also made a calculator, with much relative ease than that.
Declare sub main declare sub add declare sub subtract declare sub multiply declare sub divide main sub main dim choice Print "1.Add " ; Print "2.Subtract " ; Print "3.Multiply " ; Print "4.Divide " ; Input "1,2,3, or 4"; choice if choice = 1 then Add elseif choice = 2 then Subtract elseif choice = 3 then Multiply elseif choice = 4 then Divide else main end if sleep end sub sub add cls dim input1 dim input2 dim answer1 input "First number" ; input1 input "Second Number" ; input2 answer1 = input1 + input2 print answer1 sleep
end sub
sub subtract cls dim input3 dim input4 dim answer2 input "First number" ; input3 input "Second number" ; input4 answer2 = input3 - input4 print answer2 sleep end sub
sub multiply cls dim input5 dim input6 dim answer3 input "First number" ; input5 input "Second number" ; input6 answer3 = input5 * input6 print answer3 sleep end sub
sub divide cls dim input7 dim input8 dim answer4 input "First number" ; input7 input "Second number" ; input8 answer4 = input7 / input8 if input8 = 0 then print "You destroyed the world." endif print answer4 sleep end sub main
sleep | |
|
| |
Mussirus Italia Ferrari
Posts : 479 Prestige : 6021 Verve-Fame : 94 Join date : 2010-01-05 Age : 32 Location : Holland
| Subject: Re: Learning BASIC is hard. 7/6/2010, 9:54 am | |
| I had a few BASIC lessons last year, but i didn't pay any attention, so.. I envy your persistence in learning BASIC. | |
|
| |
Letiger 888.com
Posts : 910 Prestige : 6492 Verve-Fame : 17 Join date : 2009-12-23 Age : 31 Location : Russia.
| Subject: Re: Learning BASIC is hard. 7/6/2010, 9:55 am | |
| declare sub main MAKES A SUB COMMAND CALLED MAIN ETC. declare sub C declare sub F main ACTIVATES MAIN SUB sub main CREATES SUB cls CLEARS EVERYTHING ABOVE dim choice CREATES VARIABLE CALLED CHOICE print "1. Celcius" PRINTS THE WORDS 1.CELCIUS print "2. Farenheight" input "1 or 2" ; choice ASKS THE USER TO INPUT SOMETHING. THAT VARIABLE IS CALLED CHOICE if choice = 1 then C IF THEIR CHOICE IS 1 THEN GOTO SUB C elseif choice = 2 then F OR ELSE IF IT'S 2 GO TO SUB F else print "Dumbass." EVERYTHING ELSE, PRINT THE WORD DUMBASS end if END THE IFS end sub END THE SUB
sub C cls dim num1 CREATES MORE VARIABLES dim answer dim a1 dim a2 input "What is the number" ; num1 ASKS THE USER FOR INPUT OF A NUMBER. THAT'S CALLED NUM1 a1 = num1 * 9 a2 = a1 / 5 answer = a2 + 32 SIMPLE MATHS. THE VARIBALS TOGHTER EQUAL ANOTHER CALLED THE ANSWER print answer PRINTS THE ANSWER sleep SLEEP IS FOR MAKING THE WORDS ON THE SCREEN STAY ON ONCE THE SUB COMMAND IS DONE end sub
Sub F cls dim num2 dim answer2 dim a3 dim a4 input "What is the number" ; num2 a3 = num2 - 32 a4 = a3 / 9 answer2 = a4 * 5 print answer2 sleep end sub main
sleep
| |
|
| |
Letiger 888.com
Posts : 910 Prestige : 6492 Verve-Fame : 17 Join date : 2009-12-23 Age : 31 Location : Russia.
| Subject: Re: Learning BASIC is hard. 7/6/2010, 10:09 am | |
| TO Fiaman
1 print "No sex for you." 2 goto 1 | |
|
| |
Mussirus Italia Ferrari
Posts : 479 Prestige : 6021 Verve-Fame : 94 Join date : 2010-01-05 Age : 32 Location : Holland
| Subject: Re: Learning BASIC is hard. 7/6/2010, 10:21 am | |
| It looks logical, but complicated to make at the same time. | |
|
| |
Conal 1337
Posts : 1434 Prestige : 7456 Verve-Fame : 91 Join date : 2009-12-28 Age : 30 Location : ҉̡̢̡̢̛̛̖̗̘̙̜̝̞̟̠̖̗̘̙̜̝̞̟̠̊̋̌̍̎̏̐̑̒̓̔̊̋̌̍̎̏̐̑
| Subject: Re: Learning BASIC is hard. 7/6/2010, 10:30 am | |
| | |
|
| |
Letiger 888.com
Posts : 910 Prestige : 6492 Verve-Fame : 17 Join date : 2009-12-23 Age : 31 Location : Russia.
| Subject: Re: Learning BASIC is hard. 7/6/2010, 10:50 am | |
| I've tried making text based game >.< You know, 2 are death 1 is life.
Well, IT WONT FUCKING LEAD TO DEATH1, SCREENCHOICE2, OR QUIT
Declare sub mainscreen Declare sub screen1 Declare sub screen2 declare sub death1 declare sub quit
mainscreen sub mainscreen dim mainscreenchoice as integer Print "Do you wish to start your adventure" ; Input " 1.Y/N.2" ; mainscreenchoice if mainscreenchoice = 1 then screen1 elseif mainscreenchoice = 2 then print " Why would you open this game if you weren't going to play" ; else print "It's either Y or N, and having it on anything else dosen't unlock any easter eggs." end if sleep end sub sub screen1 cls dim screen1choice1 as integer Print " You stand before the foot of a tree. To your left, is an apple." Print " To your feet, is a trap door." Print "1. Eat the apple 2. Continue down the hole Print "3. Walk away" Input "1,2,3" ; screenchoice1 if screen1choice1 = 2 then screen2 elseif screen1choice1 = 1 then death1 elseif screen1choice1 = 3 then quit end if sleep end sub
sub Death1 cls Print " You eat the apple, but find out it's poisoned. You are dead." dim Restart as integer Input "Try again? 2 for yes." ; Restart if Restart = 2 then screen1 end if sleep end sub
sub quit cls dim restart Print " You quit. You should never Have come." ; restart
sleep end sub
sub screen2 cls Print "You go down a hallway. It is dimly lit with candles. On the wall," Print "is a spear." dim screen2choice as integer Input "1.Take Spear. 2.Ignore and continue" ; screenchoice2 if screenchoice2 = 1 then elseif screenchoice2 = 2 then
else Print "INvalid option" endif
sleep
end sub | |
|
| |
Letiger 888.com
Posts : 910 Prestige : 6492 Verve-Fame : 17 Join date : 2009-12-23 Age : 31 Location : Russia.
| Subject: Re: Learning BASIC is hard. 7/6/2010, 10:53 am | |
| | |
|
| |
Letiger 888.com
Posts : 910 Prestige : 6492 Verve-Fame : 17 Join date : 2009-12-23 Age : 31 Location : Russia.
| Subject: Re: Learning BASIC is hard. 7/6/2010, 11:13 am | |
| FFFFFFFFFFFFFFFFFFFFFFFFFFFFF-
Declare sub mainscreen Declare sub screen1 Declare sub screen2 declare sub death1 declare sub quit declare sub screen3 declare sub death2 declare sub death3 declare sub screen4 declare sub screen5 mainscreen sub mainscreen dim mainscreenchoice as integer Print "Do you wish to start your adventure" ; Input " 1.Y/N.2" ; mainscreenchoice if mainscreenchoice = 1 then screen1 elseif mainscreenchoice = 2 then print " Why would you open this game if you weren't going to play" ; else print "It's either Y or N, and having it on anything else dosen't unlock any easter eggs." end if sleep end sub sub screen1 cls dim screen1choice1 as integer Print " You stand before the foot of a tree. To your left, is an apple." Print " To your feet, is a trap door." Print "1. Eat the apple 2. Continue down the hole Print "3. Walk away" Input "1,2,3" ; screen1choice1 if screen1choice1 = 2 then screen2 elseif screen1choice1 = 1 then death1 elseif screen1choice1 = 3 then quit end if sleep end sub
sub Death1 cls Print " You eat the apple, but find out it's poisoned. You are dead." dim Restart as integer Input "Try again? 2 for yes." ; Restart if Restart = 2 then screen1 end if sleep end sub
sub quit cls dim restart Input "Try again? 2 for yes." ; restart
sleep end sub
sub screen2 cls Print "You go down a hallway. It is dimly lit with candles. On the wall," Print "is a spear." dim screen2choice as integer Input "1.Take Spear. 2.Ignore and continue" ; screenchoice2 if screenchoice2 = 1 then screen3 elseif screenchoice2 = 2 then death2
else Print "Invalid option" endif
sleep
end sub ' I HAVE TO BE ENTIRELY THOROUGH UGH
sub screen3 cls Print "Spear in hand, you see two orcs ahead. They don't look friendly." dim choice233 as integer Input "1.Sneak up and attack. 2. Full frontal attack" ; choice233 if choice233 = 2 then screen4 elseif choice233 = 1 then death3 end if sleep end sub
sub death2 cls Print "You encounter orcs ahead and cannot fight them withought a spear." dim Restart as integer Input "2 for Restart" ; Restart if restart = 2 then screen1 endif sleep end sub
' Gettin' the Hang of it ;O
sub death3 cls Print "You sneak up on the orcs and throw your spear into one's back." Print " The other takes notice of this and charges after you." Print "You try to wrestle your spear out of the orc's back, but it's stuck." Print "The other orc clubs you on the head." dim Restart as integer Input "2 for Restart" ; Restart if restart = 2 then screen1 end if sleep end sub
sub screen4 cls Print "You charge up to the orcs and slash one of their face's in." Print "The other is stunned and he is dispatched as well." dim choice as integer input "1. Search Orcs 2. Continue" ; choice if choice = 1 then screen5 elseif choice = 2 then screen5 end if
sleep end sub
sub screen5 cls Print " sleep end sub
| |
|
| |
Spunky6666 Satanic
Posts : 657 Prestige : 6197 Verve-Fame : 58 Join date : 2009-12-05 Location : Mayoland, USA
| Subject: Re: Learning BASIC is hard. 7/6/2010, 12:43 pm | |
| Cool! I tried to make a text-based game once too, but unfortunately i kept making typos and that forced me to start the whole game making process over again because of the program I was using. I eventually lost interest in the whole thing, mainly because my attention span is about the size of an ant. Maybe one day I'll get up the courage (and the funds) to buy a decent program. Until then, all I have left is my dreams... | |
|
| |
Letiger 888.com
Posts : 910 Prestige : 6492 Verve-Fame : 17 Join date : 2009-12-23 Age : 31 Location : Russia.
| Subject: Re: Learning BASIC is hard. 7/6/2010, 12:44 pm | |
| I did this for free. And no, if I mess up I get an error and it shows me generally where. | |
|
| |
Letiger 888.com
Posts : 910 Prestige : 6492 Verve-Fame : 17 Join date : 2009-12-23 Age : 31 Location : Russia.
| Subject: Re: Learning BASIC is hard. 7/6/2010, 1:20 pm | |
| Finished product :
Declare sub mainscreen Declare sub screen1 Declare sub screen2 declare sub death1 declare sub quit declare sub screen3 declare sub death2 declare sub death3 declare sub screen4 declare sub screen5 declare sub screen6 declare sub longdeath declare sub screen7 declare sub longdeath2 declare sub ChuckNorri declare sub screen8 declare sub death4 declare sub screwit mainscreen sub mainscreen dim mainscreenchoice as integer Print "Do you wish to start your adventure" ; Input " 1.Y/N.2" ; mainscreenchoice if mainscreenchoice = 1 then screen1 elseif mainscreenchoice = 2 then print " Why would you open this game if you weren't going to play" ; elseif mainscreenchoice = ChuckNorris then ChuckNorri else print "It's either Y or N, and having it on anything else dosen't unlock any easter eggs." end if sleep end sub sub screen1 cls dim screen1choice1 as integer Print " You stand before the foot of a tree. To your left, is an apple." Print " To your feet, is a trap door." Print "1. Eat the apple 2. Continue down the hole Print "3. Walk away" Input "1,2,3" ; screen1choice1 if screen1choice1 = 2 then screen2 elseif screen1choice1 = 1 then death1 elseif screen1choice1 = 3 then quit end if sleep end sub
sub Death1 cls Print " You eat the apple, but find out it's poisoned. You are dead." dim Restart as integer Input "Try again? 2 for yes." ; Restart if Restart = 2 then screen1 end if sleep end sub
sub quit cls dim restart Input "Try again? 2 for yes." ; restart if restart = 2 then screen1 end if
sleep end sub
sub screen2 cls Print "You go down a hallway. It is dimly lit with candles. On the wall," Print "is a spear." dim screen2choice as integer Input "1.Take Spear. 2.Ignore and continue" ; screenchoice2 if screenchoice2 = 1 then screen3 elseif screenchoice2 = 2 then death2
else Print "Invalid option" endif
sleep
end sub ' I HAVE TO BE ENTIRELY THOROUGH UGH
sub screen3 cls Print "Spear in hand, you see two orcs ahead. They don't look friendly." dim choice233 as integer Input "1.Sneak up and attack. 2. Full frontal attack" ; choice233 if choice233 = 2 then screen4 elseif choice233 = 1 then death3 end if sleep end sub
sub death2 cls Print "You encounter orcs ahead and cannot fight them withought a spear." dim Restart as integer Input "2 for Restart" ; Restart if restart = 2 then screen1 endif sleep end sub
' Gettin' the Hang of it ;O
sub death3 cls Print "You sneak up on the orcs and throw your spear into one's back." Print " The other takes notice of this and charges after you." Print "You try to wrestle your spear out of the orc's back, but it's stuck." Print "The other orc clubs you on the head." dim Restart as integer Input "2 for Restart" ; Restart if restart = 2 then screen1 end if sleep end sub
sub screen4 cls Print "You charge up to the orcs and slash one of their face's in." Print "The other is stunned and he is dispatched as well." dim choice as integer input "1. Search Orcs 2. Continue" ; choice if choice = 1 then screen5 elseif choice = 2 then screen5 end if
sleep end sub
sub screen5 cls Print "You continue along the path, with nothing in hand when you come" Print "accross a large hallway. Inside, there is a shiny marble statue" Print "Of a Knight in his uniform." Print "You slowly walk towards it, the surrounding chamber being made of" Print "marbe, as the floor, making the room as white as the moon." dim ffs as integer input "Press 1 to continue." ; ffs if ffs = 1 then screen6 end if sleep end sub
sub screen6 Print "On the bottom of the statue, is an engraving." Print "It reads, Is the apple Poisonous?" dim choice input "Is it? 1.Y, 2.N" ; choice if choice = 1 then longdeath elseif choice = 2 then screen7 end if sleep end sub
sub screen7 cls Print "You look at the apple and think that it coudn't be, but somehow" Print "you feel as if you shoudn't eat it. You say No and the bottom of" Print "the pillar opens, revealing a secret catacomb." Print "You walk inside the catacomb and notice three levers on the wall." Print "A plaque reads 'The same way to open the catacombs of the church Print "of Innsmouth." Print "Choose the order. Small Medium then Large" dim choice input "1.SML 2.SLM 3.MSL 4.MLS 5. LSM 6.LMS" ; choice if choice = 1 then screen8 else death4 end if sleep end sub
sub longdeath cls Print "The statue begins to emit a weird glow. You look up and everything" Print "goes black. Suddenly, you're in an unknown place. Standing on black" Print "water, with a black moon. All outlines appear to be white, though." Print "A figure walks up to you." dim cont input "Press 1." ; cont if cont = 1 then longdeath2 end if sleep end sub
sub longdeath2 cls Print "He says, 'You're suspicious aren't you?' Print " 'Well for that, you'll have to die.'"
Print "He lunges his sword into you, but not before he injects you with a" Print "Fluid. The fluid appears to make time slow down almost indfeintely" Print "But you can't move. You try to move your arms for 100 years it seems" Print "And you finally can, but only a short distance. It appears you can" Print "Think and feel incredibly fast, but can't do anything." Print "He kills you in a flash, but to you, it feels eternal." dim res input "Restart 1.Y" ; res if res = 1 then screen1 end if sleep end sub
sub ChuckNorri cls Print "IMA CHUCK-NORRRISSSSSS!!!!!!!!!" dim back input "Back to game, eh? 1.Y" ; back if back = 1 then mainscreen end if sleep end sub
sub screen8 Print "You enter the correct combination and are allowed to proceed." Print "You enter a different room, it's darker than normal, and you feel" Print "as if something isn't right. Poison gas spews out from an unknown" Print "location and you pass out and die." Print " THE END. YEA, I GOT LAZY." dim aga input "Start again? 1.Y 2.N" ; aga if aga = 1 then mainscreen elseif aga = 2 then screwit end if sleep end sub
sub death4 cls Print "You enter the wrong combination and a trap door fells you to your death." dim again input "Again? 1.Y" ; again if again = 1 then mainscreen end if sleep end sub
sub screwit Print "Yea, I woudn't either." sleep end sub ' This technically makes 300 lines of code. My first game in basic BASIC ' No seriously. I've seen some other stuff, and it makes this look SIMPLE | |
|
| |
Letiger 888.com
Posts : 910 Prestige : 6492 Verve-Fame : 17 Join date : 2009-12-23 Age : 31 Location : Russia.
| Subject: Re: Learning BASIC is hard. 7/6/2010, 1:27 pm | |
| Shit, the
elseif mainscreenchoice = ChuckNorris then ChuckNorri
Acts as an
else
T_T | |
|
| |
Jomadx Like a Boss!
Posts : 1152 Prestige : 6953 Verve-Fame : 233 Join date : 2009-11-26 Age : 34 Location : North Carolina
| Subject: Re: Learning BASIC is hard. 7/6/2010, 1:30 pm | |
| yeah i remember when i was excited about learning stuff like this..it didn't last long lol | |
|
| |
Letiger 888.com
Posts : 910 Prestige : 6492 Verve-Fame : 17 Join date : 2009-12-23 Age : 31 Location : Russia.
| Subject: Re: Learning BASIC is hard. 7/6/2010, 1:31 pm | |
| You have to learn more and more for it to get more and mroe interesting.
That typo would've costed me frustration if I made it DX | |
|
| |
Jomadx Like a Boss!
Posts : 1152 Prestige : 6953 Verve-Fame : 233 Join date : 2009-11-26 Age : 34 Location : North Carolina
| Subject: Re: Learning BASIC is hard. 7/6/2010, 1:34 pm | |
| - Letiger wrote:
- You have to learn more and more for it to get more and mroe interesting.
That typo would've costed me frustration if I made it DX whoaaa..it's moar, or m0r3 | |
|
| |
Letiger 888.com
Posts : 910 Prestige : 6492 Verve-Fame : 17 Join date : 2009-12-23 Age : 31 Location : Russia.
| Subject: Re: Learning BASIC is hard. 7/6/2010, 1:37 pm | |
| Atleast it shows me where I made a mistake. | |
|
| |
Jomadx Like a Boss!
Posts : 1152 Prestige : 6953 Verve-Fame : 233 Join date : 2009-11-26 Age : 34 Location : North Carolina
| Subject: Re: Learning BASIC is hard. 7/6/2010, 1:49 pm | |
| i played your final product. i tried to move my arm for a hundred years lol | |
|
| |
Letiger 888.com
Posts : 910 Prestige : 6492 Verve-Fame : 17 Join date : 2009-12-23 Age : 31 Location : Russia.
| Subject: Re: Learning BASIC is hard. 7/6/2010, 1:56 pm | |
| Yea. Pain for basicly forever. | |
|
| |
Letiger 888.com
Posts : 910 Prestige : 6492 Verve-Fame : 17 Join date : 2009-12-23 Age : 31 Location : Russia.
| Subject: Re: Learning BASIC is hard. 7/7/2010, 1:21 am | |
| I've read some other stuff, and it seems REALLY REALLY COMPLICATED. I'd need things like videos that go through things one at a time.
I want to make an rpg in basic though.
MY GOAL.
declare sub goal declare sub goal2 goal
sub goal dim cf Input "1. For yes, 2 for no on the goal." ; cf if cf = 1 then goal2 elseif cf = 2 then goal2
end if sleep end sub
goal2 sub goal2 19 Print "It's not going to happen." 20 Goto 19
end sub | |
|
| |
Sponsored content
| Subject: Re: Learning BASIC is hard. | |
| |
|
| |
| Learning BASIC is hard. | |
|