Planet Gray Code - Game Jam 3

Planet Gray Code

Join the Star Plan team on an exciting scientific mission to Planet Gray Code. You will learn about the inefficiencies of human counting from Lieutenant Commander Speck, then you will train with Master Yoyo until you and Captain Cork are ready to play a deadly game of wits with the aliens from Binaries.

This is an entry for the Arduboy Game Jam 3.0.

  • Frank Gray - Gray Codes
  • Aaron Williams - Concept, Programing

Warning: Khan memes.




Play Online

Planet Gray Code (version 1.0) can be played online thanks to the magic of ProjectAbe:


Version 1.0 - Entry for the Game Jam
Version 1.x - Permutations Gray Codes?


Wow with only minutes to go! Great graphics !

1 Like

The Hawaiians might be running out of time, but two hours west the Baker Islanders (population: 0) are relaxing with plenty of AoE time left!

1 Like

Right … I love that your students are handing in their homework at the very last minute!

1 Like

Just played this online - interesting concept and really well done!

1 Like

Yeah, and their instructor was down to the last second! :sweat_smile:


Bonus points for figuring out the connection between this game and @Mr.Blinky’s Xmas tree minigame (Game Jam 2.0) :thinking: :brain:


Towers of Hanoi is a gray code countdown?


&nbsp; or <>
This is a great game btw :smile:


Whew! Are we having fun yet?!

Interesting. Gray code is something I read about once, many years ago and never had a chance to actually use, so I don’t remember the logic very well.
I guess that means I should play this game, then. :slight_smile:

Oh darn! I actually deleted my detailed response by @FManga’s answer by clicking the speech bubble icon instead of the gear icon. I’m going to post it again.

uggh, I’m having trouble with the blurred text

amazing secret test

You can create a Gray code order (and earn the eternal gratitude of Captain Cork in Planet Gray Code - Game Jam 3) by flipping bit positions according to a pattern – 1, 2, 1, 3, 1, 2, 1, 4, … – which is known as the ruler function or the ruler sequence. This pattern can then be used to determine which size of disk to move during a solution to the Towers of Hanoi problem, where 1 denotes the smallest disk.

The Towers of Hanoi does have one more complications: Where should each disk be moved? When moving any disk of size >= 2 there actually isn’t any choice since the previous move put disk 1 on top of one of the other two pegs. When moving disk 1 you can cycle through the following order of pegs: s, o, d, s, o, d, ... or s, d, o, s, d, o, ... where s is the start peg, d is the destination peg, and o is the other peg. More specifically, you cycle through the first pattern if the number of disks is odd (as in Xmas tree minigame) and you cycle through the second pattern if the number of disks is even.

1 Like

The above post gives a more detailed answer to @FManga’s answer and contains spoilers for Planet Gray Code and Xmas tree minigame.

Also, I think that the blurred spoiler text needs to be applied separately to each paragraph. Or at least it cannot contain blank lines at the beginning / end. KHAAAAAN!

Is the pattern the only way? If you want the 100th number, do you have to go through all the previous ones?

There are many other approaches to create a Gray code order. For example, the approach suggested above will flip bit 1 every other time (i.e. 50% of the time) and will flip the bit on the opposite side of the string only once. On the other hand, you can create Gray code orders where the number of times you flip each bit is ‘fair’ (i.e. each bit is flipped a similar number of times. Check out the “Special Types of Gray Codes” section on Wikipedia.

There are also other solutions to the Towers of Hanoi problem, but it is possible that all shortest solutions must follow this type of pattern.

Another related puzzle is Spin-Out by Think Fun (which was formerly known as Binary Arts). There are videos of this puzzle online and you can also play it here.

There are also Gray codes for other objects like permutations. If I make a post-Jam Version 2.0, then I’ll add some suitable Permutron aliens!

1 Like

Isn’t that the definition of student?
“A creature that hands its homework in at the last minute.”


You can now find a copy of Planet Gray Code’s .hex file (and an online ProjectABE emulator link) on the Game Jam 3 polling page: [POLL] Game Jam 3 Vote!

(My apologies for cross-posting similar things on several other Game Jam postings, but all of our addresses are currently down, and that effects about half of our submissions.)