— hitscanner apologist ⚡
— tired trans woman ⚧️☣
— not always grumpy, she just looks like that 💀
— level/environment designer 🔨
— Current work: Skin Deep (at Blendo Games) 🐈

📍 Adelaide, Australia

Private page (for friends): @garbagegrenade


Me: hey why are all these projectiles ending up slightly lower than they should be?

The interpreter for the id tech 4 map scripting system: oh, well it's because

-spread + 2 * sys.random(spread)

is actually equivalent to

-1 * (spread + 2 * sys.random(spread))

Me: oh, okay

Me: hey, wait a fucking minute


You must log in to comment.

in reply to @trashbang's post:

I'm morbidly curious why they decided to have the precedence of the unary minus operator so low.

It's been a while since I've last thought about parsers, but is there some way this simplifies implementation of parsing mixed unary & inline binary operator expresssions? It feels like it shouldn't.

I learned just enough about parsers to pass the unit and haven't really thought about them since, I'm afraid.

I wouldn't put too much stock in there being a well-considered decision behind it. This language has a lot of quirks.

I am reminded of the time I caught a bug in my studio's prototype game where mouse deltas were being calculated as

Position =+ mouseMovement

Instead of

Position += mouseMovement

Unary plus might be one of the most cursed operators. Just hiding there waiting to ruin someone's day.