Another gift from the world of #define
Displaying 1-20 of 22 total.
12 next
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
Zip

Rather simpler this one, but handly none the less: Fed up with writing silly looking lines of code like this?
return 0 - 1;

Well, try this instead:
#define MINUS_ONE 4294967295

...
return MINUS_ONE;

Ok, so it's rather pointless, but hey! it's fun! Works for * and the like as well.

Zip

Posted on 2004-07-26 21:20:19

Thrasher

Posted on 2004-07-26 22:55:19 (last edited on 2004-07-26 23:04:34)

Toen

because that's a lot easier than 0 - 1

Posted on 2004-07-26 23:20:12

Zip

ehe.. I wonder what abuse Thrasher decided it was better to edit out...

Not easier, I just don't like the look of (0 - 1), can be rather confusing, whereas MINUS_ONE or something is pretty obvious. It's a clarity thing, not a timesaver/spacesave/optimisation thing.

Zip

Posted on 2004-07-26 23:39:58

Thrasher

Oh, you know. Just making fun of verge's inability to return -1; :P

Hmm. I guess that's mean. But it must be said.

Posted on 2004-07-27 00:26:43

Ness

*Points to all the inane comments in his HoV pertaining to VERGEs inability to understand a negative number, floats, bools, an array that isn't global, or a struct variable that isn't defined right after the struct*

I'm not complaining....just pointing out the facts

Posted on 2004-07-27 00:30:46

mcgrue

Quote:Originally posted by Thrasher

Oh, you know. Just making fun of verge's inability to return -1; :P

Hmm. I guess that's mean. But it must be said.



return 0-1; //?

Posted on 2004-07-27 01:09:16

Interference22

VERGE has its limits and yes, some can be extraordinarily annoying, but it goes without saying that its merits are ROCKING COOL.

Posted on 2004-07-27 01:10:05

RageCage

why not

#define MINUS_ONE 0-1
...
return MINUS_ONE;

??

Although your way is fancy =p

Posted on 2004-07-27 01:48:09

Zip

#define BAD_ONE 0-1

#define GOOD_ONE 4294967295

void autoexec()
{
if (10 * BAD_ONE == 10 * GOOD_ONE)
MessageBox("You're 'aving a laugh guvna!")
exit("That's why Rage");
}


You could put brackets round of course, but remember #defines are just like a find/replace operation before compile, so you're doing an unnessersary operation each time. Goes for McGrue, too, you CAN use (0-1) everywhere, but it rapidly gets confusing and hard to read... :D

Zip

[Edit: Silly pre-tags - but beat gannon bu a second or two :) ]

Posted on 2004-07-27 02:10:58 (last edited on 2004-07-27 02:11:56)

gannon

because 5 - MINUS_ONE would give you 4 and that doesn't make any sence :P

Posted on 2004-07-27 02:10:58

mcgrue

At any rate, I know vecna plans on making the unary - operator work at some point in the future before the "gold" release.

For reference, I think we're in the Pewter release right now. Maybe Tin.

Posted on 2004-07-27 02:16:55

Omni

Is it that hard to type "0 -" and not know what it means?

Posted on 2004-07-27 16:24:39

vecna

There isn't support for any unary operator integer processing right now. That's the primary reason why conditionals (if statements etc) use a separate construct than just resolving an int, because I don't have the stuff in place to support unary !. So, like Grue said, I mean to fix all that - primarily, I wanted to combine the if statements with the integer processing, so that &&, ||, > etc and ! will just be new math operators, and you'd be able to properly use nested IF groups as well. A pleasant side effect would be the unary operator support that would allow unary minus.

Posted on 2004-07-27 17:30:27 (last edited on 2004-07-27 17:31:39)

Zip

Wicked. But to be honest, very few of verge's quirks actually harm my productivity. The only thing that really slows me down in the uselessness of debug messages, as I'm rather prone to making silly mistakes and forgetting what I changed. To much time have I spent hunting through code and commenting stuff out for one forgotten }

Zip

Posted on 2004-07-27 18:36:04

Gayo

Hee hee. I remember some V2 VCC builds where they just said "an error has occurred" for any compiletime error.

Posted on 2004-07-27 22:23:42

Omni

You know, I recall both Winv2 and V2kj/V2.5 VCC both having very accurate line reporting on errors. Why is Verge3 so wacky?

Posted on 2004-07-29 02:02:59

RageCage

The newest build of v3 seems to do error reporting quite well in my opinion

Posted on 2004-07-29 19:08:40

Toen

Quote:Originally posted by Omni

You know, I recall both Winv2 and V2kj/V2.5 VCC both having very accurate line reporting on errors. Why is Verge3 so wacky?
I very seldom get unreasonably wonky line reporting, I dunno

Posted on 2004-07-30 00:38:51

Omni

Er...it's been a while since I got the latest WIP engine.

Posted on 2004-07-30 01:41:59


Displaying 1-20 of 22 total.
12 next
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.