MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1ydv9x7/bluescriptforbonk/19tordey4ghsz/
r/ProgrammerHumor • u/Lanse012 • 18h ago
60 comments sorted by
View all comments
39
If unlikely is a constant which is both boolean (used in a perchance statement) and float (defined as a fraction), does the perchance statement choose the branch randomly according to the passed boolean-fraction?
38 u/Lanse012 18h ago oh no that definition was more to show its a 5% chance, its just a boolean not a floatprobably is only 95% chancemaybe is only 50% chance 29 u/WolleTD 18h ago Having generic float probabilities for perchance statements is a desired feature!I require 42% chance in certain projects! 12 u/Lanse012 17h ago oh good idea ill add that 20 u/Mordret10 17h ago Please only add the 42%. We don't need any more options and it would make it more clunky 6 u/Lanse012 16h ago oh true 1 u/Snudget 5h ago If the float is > 1, it behaves like a for loop. And if it's < 0? It, sends all your RAM to Sam Altman 14 u/NoAdsDude 18h ago does the perchance statement choose the branch randomly according to the passed boolean-fractionprobably
38
oh no that definition was more to show its a 5% chance, its just a boolean not a float
probably is only 95% chance
maybe is only 50% chance
29 u/WolleTD 18h ago Having generic float probabilities for perchance statements is a desired feature!I require 42% chance in certain projects! 12 u/Lanse012 17h ago oh good idea ill add that 20 u/Mordret10 17h ago Please only add the 42%. We don't need any more options and it would make it more clunky 6 u/Lanse012 16h ago oh true 1 u/Snudget 5h ago If the float is > 1, it behaves like a for loop. And if it's < 0? It, sends all your RAM to Sam Altman
29
Having generic float probabilities for perchance statements is a desired feature!
I require 42% chance in certain projects!
12 u/Lanse012 17h ago oh good idea ill add that 20 u/Mordret10 17h ago Please only add the 42%. We don't need any more options and it would make it more clunky 6 u/Lanse012 16h ago oh true 1 u/Snudget 5h ago If the float is > 1, it behaves like a for loop. And if it's < 0? It, sends all your RAM to Sam Altman
12
oh good idea ill add that
20 u/Mordret10 17h ago Please only add the 42%. We don't need any more options and it would make it more clunky 6 u/Lanse012 16h ago oh true
20
Please only add the 42%. We don't need any more options and it would make it more clunky
6 u/Lanse012 16h ago oh true
6
oh true
1
If the float is > 1, it behaves like a for loop. And if it's < 0? It, sends all your RAM to Sam Altman
14
does the perchance statement choose the branch randomly according to the passed boolean-fraction
probably
View all comments
39
u/RomanProkopov100 18h ago
If unlikely is a constant which is both boolean (used in a perchance statement) and float (defined as a fraction), does the perchance statement choose the branch randomly according to the passed boolean-fraction?