top image
home  /  pages  /  tech tips  /  contact about

Happy Cube (Wirrel Warrel) Solver

Introduction

Big cube

Quoting from http://www.happycube.com:

The Happy Cube® was designed by Dirk Laureyssens in 1986. The aim of the game is to build a perfect cube from the six puzzle pieces (3D) and then to fit the pieces back into the frame (2D). Initially there were 6 models, each with a different color and degree of difficulty. Now the range has expanded to 24 different puzzles which are fully compatible with each other (interconnecting). The various models are the Little Genius®, the Happy Cube®, the Profi Cube® and the Marble Cube®.

In 1992 I wrote a program that solves trivial small cubes. In 1997 I rewrote the program to build any shape based on a recipe. In 2001 I made it really fast. It is the only program I wrote that can look back on a career of 10 years. This program was my first-ever programming project: its performance has closely followed my computer science education: it started out lousy, but it's OK now.

This program is very user unfriendly and not for the faint of heart. I will do my best to explain stuff, and I even plan to write up a GUI for it one day, but for now you will have to do with my explanation. I will invest more time and effort in this, but, meanwhile, I'm trying to get a Ph.D. in Computer Science at MIT, so bear with me. You can read more about me, Thomer M. Gil, if you happen to be interested.

Downloading the software

Download wirrel.tgz. This software is distributed under the GNU General Public License. I briefly considered the Open Profanity License, but, after careful deliberation, decided not to.

A Windows version coming up, soon.

Invoking wirrel

After make-ing the program, you can run it by typing wirrel on the command line. Here's the usage of wirrel.

Usage: wirrel [OPTION]...

options:
  -h, --help                         show this help
  -d, --description file             file contains piece descriptions
  -m, --recipe_file file             file contains build recipe
  -s, --silent                       continue after giving solution
  -c, --count                        give count information
  -v, --verbose                      add verbosity

A description file contains the description of one or more pieces. Many such files can be found in the des/ directory. Every line in a description file describes a single piece and consists of a name and 16 zeroes and ones. The n-th digit tells the program whether or not a thingy ("finger") is sticking out at position n. Counting starts with 0 in the top-left corner and goes clockwise around the 3x3 heart that all pieces have in common.

Single piece

Since that made no sense at all, here's an example. The piece on the left can be described by:

some_piece	1101110100100010

"some_piece" is a name you give to a piece. Make sure all pieces have different names! Also, make sure you know which piece has what name. I do it by sticking small stickers on the pieces. The first "1" is there because there is a thingy sticking out in the top left corner of the piece. Then comes another "1". That is because to there is another thingy sticking out to the right of the previous thingy. Next comes a "0" because there is no third thingy. Et cetera. Notice that you can "bend" this row of digits into a square-shaped chain that resembles the outer rim of the piece.

By default, wirrel tries to use des/wirlist.des, which contains a description of all pieces that I have.

Big pile

A recipe file describes which figure to build. It is rule-based and describes what conditions need to be met for a piece to fit. The syntax of that file is beyond the scope of this Web page. There is a file doc/readme.txt that should get you on your way to writing your own. I provided 3 recipes that reside in the mak/ directory. wir111.mak describes how to make a 1x1x1 cube. wir222.mak describes how to make a 2x2x2 cube---as seen at the top of this page---and wir223.mak describes how to build a 2x2x3 cube. By default it uses mak/wir222.mak.

Normally, wirrel asks for user input after generating a solution. The silent options skips this. The count options shows some information on how many possibilities have been tried, and verbose increases verbosity.

One way to call wirrel could be:

wirrel -d des/rood.des -m mak/wir111.mak   

This will use the pieces in file des/rood.des to build a 1x1x1 cube.

Interpreting the solution

A solution is presented like this:

Solution 1
 1-geel_a: 1.
 2-geel_c: 6.
 3-geel_b: 2.
 4-geel_e: 7.
 5-geel_d: 6.
 6-geel_f: 5.

Don't panic. (It sucks, I know.)

The first column tells you which piece in the cube we are talking about. A 1x1x1 cube consists of 6 pieces: the bottom is 1, the right side is 2, the back side is 3, the left side is 4, the front side is 5, and the top is 6. (This order depends on the rules in the recipe file, but ignore that for now.) While building the cube, never turn or flip it, or a foul beast will suddenly come in and drag you off to Happy Cube Hell.

The second column is the name of a piece.

The third column tells you how to put that piece in the puzzle: its orientation. There are 8 different orientations for a single piece. Here you see them all:

1 2 3 4
5 6 7 8

(Note that this is one and the same piece! It is yellow on one side and orange on the other side.)

Orientation 1 corresponds with how the piece is described in the description file. Going from orientation 1 to 2, from 2 to 3, from 3 to 4, from 5 to 6, from 6 to 7, and from 7 to 8 involves a 90-degree clockwise turn. From 4 to 5 is a backwards flip.

Now all you need to do is put the piece in its correct orientation in the correct position in the cube!

Related pages

Happy Cube
The makers of Happy Cube. They also have a solutions page.

HappySolver
A fancy 3D Happy Cube solver.

Happy Cube by the inventor
The inventor of Happy Cubes, Dirk Laureyssens, explaining what we're dealing with.

Happy Puzzle
A British clone

Happy Cube
The math behind Happy Cubes and some solutions.

A Happy Cube Solution
A rather hard to understand Web page. But then again, I suck too.

Snafooz
Yet more solutions.

Rob's Puzzel page
Many links to many puzzles.

URL: https://thomer.com/wirrel/index.html
Copyright © 1994-2022 by Thomer M. Gil
Updated: 2020/04/10