this post was submitted on 08 Feb 2026
26 points (100.0% liked)

Programming Horror

2301 readers
4 users here now

Welcome to Programming Horror!

This is a place to share strange or terrible code you come across.

For more general memes about programming there's also Programmer Humor.

Looking for mods. If youre interested in moderating the community feel free to dm @Ategon@programming.dev

Rules

Credits

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] theit8514@lemmy.world 2 points 3 days ago (1 children)

Technically Zero is 0-0 since One hasn't been set to anything yet.

[–] over_clox@lemmy.world 3 points 3 days ago (1 children)

Indeed. But...

If One was defined as random garbage, then still...

Zero=One-One

See my definition of One afterwards, it's a bit awkward, but works..

[–] ignirtoq@feddit.online 2 points 3 days ago (1 children)

I'm not super familiar with BASIC. Can you explain how the definition of One works? If variables have random values when declared but not set due to memory garbage, I would expect ZeroBit to be "true" half the time and "false" the other half. When it's false, I can reason through it, but when it's true I don't see it. I imagine it has something to do with the details of ABS()?

[–] over_clox@lemmy.world 2 points 3 days ago* (last edited 3 days ago)

Different BASIC dialects work differently, you're absolutely right to ask.

Honestly, the ZeroBit code part is the hack within Mobile Basic, it always returns Zero, meaning the ABS(NOT(ZeroBit)) will always return One