Could we have the source?
>Could we have the source?
heh.. not in it's current state i'll have to clean it up some, and maybe comment it a bit... i'm just finishing up the scoring and everything, so i'll try to post it later today.
//edit: source is up.. you can get it from that thread where people post their best games (in the gaming forum)
Last edited by MadHatter; 01-05-2003 at 08:09 PM.
If I had a world of my own, everything would be nonsense. Nothing would be what it is, because everything would be what it isn't. And contrariwise, what it is, it wouldn't be, and what it wouldn't be, it would. You see?
Heh... My class version right now only has a ball and is ASCII (don't know graphics and don't really have the time to learn... college starts again in about a week).
As for globals... it uses them for the screen's size and for the ASCII character that represents the ball (I'm using #define ).
Why not use const?Originally posted by Frobozz
(I'm using #define ).
FAQ
"The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs." -- Joseph Weizenbaum.
"If you cannot grok the overall structure of a program while taking a shower, you are not ready to code it." -- Richard Pattis.
Good question... I'm just using it because I've seen it used a lot in a friend's code and also in my professor's code (even though I haven't taken his class yet).
Is const better? Does #declare allow stuff to be used regardless of data type?
Last edited by Frobozz; 01-07-2003 at 01:21 AM.
when you use #define such as in the form
#define PI 3.1415926
then PI will be treated as though it is a float.
PI could also be declared as
const float PI = 3.1415926
Not much difference, though one is a const global variable the other is a #define statement
Later,
WebmasterMattD
WebmasterMattD.NET
Actually, it would be a double, not a float.Originally posted by WebmasterMattD
when you use #define such as in the form
#define PI 3.1415926
then PI will be treated as though it is a float.
PI could also be declared as
const float PI = 3.1415926
Not much difference, though one is a const global variable the other is a #define statement
Later,
#define doesn't obey scope rules, so you shouldn't use it much. There are only very few places you should have to use #define, and this is not one of them.