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.

DarkBASIC Discussion / My first ever program

Author
Message
Lanthor
17
Years of Service
User Offline
Joined: 4th Dec 2007
Location:
Posted: 12th Jul 2008 13:08
my first ever program. it's pretty bad but i have no previous programing experience so plz tell me what you think

code:

do
print "whats your name?"
input name$
cls
print "???: ";name$
sleep 5000
cls
print "Computer: Hello ";name$
sleep 5000
cls
print "Computer: My name is Computer 10101010101010101010"
sleep 5000
cls
print "Computer: How old are you?"
input Age
cls
print name$ ;": " ;Age
Sleep 5000
cls
print "Computer: Ok, I'm 1010101010101010101 years old"
sleep 5000
cls
print "Computer: Cya"
sleep 5000
cls
loop

Attachments

Login to view attachments
Ed222
17
Years of Service
User Offline
Joined: 3rd Nov 2007
Location: Calgary
Posted: 12th Jul 2008 18:57 Edited at: 12th Jul 2008 19:02
you should put you code in a code box it's the code button beside the link button when posting. But other then that I think that you should let the player advance to the next text their self instead of making it appear for 5 seconds

Lanthor
17
Years of Service
User Offline
Joined: 4th Dec 2007
Location:
Posted: 13th Jul 2008 04:30
thanks for the advice i will remember for future programs
Irojo
17
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 13th Jul 2008 04:35
Good job. I think text is perfect for starters. Here's a few things that you should always do with your code:
-Indent: It makes it easier to read, and in the future you will be happy you did so.
-put cls at the beginning of your loop.

---
So your code should look more like this:



But I recommend you use the suspend for key command so the person doesn't have to wait 5 seconds each time.

I urge you to watch the film "Who killed the electric car". Support electric cars! Did you know their used to be more electric cars then gassoline cars?
Lanthor
17
Years of Service
User Offline
Joined: 4th Dec 2007
Location:
Posted: 13th Jul 2008 04:56
can u plz show me an example of the suspend for key command
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 13th Jul 2008 07:51
Quote: "But I recommend you use the suspend for key command so the person doesn't have to wait 5 seconds each time.
"


Or you could use wait key. I like it better because it is shorter, and if you want you can always change out key for a number. It does exactly the same thing as suspend for key.

Ever notice how in Microsoft word, the word "microsoft" is auto corrected to be "Microsoft" but "macintosh" just gets the dumb red underline?
Irojo
17
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 13th Jul 2008 22:33 Edited at: 13th Jul 2008 22:34
Quote: "can u plz show me an example of the suspend for key command "


Sure:





I hope that helps.

I urge you to watch the film "Who killed the electric car". Support electric cars! Did you know their used to be more electric cars then gassoline cars?

Login to post a reply

Server time is: 2025-06-07 06:45:56
Your offset time is: 2025-06-07 06:45:56