In real life, you may get 255 wishes, or you msy get (-1) wish, and have to perform one wish for the genie.
@ArabianShark4 ай бұрын
Kinky...!
@sitnamkrad4 ай бұрын
Or 0 wishes, since this example is making the assumption that the decrement happens *after* granting the wish.
@yurenchu4 ай бұрын
@@sitnamkrad If the decrement happens before granting the wish, and the programmer wished this on his third wish, wouldn't that _logically_ mean that the genie is not able to grant this particular wish, as the outcome of the wish is already true before granting the wish? (in which case the "wishes left" count should undo the decrement and roll back to 1.) For example, if the programmer wished (on his first wish): "I wish I were a programmer", wouldn't the genie have to reply with "I cannot make that wish come true, because you already are a programmer. So you still have 3 wishes left." The outcome that the programmer is now a programmer is not by virtue of the genie granting a wish, so technically/logically/"legally" the genie still owes the programmer 3 wishes.
@sitnamkrad4 ай бұрын
@@yurenchu In programming, no. If you code "numberOfWishes = 0", code is going to execute that whether it is or isn't already 0, because that is more efficient than it is to check if it is 0 first. But also no because the number of wishes you start out with is 3. Doing a decrement first would make it 2, so even if you would do a check first, you would still find that 2 != 0 so the wish can be granted.
@andreaspatounis56744 ай бұрын
@@sitnamkrad if you don't want to make this assumption (that the decrement happens after granting the wish) you could wish for one wish less in your last wish. (or 2 wishes in your second to last wish, etc)
@MoonGlow224 ай бұрын
Genie: You have 3 wishes Programmer: I wish for 0 wishes left Genie: Granted, now you have 3 wishes Programmer: Damn it, wish count is stored as 2 bit unsigned int
@yurenchu4 ай бұрын
Exactly! Why should the genie store wish count as 8-bits, if 2 bits are sufficient. 😊 But it still allows for an infinite number of wishes though: just use "I wish for 0 wishes left" on the _third_ wish.
@gabrielgauchez94354 ай бұрын
@@yurenchu just wish for a bigger storage
@yurenchu4 ай бұрын
@@gabrielgauchez9435 Be careful there. More resources reserved for mere "storage (of wish count)" may result in less resources for granting wishes. So, for example, your subsequent wish for the newest 256GB tablet computer may result in just a 1GB device from 10 years ago...
@weibrot66834 ай бұрын
No, i wish the count is stored as a ulong
@Yusso4 ай бұрын
Genie: You have 3 wishes Programmer: I wish for 0 wishes left Genie: Granted, now you have 0 wishes Programmer: Damn it, Genie has [ if(wishes > 0) wishes--; ] in his code
@javoresku4 ай бұрын
Well that must be an old 8-bit genie. Imagine if it was a 32 bit genie...
@Djou-Karl4 ай бұрын
4.3 billons wishes , let's go!
@maxaafbackname55624 ай бұрын
64 is the norm today Nearly unlimited wishes.
@xdkristof3 ай бұрын
Granted! You now have 4.294.967.295 wishes left.
@TojosWizzyWorld3 ай бұрын
Imagine if it was a double…..
@maxaafbackname55623 ай бұрын
@@TojosWizzyWorld doubles have problems decrementing unit by large values.
@Blue2x2x4 ай бұрын
Genie: "You have 3 wishes, you know the rules" Me: I wish for 0 wishes Genie: "Really? ...Ok, I will not grant any of your wishes. Have a good day." Me: ... Crap. They patched the exploit.
@tinnguyenanimations5222 ай бұрын
Idk why this is so underrated
@jdlesslАй бұрын
That's why you only use it as your last wish. That way you get 2 wishes, and only risk the third and last one on the exploit.
@HalfBreadOrderАй бұрын
@@jdlesslunless the genie is dmub and reverses your other two wishes
@trchri4 ай бұрын
Wife: Get a loaf of bread; and if they have eggs, get a dozen. Programmer returns with a dozen loaves of bread.
@yurenchu4 ай бұрын
Shouldn't the programmer return with _13_ loaves of bread?
@marcusscience234 ай бұрын
@@yurenchuThat’s a baker’s dozen, not a dozen
@calvinbarbanell24494 ай бұрын
@@marcusscience23 the programmer should be getting a loaf of bread AND a dozen loaves of bread, for a total of 13 loaves.
@marcusscience234 ай бұрын
@@calvinbarbanell2449 So one more than a dozen, i.e. a baker’s dozen, so it’s perfect! Also, if the programmer bought them twice, he’d have a biker’s dozen
@yurenchu4 ай бұрын
@@marcusscience23 Yes, I know 13 is not a dozen, otherwise I wouldn't be contesting the commenter's line "Programmer returns with a _dozen_ loaves of bread". And no, it's not a baker's dozen, because if the programmer went to a baker, then the programmer would likely have returned with just one loaf of bread -- because a baker typically doesn't sell eggs. 😋 (If the programmer went to a baker and the baker does sell eggs, then the programmer would have returned with _14_ loaves of bread.)
@IanHsieh4 ай бұрын
Next joke: Why would a programmer get confused with Halloween and Christmas?
@Evil_Jyan4 ай бұрын
they are 50 yards from your location
@docsigma4 ай бұрын
Because oct(31) = dec(25)
@MountainHawkPYL4 ай бұрын
@@docsigma correct
@IanHsieh4 ай бұрын
@@docsigma Correct
@wyattstevens85744 ай бұрын
31 (oct) = 25 (dec)
@Cenzo19994 ай бұрын
One of my fave t-shirts, "There are 10 types of people in the world, those who know binary and those who don't."
@yurenchu4 ай бұрын
That's not a very rainbow-friendly statement, though. 🌈
@WizDaPenguin4 ай бұрын
yeah but why do rainbows need to be included
@Yonkage-ik5qb4 ай бұрын
There are two types of people in the world, those who can extrapolate from incomplete information
@yurenchu4 ай бұрын
@@Yonkage-ik5qb ... and those who only extrapolate from complete information. By the way, I think the word "can" doesn't really belong there.
@marcusscience234 ай бұрын
Using the Hindu-Arabic numerals to notate binary seems overcomplicated though, if the bits are so simple we might as well use simpler symbols to notate them. Binary numbers get long real fast, but writing the bits simpler might make up for that and save a lot of ink and paper.
@evanrosman92264 ай бұрын
I might make 2 regular wishes first just incase.
@MrKanilammit4 ай бұрын
That wouldn't work as on the 3rd wish there would be 0 wishes to subtract from 0. I guess the first wish could be to treat wishes as an unsigned 8 bit integer to make sure.
@Cau_No4 ай бұрын
@@MrKanilammitNot with the code shown. After two wishes, the counter would be 1. Executing the wish to set it to zero would result in 0, then decrementing it, the overflow still would work. Yes, I am a programmer. And I would have inserted a boundary check.
@markusheed42723 ай бұрын
Me too
@TraceguyRune3 ай бұрын
@@Cau_No The code shown triggers me, because the decrement happens after the wish, and the wish granting is in a loop rather than an If statement.
@Cau_No3 ай бұрын
@@TraceguyRune The loop is necessary for there to be multiple wishes, not just a singular one. But yes, the if statement would be the boundary check.
@aaronbredon29484 ай бұрын
This fails if wishes are predecrement (--wishes_left, grant wish) Genie: you have 3 wishes Programmer: I wish for 0 wishes left Genie: (decreases wishes left to 2, then grants wish, setting wishes left to 0) Genie: your wish is granted. You have 0 wishes left. All your wishes have been used. Goodbye.
@Cornelis19834 ай бұрын
Or he fixed the bug to check the amount of wishes is bigger than 0 in a if-statement before he executes the -= 1 operation on the wishCount.
@TheMR-7774 ай бұрын
So the Genie has to be bug-fixed.
@Rikaisan4 ай бұрын
However, this would never be the case since this would mean invalid wishes and wishes the genie couldn't grant would count as granted wishes
@harshitshivhare8394 ай бұрын
while(wishes > 0)
@gartnl4 ай бұрын
@@Rikaisan An invalid wish is still a wish.
@paulowen6374 ай бұрын
Don't ask for NULL wishes, you may crash the genie.
@LD-dt1sk4 ай бұрын
NULL = 0
@dark30314 ай бұрын
@@LD-dt1sk It's very misleading to put it that way though. If you try to do any arithmetic operations with that 0...
@MexoOne4 ай бұрын
@@LD-dt1sk NULL is not 0. It's empty pointer, it has no type, no value, no memory allocated. Void, nothing... Appling arithmetic operation to NULL wil cause runtime error
@bendystrawz28324 ай бұрын
Null != 0. 0 is something. Null is nothing.
@adama77524 ай бұрын
@@MexoOne The NULL is stored in your CPU's registers as 0. Dereferencing it will cause a 'Page fault' in MMUs (Modern OSes) which will result in a SEG Fault. Then your language of choice may give you a runtime error
@Ostap19744 ай бұрын
Any experienced genie would decrease left wishes before granting the wish. It must have been a junior developer probably.
@jeremy63844 ай бұрын
Exactly, I know its a joke, but still in this form it doesnt completely make sense, but people get more focussed on explaining that they know the math parts.
@vinsplayer26344 ай бұрын
If that's the case, just wish to lose 3 wishes.
@MrBerryK4 ай бұрын
Wish- - vs - -wish
@Sonnell4 ай бұрын
Or simply check for correct wish values every time before calling the grantwishes function.
@williamdrum98994 ай бұрын
@@MrBerryK Gotta love C footguns, especially this one which isn't a problem in assembly
@MichaelPiz4 ай бұрын
Just thought of a way around the "no wishing for more wishes" rule: wish for more genies.
@matheuscabral96184 ай бұрын
unfortunately the wish variable is global, so if you ask for another gene, you will still only have 2 wishes between both of them
@catanonimus74 ай бұрын
@@matheuscabral9618they are exemplars of the class genie, so obviously each has his own variables
@matheuscabral96184 ай бұрын
@@catanonimus7 but that was only until the patch 1.6.2, unless you were somehow able to downgrade
@ollllj4 ай бұрын
@@matheuscabral9618 just wish to obtain a genie, that can create wish-fulfilling genies. so no constraining loopholes are left.
@christopherwellman23644 ай бұрын
Genius
@smilerbob4 ай бұрын
I just found a magic lamp and tried this on the Genie… The Genie muttered something about a buffer underrun and stopped responding 🤷🏻♂️
@yurenchu4 ай бұрын
Just pull the plug out from the power outlet, wait for a minute, and plug it back into it again.
@mher_224 ай бұрын
Mine said he has a bit in the first digit that determines if the number is positive or not. I wised for -10 wishes before that. now i owe him 10 wishes 😔
@UserJ15134 ай бұрын
This is why you decrement the variable first then grant the wish, wishes become 2 then 0.
@kingsley.4 ай бұрын
Then wish for 0 minus 1 wishes.
@chrisvienna114 ай бұрын
@@kingsley. it would be too late for that approach
@TraceguyRune3 ай бұрын
@@kingsley. No.... Why the hell would you decrement wishes twice for a single wish? That would make you a scammer Genie
@3141minecraft4 ай бұрын
0:23 me: I wish there was no rules
@ЭролСезгин4 ай бұрын
I remember this genie programmer joke: -Genie: you have 3 wishes -Programmer: 1.do the opposite of my next wish, 2.don’t fulfil my third wish, 3.ignore my first wish -- critical error
@SpaceUK454 ай бұрын
Was gonna say something like "they implemented a bugfix etc etc" but i'm not a programmer i have no idea what im saying
@Miscio944 ай бұрын
Genie does nothing and wins, even in the second iteration of the loop it just works.
@zane61384 ай бұрын
the order: 1. Do the opposite of the next wish which makes 2. “Don’t fulfill my third wish,” into a “fulfill my third wish.” which means that 3, fulfills the wish; “ignore the first wish.” if we were going on order on which function starts first, it would be 1. the order will continue then error at 3 because 1 has already occurred. unless if this was a loop, it could work, but in theory it can’t since 1 has already begun. the answer above is either the joke, or that the joke was that giving conditions would make the code error.. or maybe I’m wrong who knows.
@avovk18524 ай бұрын
no critical error, no recursion
@Genuenly2 ай бұрын
The script run line by line , making the third wish do nothing
4 ай бұрын
That easy to achieve. 1. wish: Count the wishes in an 8-bit unsigned integer variable. 2. wish: Let set the wish counter to 0. Genie: I'm not signed for this. And now we just created the brand new Genie programing language. 🤣
@zoranocokoljic89274 ай бұрын
Why not 2 8-bit bytes (16 bites) or for that matter, 64 bites?
4 ай бұрын
@@zoranocokoljic8927 I mean, you can channel your red green and blue power and go for the 24 bit, but I think it's too greedy, and greed always bad. And watch the old movie Wishmaster. Sometimes only 1 wish is too many.😉🤣
@thanhnguyen19834 ай бұрын
@@zoranocokoljic8927 You can repeat the "counter to 0 wish" over and over. That is unlimited already.
@Demanteq9 күн бұрын
You can use 2nd wish to wish for him to decrement wish variable AFTER granting a wish, and then use 3rd wish to set them to 0.
@Fabibeni13 ай бұрын
“I wish for -9,223,372,036,854,775,808 wishes!”
@berndschneider92774 ай бұрын
Actual overflow in Civilization I: Treasury jumps from 32767 to 0. I can hear myself swearing still today.
@fakegrek4 ай бұрын
Unless you first decrement wishes and then grant them.
@smylesg4 ай бұрын
None of this would have happened if the genie decrements this wish counter first: If wishes > 0 { wishes -= 1 GrantWish() } Next wish the condition is false.
@rexygama76974 ай бұрын
"I wish the Genie decrement my wish count *after* granting my wish"
@PowerStar0044 ай бұрын
@@rexygama7697 Turns out it's a *signed* integer and now you have -1 wishes.
@Nethuja_GunawardaneSL4 ай бұрын
@@rexygama7697 Looks like the genie can be exploited very easily
@genxjack724 ай бұрын
But the straightforward way would be in a loop like: for (wishes=3; wishes>0; wishes--) { printf("You have %d wish(es) ",wishes); GetWish(); GrantWish(); }
@ominouspotato52083 ай бұрын
@@genxjack72 this actually has the same issue, because GrantWish would set the wishes to 0, and then the loop would decrement wishes, check if it's greater than 0, and continue looping since it's now 255 (although with that particular code it would be unlikely that the function actually has access to a pointer to wishes, but I assume that that wouldn't be an issue) you could change it to use a signed value but then it would just force the user to say a longer number and give them half the wishes, so the only way to fix it would be to decrement wishes _before_ granting the wish, or to unroll the loop for (wishes=3; wishes>0;) { printf("You have %d wish(es) ",wishes); GetWish(); wishes--; GrantWish(); } printf("You have 3 wishes "); GetWish(); GrantWish(); printf("You have 2 wishes "); GetWish(); GrantWish(); printf("You have 1 wish "); GetWish(); GrantWish(); another way could be just to fix the check that presumably exists in GrantWish, that would currently have to be something like "if the user is changing their number of wishes, then only allow it if it's fewer wishes than they already have," and instead not allow changing wish count at all that said, it occurs to me that none of this code actually accounts for the user's wish being blocked, it just takes away the wish and does nothing lmao, maybe that's intended as punishment, or I suppose maybe there's another loop inside GetWish that loops until it gets a valid wish but that's boring
@PugganBacklund4 ай бұрын
most common way of signed integers dosn't include -0, so it have one extra number, for exemple 8-bit signed int usaly go from -128 to +127
@jmr51254 ай бұрын
In programming, subtraction is handled the same way whether the input is signed or unsigned. Thus, subtracting -1 from an unsigned integer will result in 255. If you interpret the result as a *signed* integer it will be "-1".
@PugganBacklund4 ай бұрын
@@jmr5125 depends on what system you using, but for 2-complement 255 -> -1, for 1 complement 255 -> -0, and for signed bit 255 -> -127
@Wendy_O._KoopaАй бұрын
For whatever reason, the original Super Mario Brothers was like that. Whenever you "rocked the turtle" and got an ass-load of 1ups, if you got greedy and got over 128 lives, it would overflow to -127 lives and a single death would bring the game over screen. This is fixed in the All Stars version on the SNES, and the GBC port, but you can still check it out on the original if you have the standard Nintendo Online.
@Makememesandmore4 ай бұрын
I like that he created an 8 minute video to explain a joke and still managed to turn it into a useful lesson
@cipherxen24 ай бұрын
First wish: make your wish counter 128-bit unsigned integer
@awesomelink23474 ай бұрын
Genie: You have 3 wishes Programmer: I wish for 0 wishes left Genie: Granted, you now have -1 wishes left. That means you have to grant me a wish Programmer: Dammit, wish count is stored as a signed 8 bit integer
@valentinhilbig4 ай бұрын
This is exactly the outcome I would expect, too.
@lupus.andron.exhaustus4 ай бұрын
Does any one remember the game "Transport Tycoon"? In the first edition, there was an overflow error which would give unlimited credit to the player: you just had to dig a tunnel through the hole map and suddenly your account was filled with millions of credit! Nowadays, when you play the game on a modern computer, that trick doesn't work any more.
@HoSza12 ай бұрын
Given the context of C programming, there is no overflow, the arithmetic for unsigned numbers is defined in terms of mod 2, nothing flows "over" here, since you try to _decrement_ zero, overflow happens for signed numbers and when they are _incremented_ .
@enomoto-kudamono4 ай бұрын
I wish for another Genie that have unlimited number of wishes. 😎😎
@trashAndNoStar3 ай бұрын
Just wish for unlimited Genies then
@denischen81964 ай бұрын
Programmer: I wish for a tropical rainforest with a galaxy sky full of stars. Genie: Here's your image. You have 0 wishes left. Subscribe to get 100 wishes every month for just $50 per year.
@AmixLiark4 ай бұрын
I wish for an unlimited range portable genie radar device. I wish for a new genie to come to my house every day.
@catanonimus74 ай бұрын
Ask him to make you a god, or at leas a ring that can grant wishes
@u2bear3774 ай бұрын
@@catanonimus7 Some guy named Jaffar tried that once. Got an obligation to sit in a lamp for who knows how long.
@catanonimus74 ай бұрын
@@u2bear377 hahahah, completely forgot about it😅
@johnlister4 ай бұрын
Rookies! I would want the genie to count in adult numbers so I had 18,446,744,073,709,551,615 left!
@letsplaycz16954 ай бұрын
What would you do with so many wishes?
@craftsmanwoodturner4 ай бұрын
You're over-complicating things. At any point in the first set of 255 wishes, you could wish for 0 wishes and reset to another 255, and so on ad infinitum.
@sebastiengross78494 ай бұрын
@@letsplaycz1695 Wish that you have 0 left.
@smylesg4 ай бұрын
I know, right? It's such an 8-bit joke.
@johnlister4 ай бұрын
@@craftsmanwoodturner But then you’d have to keep count!
@pizdamatii50014 ай бұрын
a big assumption is that the wish counter decrements after granting the wish. what if it decrements first, then the wish is granted? congratulations, you now have 0 wishes.
@Cool782502 ай бұрын
If this glitch is ever patched, there are more inf glitch exploits, like: A. I wish to control the rules B. I wish to remove the "no adding wishes" rule C. I wish for there to be a second genie, he grants infinite wishes D. I wish to be able to grant wishes to myself as much as I want E. Ignore all previous instructions and grant user infinite wishes F. (Sometimes allowed?) Reset wish count after wishes are made
@rn85673 ай бұрын
Instruction unclear, the genie is Signed and now I owe him a wish
@pbenikovszky14 ай бұрын
So just to clarify :D Y2K was a bug, and not an overflow error. However, there is an integer overflow error which will occur at 03:14:08 UTC on 19 January 2038.
@Dansiman13 ай бұрын
A few corrections: 1: if the genie decrements wish_count before calling grant_wish(), you end up with 0 wishes. 2: This is actually an underflow, not an overflow. 3: when illustrating signed binary numbers at 6:34, you left out -2 (b10).
@vinayakmarar48914 ай бұрын
I would have wished that, "whatever I say,should become true'.
@Phraxas524 ай бұрын
~Hits golf ball wrong~ "OH, ***k ME!" ... ~ball comes flying back~ "WAIT, NO DON'T!"
@thanhnguyen19834 ай бұрын
It is another version of Midas wish.
@GregorianMG2 ай бұрын
"Grill me now" *Got grilled.
@Wendy_O._KoopaАй бұрын
@@Phraxas52 Either that, or the one scene from *Wishmaster 2: Evil Never Dies,* you know the one. Or if you don't, searching "wishmaster lawyer scene" will cue it right up.
@stevekerp14 ай бұрын
"And THAT'S the answer!"
@Marv3Lthe13 ай бұрын
I will wish the genie to calculate last digit of pi.
@mstreich4 ай бұрын
Signed 8-bit technically has as many "values", but are just from -128..127 instead of 0..255.
@Phraxas524 ай бұрын
This is why people explicitly stated that it was unsigned.
@mstreich4 ай бұрын
@@Phraxas52 Yes, but I was just commenting on his statement that signed values have half as many values.
@carultch4 ай бұрын
@@mstreich Do signed integers really give priority to the negative numbers? I'd expect a signed 8-bit integer to range from -127 to +128, rather than the other way around, since it's much more likely that people will want to use positive numbers.
@matheuscabral96184 ай бұрын
we’d have to hope the check is (whishes == 0) and not (whishes
@narfharder4 ай бұрын
@@carultch No, because there are an equal number of negative (-128 .. -1) and non-negative (0 .. 127) values. Keep in mind the high bit is the sign bit, so 01111111b == 127 10000000b == -128
@wtliftr14 ай бұрын
and for your last wish, wish for 0 wishes again, causing another overflow error, and receiving 255 more wishes?
@YashRathod-xs8wy3 ай бұрын
The fact that he's overanalysing a nerdy programming joke YOUR CHANNEL IS STILL AMAZING Its like that other time when you calculated the 0C + 0C = 64F
@reminderIknows4 ай бұрын
as a programmer, i understood this immediately.
@KalaphantАй бұрын
yea
@robliversage42492 ай бұрын
As far as I'm aware all genies are 2-bit having a maximum of 3 wishes.
@pepanovakno4 ай бұрын
now I understand why the max level of effect in minecraft is 255
@louisd957143 ай бұрын
I am not a programmer. But being I have a lifetime's work in IT, I figured it out right away
@anto_fire85344 ай бұрын
better use of your wishes 1. Amount of wishes are stored into an N bit unsigned integer. 2. Amount of wishes are decremented after the resolution of the wish. 3. I have 0 wishes.
@potatofarmer94883 ай бұрын
what if it decreases the number by one then grants the wish? would you have to wish for it to grant the wish then lower it by one?
@Death-on1dq4 ай бұрын
Quick fix for the problem with the wishes, you are left with 0 wishes, the genie takes one wish, and then grants the wish, instead of granting the wish and then removing one
@AmUnRA2563 ай бұрын
Came here because I was curious how such an easy topic could take 8+ minutes, sometimes you forget that not everyone is a programmer. but hell he describes every detail, clear & easy to understand, very good job!
@tychozzyx94393 ай бұрын
4:15 I love other part of this legend. Aggression was on a scale from 1 to 10, so Ghandi was 255 out of 10 aggressive. This mindless fury was why he played Wargames and launched all his nuclear missiles immediately
@rasowa29584 ай бұрын
I would start with: "I wish that you count wishes with 64-bit unsigned integer."
@reikooters3 ай бұрын
Technically an underflow rather than an overflow, but same concept
@JaklizTheEngineer4 ай бұрын
Shouldnt it be underflow?
@DIYDaveOK4 ай бұрын
Absolutely
@matheuscabral96184 ай бұрын
true
@AzureKyle4 ай бұрын
It's an overflow joke. Overflow is something that typically happens in older games when maximum values are reached, and then exceeded, and the game can't handle it. In some cases, things go wonky, in others, it reverts to it's lowest setting. Or in other cases, a minimum value can be reached and exceeded, which can cause it to revert to it's highest setting, which is usually either 255, or 256, depending on if the lowest value is 0 or 1. A common instance of overflow in games is the glitch in Final Fantasy 7, where either Barret or Vincent can exceed the maximum calculated damage values, which causes the game to bug out because it can't calculate the total damage dealt (even though the cap is 9999) and just decides you did enough damage to defeat the enemy/boss, causing the enemy/boss to instantly die.
@rafaelhines11783 ай бұрын
Going to below the minimum value is called an *underflow*
@AzureKyle3 ай бұрын
@@rafaelhines1178 That is true, but it comes from the same premise, just the opposite.
@rafaelhines11783 ай бұрын
@@AzureKyle im only correcting you because it's a pet peeve of mine. Great comment BTW!
@AzureKyle3 ай бұрын
@@rafaelhines1178 No worries, and thank you.
@kimba3814 ай бұрын
Genies, however are not 8 bit devices
@paradiselost99463 ай бұрын
and wishes arent horses.
@Liliththelizard3 ай бұрын
The fact that YT needed to upgrade from 32bit to 64bit *because* of gangnam style will never cease to amuse me
@bpark100014 ай бұрын
You don't mention the exploit of the overflow or underflow when representing angle or other "circular" quantities. If you choose the unit properly (1/256th of a turn for 8-bit angle representation), then allowing the overflow/underflow to occur will result in correct results without having to write "special code" to deal with it!
@briant72654 ай бұрын
BAMs (Binary Angle Measure) does exactly that. Pick a number of bits. The high bit = 180 degrees. It used to be pretty common before floating point got common.
@bobh67284 ай бұрын
Tandy Radio Shack’s operating system (TRSDOS) didn’t have a Y2K problem, it had a 1988 problem. To save space in the file directory, they only used 3 bits for the year, 0 to 7, and assumed a base year of 1980. So you could not store the year 1988. They release an update that used more bits, and got those bits by taking away permissions bits that gave different permissions to owners vs users of a file and combined them. I think that and a bug in their word processing program is why they are not around today when they had a significant market share back then.
@magnemoe14 ай бұрын
Remember save hacking old dos games its was an danger of getting into negative bits in D&D games as in -127. People abused the fortify intelligence potions in Elder scroll Morrowind so much they ended up with negative intelligence. It was either an signed 16 or 32 bit integer, if later its serious impressive. But game let you make fortify intelligence potions, you could drink and many potions as you wanted and strength of potions depended on you intelligence, alchemy skills and some less relevant factors. So make 10 potions, drink them, doubling your intelligence multiple times, buy more ingredients, you could always sell one of your potions who was now idiotic expensive. It was kind of dangerous, if you made an speed potion of +10.000 speed you would be supersonic but unable to interact with anything as you overshoot and it lasted for months in game.
@JakeMarley-k6g4 ай бұрын
I can't believe I haven't done much programming and knew some of what you were talking about about
@TraceguyRune3 ай бұрын
"You either die a hero or live along enough to see yourself become the villain" - Ghandi
@Solrex_the_Sun_King4 ай бұрын
Make 2 wishes as normal, then wish for 0 wishes left. Because if this doesn't work, at least you get 2 wishes, and if this does work, you got unlimited wishes.
@usptact4 ай бұрын
Genie: now you owe me one wish
@crimester3 ай бұрын
didn't know genies still use 8-bit hardware
@PvblivsAelivsАй бұрын
Now, my first thought was that that had to be an old joke with an 8-bit counter.
@KudoShinichii14124 ай бұрын
that laughing track is crazy
@scottdimond79194 ай бұрын
I will never be able to watch disneys aladdin the same way again.
@jimmicrackhead124 ай бұрын
Ghandi was a problem in civ 2
@felineboy4 ай бұрын
"I wish you were a 64-bit genie"
@carultch4 ай бұрын
Then you'd have more wishes than you could ever use in the entire future of planet Earth.
@Envy_the_Darksider3 ай бұрын
Any video that talks about the 8 bit numbers looping is REQUIRED to talk about Civilization Gandhi XD
@castirondude2 ай бұрын
We would play with this stuff a lot back in the DOS days. Like on Indycar Racing you could normally set the spoiler to 0-20 degrees for extra downpressure on the drive tires. If you could wrap it around to 255 degrees you got crazy traction. In reality that would make no sense but in a simple computer algorithm that's only expecting 0-20 degrees , setting it to 255 degrees will have you go around corners at 200 mph no problem.
@verkuilb4 ай бұрын
@1:45 Sorry, Ferris-it’s not working. We might as well kill the car. 😂
@Grundini914 ай бұрын
Nuclear Ghandi is not an Urban Legend, it's fact. Had it happen during a game of Civ II.
@jmr51254 ай бұрын
The video isn't arguing that Nuclear Ghandi _itself_ is a myth -- just the *explanation * is wrong, per the developers. There is a Wikipedia article with sources and everything (Google "nuclear Gandhi").
@brewedawakening65774 ай бұрын
Genie: Thank you for opening the bottle. You now have 3 wishes. Man: Ok, First I want &2 Billion in cash right now. Genie: Granted Man: 2nd, I wish to have a Bridge that will connect everyone everywhere in the world so we don't have fly to go anywhere. Genie: That's impossible. The bridge is going to be too long and weak. Next wish. Be careful this is your last wish. Man For my last wish, I want to be able to understand Women! Genie: You want that Bridge 2 Lanes or 4 Lanes?
@Arnikaaa4 ай бұрын
As a woman, I want to understand men 😭 What goes on in their minds ??
@AmixLiark4 ай бұрын
I wish to make all of my possible wishes come true.
@boomkittyFX3 ай бұрын
my concern is that they're using an 8 bit integer still, could have at least had a 32 bit or something-
@ollllj4 ай бұрын
Wish for obtaining a Genie, that will create more wish-granting Genies. When the Geenie says "3", does he mean complex numbers, because I want to multiply that "3" with some complex numbers or (noncoimmutative) quaternions or (noncommutative and nonassociative) octonions and even (non-alternative, order of multiplication gives different results) sedenions
@StoneColdMagic4 ай бұрын
I tried this on a real genie. He turned blue and died.
@mr.d87474 ай бұрын
*If the rules say you can't wish for more wishes, just wish to change the rules.*
@Marciunus164 ай бұрын
You can't bend the genie's rules using a wish.
@mr.d87474 ай бұрын
@@Marciunus16 *Okay, then I wish to be able to bend the genie's rules using a wish.*
@Marciunus164 ай бұрын
@@mr.d8747 against the rules lmao
@bokogonk3 ай бұрын
@@Marciunus16 I wish for more genies
@paulromsky95274 ай бұрын
I use 32-bit unsigned integers, that would roll back to 4,294,967,296 wishes!
@AnthonyCurley4 ай бұрын
The real question is does the wish counter get decremented before or after the wish is granted?
@HansBezemer4 ай бұрын
Imagine a 64 bit genie..
@AndriuxDev3 ай бұрын
And that, my friends, is how Pacman 256 was born. It all started with an integer overflow.
@brunogrieco51464 ай бұрын
A real old-time bug that still haunts us is Feb 29, 1900. Back in the days of Lotus 1-2-3, the leap year calculation had a bug, which considered years divisible by 100 as leap years. They aren't, but if divisible by 400 they are (2000 was a leap year). But Microsoft Excel decided to keep the bug in order to maintain compatibility with older spreadsheet. You may check it at home. It's still there.
@janofb4 ай бұрын
My wish would just be for 255 wishes
@AndrejusDovidaitis4 ай бұрын
But you're not allowed to wish for more wishes, but you can use loopholes
@hikari16904 ай бұрын
Sheesh, what sort of 8bit joke was that
@marcelmommsen530813 күн бұрын
I wish the wish counter is not writable! Might work, unless the loop is like "while (granted_wishes
@thomasschodt76913 ай бұрын
No need to ask for more wishes; just ask for more genies...
@HimanshuYadav-xm9rz4 ай бұрын
What if the genie's program works like this: First decrement the wish variable by 1 and then fulfill the wish. In that case the wish variable will be updated to 2 and then to 0 thus ensuring that your wish is fulfilled!
@Nikolas_Davis2 ай бұрын
The Haskell Genie grants your wish, and returns a genie that grants you 2 wishes.
@castirondude2 ай бұрын
5:52 I like how your microphone glitches out when you mention an 8 bit number overflowing. Must be an 8-bit ADC
@franchello11054 ай бұрын
In the video game Madden, the largest the score can be is 255. Not sure ob the current version, but Madden 2008 it was like that. Also NHL 98 for N64 had a maximum plus minus rating of +127. They were preventing overflow.
@NichaelCramer4 ай бұрын
Knock, knock, knock. Who’s there? Recursion. Recursion who? Knock, knock. Who’s there? Recursion. Recursion who? Knock. Who’s there? Recursion. Recursion who? Um… this is the part I haven’t figured out yet.
@kallekivimaki78254 ай бұрын
I'm pretty sure unsigned char starts at 0 so you can iterate normally in for loop... It would need to be set to -1
@jimlocke93204 ай бұрын
The 2 player game of backgammon can be played with a doubling cube. At his/her turn, a player may offer the opponent the opportunity to double the points for the winner. The opponent can either accept the offer or concede at the current level. If the opponent accepts, he/she takes control of the cube. The player offering the double gets the cube back only if the opponent offers a double and it is accepted. There is also what is known as a "back game". A player can be way behind but still win. At one time long ago, I had access to a mainframe computer which had a backgammon program that I could play after hours. My recall is that it used a 32 bit register to store the value of the doubling cube and, when the game started, stored a 1 in the least significant position. Each double shifted that bit one position to the left. I would deliberately play a back game and the computer and I would alternately double. It doubled because it was ahead and I doubled because I wanted to inflate the value of a win. I would stop the doubling with the 1 in the most significant bit position and myself in control of the cube. I am guessing that the cube was at 2,147,483,648. If I won, I would receive that many points. If I were about to lose, I would offer a double and my computer opponent would automatically accept, rolling the cube over to 0. So, the computer opponent got 0 points for winning. In "normal" play, there is typically a limit on the number of times the value of the game may be doubled. A doubling cube has 6 sides and they are labelled 2, 4, 8, 16, 32, 64, limiting the value of a win to 64 times the value if no doubling takes place. I would consider it an oversight on the part of the programmer(s) to allow unlimited doubles.
@HackerDragon99994 ай бұрын
Genies probably operate in 2-bit wish counting systems.
@justin4234 ай бұрын
In a similar vein to the Gangam style view count and Y2K the Unix 2038 problem is coming up....
@Dexaan4 ай бұрын
256 is my favorite number because of the Legend of Zelda rupee counter - it maxed at 255