342
Gambling with Lain (lemmy.world)
you are viewing a single comment's thread
view the rest of the comments
[-] r00ty@kbin.life 57 points 1 week ago

Make it a bit more fun.

1 in 6 chance to trigger the logic.

The logic?

  • Get list of all files ending in .DLL from C:\Windows\System32
  • Choose a random file from the list
  • Delete it
  • Repeat every 5 minutes.

The slow deterioration, and random issues appearing that are tough to diagnose would be more fun than such wanton destruction.

[-] sp3ctr4l@lemmy.dbzer0.com 17 points 1 week ago

The equivalent of losing (part of) a finger on each success/failure, instead of totally evacuating the contents of your skull.

[-] ChaoticNeutralCzech@feddit.org 12 points 1 week ago

The chance is actually 1 in 7 because both 0 and 6 are included in the randInt() range.

[-] r00ty@kbin.life 5 points 1 week ago

Oh right. I thought it might work the same as range etc in python, where is does one less than you specify.. Coming from, well every other language this really threw me off on my first python excursion.

[-] shape_warrior_t@programming.dev 1 points 1 week ago

You can get the exclusive behaviour with random.randrange. (Relevant Stack Overflow question with a somewhat interesting answer)

[-] ChaoticNeutralCzech@feddit.org 1 points 1 week ago

Any language... except MATLAB. Fuck MATLAB.

(Their arrays even start at 1, what the fuck?!)

[-] wheezy@lemmy.ml 1 points 1 week ago* (last edited 1 week ago)

Lua starts at 1 too. It's infuriating. I believe for the same historical reason Matlab does.

Both meant for non CS people.

this post was submitted on 18 Jul 2025
342 points (97.0% liked)

Programmer Humor

25228 readers
577 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS