Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / little programm that i made for beginners to examine

Author
Message
whipped6
18
Years of Service
User Offline
Joined: 31st Aug 2006
Location:
Posted: 24th Sep 2006 06:25
i made a basic text programm it needs little more working but it works u can make it look more eye catching and u can put a manual in there how to use it if you want heres how it works though.

u just enter a number 1-10 and it gives you a momma joke thats it just a little programm for beginners id really recommend if u put this online to put a manual on how to use it.

i am a beginner to but it was fun making here is the code...

DO
rem input from users
Input "Enter word",word$
rem momma jokes
if word$="1" then print "yo momma so fat i went to go watch the never ending story and she walked by and i missed the whole thing"
if word$="2" then print "yo momma so ugly she looked out the window and got aressted for mooning"
if word$="3" then print "yo momma so stupid she got locked in a grocery store and died of starvation"
if word$="4" then print "yo momma so stupid she tripped over a cordless phone"
if word$="5" then print "yo momma so stupid she sat on the TV and watched the couch"
if word$="6" then print "yo momma so fat i didnt just sit by her the whole class did"
if word$="7" then print "yo momma so fat she stood on the scale and it said wait limit exeded"
if word$="8" then print "yo momma so nasty she gave me a virus"
if word$="9" then print "yo momma so ugly she looked in the mirror and her own image flicked her off"
if word$="10"then print "yo momma so stupid because when someone said superbowl she went and got a spoon"
if word$="End" then end
endif
LOOP
DO
if action=0
print "Command not recognized"
endif
LOOP

game creator
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 24th Sep 2006 10:27 Edited at: 24th Sep 2006 12:01
Quote: "little programm that i made for beginners to examine"

... and learn how NOT to do things!

The EndIf command is totally unnecessary. Surely you must have run the program before posting and seen the error mesage?
Also the second DO ... LOOP will never be executed because the code will be trapped in the first loop.

Here is a much better way to do it:



It's heaily commented so that you can work out what is happening.
This is the same code without comments:




whipped6
18
Years of Service
User Offline
Joined: 31st Aug 2006
Location:
Posted: 24th Sep 2006 17:43
well the programm that i did worked for me i should of took out the if statement at the end because i did no it didnt work but thanks for pointing that out scraggle

game creator
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 25th Sep 2006 06:07
well yours worked, it's just not very effective .

Pirates of Port Royale
Live the life of a pirate.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 25th Sep 2006 11:23
How on earth did you get it to work? It doesn't even compile!!!



Saiochi
18
Years of Service
User Offline
Joined: 17th Sep 2006
Location: Under your bed
Posted: 25th Sep 2006 11:50
Creative editting

If you have X-ray vision, can you see through your own eyelids?
whipped6
18
Years of Service
User Offline
Joined: 31st Aug 2006
Location:
Posted: 26th Sep 2006 02:40
It works for me it was made in (DarkBasic creator)

game creator
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 26th Sep 2006 05:52
if you take out that last endif for whatever reason is in there, it works, but is still not very effective .

Pirates of Port Royale
Live the life of a pirate.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 26th Sep 2006 11:24
The problem is the title of the thread. If a new user of DarkBASIC looks at this, they may think it is the right way to do things. It's a program written by a beginner, not for a beginner.

Posting your first bits of code is fine, and you'll get some good feedback from others to show you how to do it better. Just don't mislead people!!!



Login to post a reply

Server time is: 2024-09-25 09:31:50
Your offset time is: 2024-09-25 09:31:50