Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Required fields*

Draw a Gameboy Tile

Description

The Gameboy stores tiles as 2 bit-per-pixel 8x8 images, thus 16 bytes. Every two bytes is a complete row with all of the Low-bits of each pixel in the first byte, and all of the High-bits of each pixel in the second.

Input

Input will be exactly 16 bytes, received through Standard IO in one of the following forms:

  • Array of bytes or strings
  • 16 byte string

Per the Standard IO, these may be in a language convenient form (Deliminated string, on the stack, etc.)

Output

An image, Rendered or Saved, of the Gameboy Tile.

Scale and Aspect Ratio of each pixel is not fixed.

Each 2 bit colour of the Pallet may be anything so long as the Manhattan Distance of the RGB256 representation is atleast 48. Eg. #FFFFFF, #AAAAAA, #555555, #000000. Traditionally, although not a requirement, 00 is the lightest colour, and 11 is the darkest.

Examples

[FF, 00, 7E, FF, 85, 81, 89, 83, 93, 85, A5, 8B, C9, 97, 7E, FF]

A Pokemon Window

[7C, 7C, 00, C6, C6, 00, 00, FE, C6, C6, 00, C6, C6, 00, 00, 00]

The letter A

Final Notes

  • Standard Loopholes apply
  • An online demo, and more in-depth explanation of the implementation can be found HERE
  • This is , so fewest bytes wins! (The Gameboy only had 65536 bytes of Address Space, after all!)
  • Have Fun!

Answer*

Draft saved
Draft discarded
Cancel
5
  • \$\begingroup\$ Unfortunately the OP wrote after I posted my answer that it isn't allowed to output using a string like that, so this is invalid. See my updated Japt answer \$\endgroup\$ Commented Feb 18, 2023 at 18:38
  • \$\begingroup\$ @Jacob thanks for the heads-up. I've updated my answer. \$\endgroup\$ Commented Feb 18, 2023 at 20:17
  • \$\begingroup\$ Thunno N, 30 characters: b8zK2ApeZt.JBA_sjE"P2 8 8 3"ZN \$\endgroup\$ Commented Aug 5, 2023 at 18:48
  • \$\begingroup\$ @noodleman nice! It's been so long since I last wrote a program in Thunno so it felt kinda cool writing the explanation. \$\endgroup\$ Commented Aug 5, 2023 at 19:47
  • \$\begingroup\$ Thunno N, 29 chars (≈ 23.87 bytes if you're still doing that): "P2 8 8 3"ZKb8zK2ApeZt.JBA_sj \$\endgroup\$ Commented Jan 21, 2024 at 3:52

AltStyle によって変換されたページ (->オリジナル) /