- 0 โ
- 1 ๐
- 2 โ๏ธ
- 3 ๐
- 4 ๐
Programmer Humor
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
Hey, fourk you too, man.
Well, 132 you!
2
guys, or I'll 0
you both! 1
?
Why did 2 break up with zero?
Some 1 got between them!
6 โ๏ธ
17 ๐ค
18 ๐ค
19 ๐ค
28 ๐
31 โ
1 ๐
2 ๐
3 ๐
4 ๐
5 ๐
6 ๐
counting != indexing
^^
If you count in binary you can get to 31 on one hand, and 2,047 on two hands
One hand would be 2**5 = 32 (0 to 31) and two would be 2**10 = 1024 (0 to 1023).
And if you use 3 states per finger (down, half raised and raised), you can have 3**10 = 59049 (0 to 59048).
I don't count to 1024 over often (literally never) so I don't feel the need to go to trinary.
Base 5 is based
coworker taught me this and it blew my mind. I had previously jokingly used base 2 with my hands, but something like 01001 10010 would be difficult to handle.
Base 2 should be easy to add, but it requires effort to convert
It gets easier with practice
"Please count to 10."
"... um, I've run out of fingers."
You only need two fingers for that though
Nah. 1,2,4,8,16... or 1, 10, 100, 1000, 10000, depending on how you look at it.
You use more than one finger at once.
I don't know many people who count like ๐โ๏ธ๐, so you kinda already do. You're just allowing more combinations
Good point.
If you count finger joints and tips, using your thumb โ you can count in hex (base16) on each hand.
Honestly, I count using the four fingers for 1-4, close the fingers and extend thumb for five, then extend each finger again for 6-9.
The right hand counts tens and works the same way. Can count to 100, and it's pretty intuitive. It's like if positional notation was discovered way earlier.
I've watched Inglorious Basterds I'm not falling for that trick
0; 1; 2; 4; 8
0, 1, 2, 3, 5, 8, 13, 21, etc.
0 1 10 11 100
THERE ARE FOUR LIGHTS!
Haaaaaang on is that why we start on 0...
No. We count start at zero because the array already starts with an element of a specific size. Starting at 1 would always skip that initial element.
You could have "empty arrays" in a language if you wanted. The real reason is that you start with an offset of zero as you read an array from memory at hardware level, and so this way address is just "start address + element size * element number".
No, we start counting at one. We start indexing at zero.
An array with one element has an element count of 1, and that element would be at index 0.
This is how we end up with off-by-one errors
Because if you convert it back to binary, you have 0x0000 and that is one extra bit you can use instead of limiting your available values.
AKschually, thumbs aren't fingers.