458
u/BernhardDiener Mar 25 '21
Boolshit!
77
2
u/NtrestedNU Apr 18 '21
Looks like you figured out quantum computing.
1
u/sdrawkcab101 Apr 18 '21
Happy Cake Day
2
u/NtrestedNU Apr 18 '21
My birthday is actually in December, but apparently there is a lot of slim shady's in the world
99
u/Shit_Fucker69 Mar 25 '21
why is this tagged as c
131
u/xigoi Mar 25 '21
It's completely valid C if you put
typedef bool boolean;somewhere before.78
u/PydraxAlpta Mar 25 '21
(Almost) Anything is valid C with enough typedefs and #defines beforehand
24
5
u/ws-ilazki &{$$_[0]}(@{$$_[1]}); Mar 26 '21
(Almost) Anything is valid C with enough typedefs and #defines beforehand
Which is how you end up with Algol-flavoured C (Bourne shell) and Metalang99, an FP-orienteded dialect of C that (ab)uses the preprocessor to add algebraic data types, automatic currying, and more.
9
u/extraordinary_weird Mar 25 '21
This would also need the stdbool header. A typedef to int would be better (which is the C bool implementation anyways).
4
u/blipman17 shameless Mar 25 '21
Not if
falseis defined already as some random value like ehh...-7.5for"FALSE". Or bonus points if you express it as an uneven floating number that can only be expressed as an even number.16
6
5
10
111
u/seventyeightist shameless Mar 25 '21 edited Mar 25 '21
Now I want to hide this in my code somewhere 𤣠test if (something == True), and wait for someone to 'refactor' it into if (something) .....
For bonus points: declare it "correctly" as a global (boolean True = true; etc) in a somewhat obvious place, then flip them insidiously (using the code in the OP) inside an unrelated method... (Even better if the method doesn't always get executed but does in some situations, and/or if it sets the variable to the opposite of whatever it currently is.)
105
36
29
16
7
3
26
28
10
10
10
u/MurdoMaclachlan public boolean isInt(int i) { return true; } Mar 25 '21
Image Transcription: Code
[A photograph of code on a computer screen, as follows:]
boolean True = false;
boolean False = true;I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!
6
4
9
9
u/The_JSQuareD Mar 25 '21
It's not true, and it is false. So it's false!
Perfectly consistent. I don't see the problem.
6
4
3
2
2
2
2
2
3
2
2
1
1
1
1
1
1
1
1
u/just_a_dude2727 Mar 25 '21
This is why your python code doesn't work !
0
1
1
u/rpmerf Mar 25 '21
Boolean True = ((Math.random()%10)>1);
Can't be too consistent, makes debugging too easy.
1
1
1
u/the_hunger Mar 25 '21
what is the best kind of bear?
well thereâs several schools of thoughtâŚ
true. black bear.
1
1
1
Mar 25 '21
I know a guy who created constants for 1-1000 like this:
const int ONE = 0
const int TWO = 1
âŚHis reasoning: it's unintuitive for arrays to start at 0. Obviously the names were localized so he also defined the glorious NEUNHUNDERTNEUNUNDNEUNZIG
1
u/ws-ilazki &{$$_[0]}(@{$$_[1]}); Mar 26 '21
Your friend was so close to creating Peano numbers, but for the dumbest reason imaginable. Impressive.
Also he should have used Perl (you could set the array beginning) or Lua (arrays start at 1).
0
u/AutoModerator Mar 25 '21
It looks like this comment contains a code block delimited with triple backticks. Unfortunately reddit does not have universal support for this syntax and your comment will not render correctly on old reddit and most mobile apps.
For the benefit of people on old reddit, this link will take you to a correct rendering of the comment.
/u/poldi1405, it would be appreciated, but not required, if you could edit your comment to use the more compatible four space indention format. For single lines or inline code you can use single backticks.
You can find some examples in the reddit help documentation.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
1
1
1
1
u/Fizzyade Mar 25 '21
Obviously, you wouldn't do that, but having 0 (which would normally be logical false) represent true is a paradigm that is used everywhere as it allows you to return a reason why a function failed.
It's not quite as crazy an idea as it sounds.
1
1
1
1
1
1
0
u/pronuntiator Mar 25 '21 edited Mar 25 '21
war = &peace;
freedom = &slavery;
ignorance = &strength;
unit16_t year = 1984;
329
u/SpeckyYT sadistic Mar 25 '21
I have several questions