Archive for November, 2008

Color Infection 2

Wednesday, November 5th, 2008

All level designs are done. The sequel is much more challenging than the first one. But it will be released after the online level editor is finished. So please wait. If everything is ok, it should be released in a month.

(Update: The release of Color Infection 2 will be delayed. I will try my best make it out before Christmas. In fact, the editor almost done, but I want to make the editor more powerful. )

It is released. Hope you enjoy it.

The Mystery of Math Solitaire

Wednesday, November 5th, 2008

Long long ago, I learned a solitaire game:

  1. first remove the Jokers from the 54 cards,
  2. then you will be given 4 solitaire cards randomly in the remaining 52 cards.
  3. your goal is to get 24 by operating the 4 cards with addition, subtraction, multiplication, division. Each cards must be used once and only once.

For example, give you 4 cards: 1, 3, 9, 7, you can get 24 from (1 + 7) × (9 ÷ 3). There are exactly some cases without solutions, for example: 5, 5, 7, 9. But the success rate is very high. In all 1820 cases, there are only 474 cases without solutions (here fraction is not supported). This means about 74% of all cases are solvable.

One week ago, I decided to implement this game with flash. When it is almost done, an idea arised suddenly: how about change the rule to “give you 5 cards randomly, then your goal is to get the value of one card by operating the the other 4 cards with addition, subtraction, multiplication and division, each of the other 4 cards must be used once and only once“. Then I try it. Surprisingly, the success rate is even higher than the old one. In all 6188 cases, only 860 cases have no solutions, which means about 86% of all cases are solvable (solvable turns, see definitions below). Now I have decided to adopt the new rule for this game (named Math Solitaire).

Below, we name Case as Turn. A turn is represented as (a, b, c, d, e). For each turn there are 5 puzzles: (a, b, c, d)=>e, (a, b, c, e)=>d, (a, b, e, d)=>c, (a, e, c, e)=>b and (e, b, c, e)=>a.

Above statistics is get under 2 more minor rules:

  • It is valid if the 5 numbers in a turn are a same value. In reality, with only one solitaire set, this is impossible.
  • The intermediate results must not be a fraction, for example, (1/3 + 3) × 3 = 10 is not a valid solution for (3, 3, 3, 1) =>10.

Generally, if one of the 5 puzzles in a turn is solvable, then others are also solvable. But sometimes, it is not true. For example, (13, 13, 2, 10) => 2 has solutions, but (13, 13, 2, 2) => 10 has no solutions if 0 divide 0 is not valid or not defined. We call a turn as Solvable Turn once one puzzle in the turn is solvable. We call a turn as Good Solvable Turn if all the 5 puzzles in the turn are solvable. We call a solvable turn as Bad Solvable Turn if one puzzle in the turn is unsolvable. We call a turn as Simple Turn if the turn can be represented as (a, a, c, c, e), in other words, b=a, d=c. A simple turn at least has one solution (a – a) × e + c = c for puzzle (a, a, c, e)=>c.  So a simple turn is absolutely a solvable turn. A bad solvable turn must be a simple turn. But a simple turn is not always a bad solvable turn. If a simple turn is not a bad solvable turn, then it must be a good solvable turn.

As mentioned above, there are 6188 turns and 5328 solvable turns. Among these solvable turns, there are 392 bad solvable turns, 1183 simple turns, 4936 good solvable turns.

Only good solvable turns are packed In this game.

Some variations for this game:

  • support extraction and power operations.
  • support fraction as the intermediate results, for example, (1 / 3 + 3) × 3 = 10.
  • the operands must be less than 10 (Jacks, Queens and Kings are also removed).
  • set the result value as a specified number (4 randoms + 24 is one case of this variation).

The game will be released in this month.

Not only can this game be played online, but also can be played with friends in a party or in camping.