Kathis Posted December 17, 2024 Report Share Posted December 17, 2024 Hello Jellybeans, Day 16 of puzzles. Todays lesson is about Colour~ and a bit of bitlogic. We'll start with the colour. Red, Green, Blue, Magenta, Cyan, Yellow, Black, and White. Have a what I like to call a pure hex value. Black #000000 Red #FF0000 Green #00FF00 Blue #0000FF Yellow #FFFF00 Cyan #00FFFF Magenta #FF00FF White #FFFFFF The first two values are Red values 0-255 (00-FF) the second values are Green values 0-255 (00-FF) and the last values are Blue values 0-255 (00-FF) #RRGGBB Now I know you have paint, and you can use the eye dropper. To get the decimal values. and check it in the edit colour. ---- Now bitlogic. Math in bit logic is a bit... weird. bitwise Or ( | ) is simple. Take these two bytes for example. 1000 1011 0111 0101 we compare the 1 and the 0, if there is a 1, then the final answer would have a 1 in that slot. So since every slot has a 1 at some point, it's 1111 1111 or FF bitwise And (&) however is a bit more... picky. Like Or it will compare the 0 and the 1, but they both need to have a 1, otherwise it's a 0. With our pervious bytes the answer would be 0000 0001 since only that slot had a 1 in both bytes. bitwise Not (~) Just flips the bit. 0's become 1, and 1's become zero. For this puzzle you will not need to worry about it. But it is worth mentioning ----- That's the crash course. So let us begin. The easy exercise / puzzle. (I made the | bolder since it was harder to see...) Provide the answer in decimal with our respective letters. Good luck everyone. Quote Link to comment Share on other sites More sharing options...
tachy Posted December 17, 2024 Report Share Posted December 17, 2024 Blue (a) = 2B8BEC Indigo (b) = 626AB5 Lime (c) = B9E730 Each hexadecimal number can be represented by 4 bits, from 0000 (0) to 1111 (F). So, each color would have 6 x 4 = 24 bits. Then, you can break it down and convert by dividing each number by 2 until the number is zero. The remainder for each division is the binary bit starting from the "ones" place: 2 = 0010 (2/2 = 1 R0, 1/2 = 0 R1) B = 1011 (11/2 = 5 R1, 5/2 = 2 R1, 2/2 = 1 R0, 1/2 = 0 R1) 8 = 1000 (8 is just 2^3 so it's 1000, because 2, 4, 8, 16, and so on is a 1 followed by X 0s using X from 2X) B = 1011 (B was done) E = 1110 (minus 1 from F 1111) C = 1100 (add 1 to B) and combining them still gives the same number 001010111000101111101100 = 2B8BEC Or you can just convert it somewhere. In fact, you could just do: ████████ & ████████ | ███████ Logically, the order would be (a & b) | c = 12mXXXkXX6 but the answer doesn't seem right? Quote Link to comment Share on other sites More sharing options...
Kathis Posted December 17, 2024 Author Report Share Posted December 17, 2024 Your hex values are correct for the colours. But somewhere the math didn't math. Your last combination number is off by a few bits flips, and I am trying to figure out where that happened. What do you get when you do a & b ? Quote Link to comment Share on other sites More sharing options...
tachy Posted December 17, 2024 Report Share Posted December 17, 2024 a&b: ██████████████████████ Quote Link to comment Share on other sites More sharing options...
Kathis Posted December 17, 2024 Author Report Share Posted December 17, 2024 Yep, that is correct. Saw the issue, upped the reward it was a fault of mine. Redacted the obvious. I'll leave the others since it still is part of the community solving if they need a hint or help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.