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 / Variables?

Author
Message
Zeus
19
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 8th Jul 2006 22:47
How do I create a variable that prints how much money and keeps track of that money?

><Jordan Stories Games><
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 9th Jul 2006 00:04
If you can't do that then you can't program anything.

Zeus
19
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 9th Jul 2006 02:45
I have made TWO programs! I just NEVERuse variables UNTIL now.

><Jordan Stories Games><
Sixty Squares
20
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 9th Jul 2006 13:44 Edited at: 9th Jul 2006 13:45
*Ahem* your losing/gaining money post


H-E-L-P F-I-L-E-S... They're there to help!

My Functions: Mine
Post yours: Post
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 9th Jul 2006 14:51
You made two programs with no variables...........

Zotoaster
21
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 9th Jul 2006 18:22
Uhhh huh...

Zeus
19
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 9th Jul 2006 18:51
Wanna see 'em? One is meant for hospital's and Zotoaster already seen the other one.

Here is the one for hospitals.

[img]C:\Documents and Settings\Jordan Earl Gibson\Desktop\bowlallytycoonsig.bmp[/img]
nojbox87
21
Years of Service
User Offline
Joined: 26th Jun 2005
Location: England
Posted: 9th Jul 2006 18:55
is it possible to program anything without variables?

I am a Christian and I know that God loves me. That is what makes my life so great!
Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 9th Jul 2006 19:56 Edited at: 9th Jul 2006 19:59
Quote: "is it possible to program anything without variables?"


print "Hello world"

Variables are created automatically as you use them.

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
nojbox87
21
Years of Service
User Offline
Joined: 26th Jun 2005
Location: England
Posted: 9th Jul 2006 22:13 Edited at: 9th Jul 2006 22:14
lol true that is a good program. u could print lots of stuff. suppose u could change some colours or add a picture...

and to be helpful. to store your money.
money=100

to gain money:
money=money+1

or to loose:
money=money-1

and i bet i made a mistake there somewhere, i always do

I am a Christian and I know that God loves me. That is what makes my life so great!
Zotoaster
21
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 9th Jul 2006 23:20
Nop lol.

Or if you can't even be bothered with that... inc money, and dec money.

nojbox87
21
Years of Service
User Offline
Joined: 26th Jun 2005
Location: England
Posted: 10th Jul 2006 20:39
lol true you could do that. although for no apparent reason ive never used it.

I am a Christian and I know that God loves me. That is what makes my life so great!
HenryTj
20
Years of Service
User Offline
Joined: 2nd Nov 2005
Location:
Posted: 11th Jul 2006 12:16
I use variable extensively. Once you have enough code it become difficult to keep track of what object 20 is verses object 12. So I do things like

PlayerObj = 1
...
... Rotate Object PlayerObj, ...
...

It makes the code much more readable, especially 6-12 months later when you have forgotten what object 5 is. Some may think I use too many variables, but like I said, it helps to keep the code readable.

Login to post a reply

Server time is: 2026-07-07 00:32:21
Your offset time is: 2026-07-07 00:32:21