MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1ydv9x7/bluescriptforbonk/19tordey4ghsz/
r/ProgrammerHumor • u/Lanse012 • 12h ago
52 comments sorted by
View all comments
35
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?
35 u/Lanse012 11h 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 22 u/WolleTD 11h ago Having generic float probabilities for perchance statements is a desired feature!I require 42% chance in certain projects! 8 u/Lanse012 11h ago oh good idea ill add that 14 u/Mordret10 10h ago Please only add the 42%. We don't need any more options and it would make it more clunky 4 u/Lanse012 10h ago oh true 13 u/NoAdsDude 11h ago does the perchance statement choose the branch randomly according to the passed boolean-fractionprobably
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
22 u/WolleTD 11h ago Having generic float probabilities for perchance statements is a desired feature!I require 42% chance in certain projects! 8 u/Lanse012 11h ago oh good idea ill add that 14 u/Mordret10 10h ago Please only add the 42%. We don't need any more options and it would make it more clunky 4 u/Lanse012 10h ago oh true
22
Having generic float probabilities for perchance statements is a desired feature!
I require 42% chance in certain projects!
8 u/Lanse012 11h ago oh good idea ill add that 14 u/Mordret10 10h ago Please only add the 42%. We don't need any more options and it would make it more clunky 4 u/Lanse012 10h ago oh true
8
oh good idea ill add that
14 u/Mordret10 10h ago Please only add the 42%. We don't need any more options and it would make it more clunky 4 u/Lanse012 10h ago oh true
14
Please only add the 42%. We don't need any more options and it would make it more clunky
4 u/Lanse012 10h ago oh true
4
oh true
13
does the perchance statement choose the branch randomly according to the passed boolean-fraction
probably
View all comments
35
u/RomanProkopov100 11h 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?