maris@lemmy.world to Programmer Humor@programming.dev · 4 days agoGambling with Lainlemmy.worldimagemessage-square33fedilinkarrow-up1350arrow-down111
arrow-up1339arrow-down1imageGambling with Lainlemmy.worldmaris@lemmy.world to Programmer Humor@programming.dev · 4 days agomessage-square33fedilink
minus-squarer00ty@kbin.lifelinkfedilinkarrow-up56·4 days agoMake 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.
minus-squaresp3ctr4l@lemmy.dbzer0.comlinkfedilinkEnglisharrow-up17·4 days agoThe equivalent of losing (part of) a finger on each success/failure, instead of totally evacuating the contents of your skull.
minus-squareChaoticNeutralCzech@feddit.orglinkfedilinkEnglisharrow-up12·3 days agoThe chance is actually 1 in 7 because both 0 and 6 are included in the randInt() range.
minus-squarer00ty@kbin.lifelinkfedilinkarrow-up5·3 days agoOh 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.
minus-squareshape_warrior_t@programming.devlinkfedilinkEnglisharrow-up1·3 days agoYou can get the exclusive behaviour with random.randrange. (Relevant Stack Overflow question with a somewhat interesting answer)
minus-squareChaoticNeutralCzech@feddit.orglinkfedilinkEnglisharrow-up1·3 days agoAny language… except MATLAB. Fuck MATLAB. (Their arrays even start at 1, what the fuck?!)
minus-squarewheezy@lemmy.mllinkfedilinkarrow-up2arrow-down1·edit-23 days agoLua starts at 1 too. It’s infuriating. I believe for the same historical reason Matlab does. Both meant for non CS people.
Make it a bit more fun.
1 in 6 chance to trigger the logic.
The logic?
The slow deterioration, and random issues appearing that are tough to diagnose would be more fun than such wanton destruction.
The equivalent of losing (part of) a finger on each success/failure, instead of totally evacuating the contents of your skull.
The chance is actually 1 in 7 because both 0 and 6 are included in the
randInt()
range.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.
You can get the exclusive behaviour with
random.randrange
. (Relevant Stack Overflow question with a somewhat interesting answer)Any language… except MATLAB. Fuck MATLAB.
(Their arrays even start at 1, what the fuck?!)
Lua starts at 1 too. It’s infuriating. I believe for the same historical reason Matlab does.
Both meant for non CS people.