I use this blog as a soap box to preach (ahem... to talk :-) about subjects that interest me.
Showing posts with label Games and puzzles. Show all posts
Showing posts with label Games and puzzles. Show all posts

Wednesday, November 27, 2013

My custom tiles for Carcassonne

I have played so far 94 games of Carcassonne, of which 89 where with The River extension, and 86 with the additional extension Inns and Cathedrals.  Additionally, I also played 17 times Carcassonne's Winter Edition, which is almost identical to the standard game.



I have a couple of other extensions, but I like best the combination of the basic game plus The River and Inns and Cathedrals.

That said, I started thinking that a couple of tiles where missing, and decided to make them myself.  Note that I always play Carcassone by taking the tiles from a canvas bag (rather than from piles as recommended in the rules).  Therefore, it doesn't really matter to me whether the back of the tiles I make looks identical to that of the original set.  That is, to be playable, my tiles only need to feel like the standard ones.

I used PaintShop Pro to edit scanned images of existing tiles, printed them on matt self-adhesive paper, and stuck them onto the right type of cardboard.

The first tiles I added where two each of the following ones:



Then, I decided to extend Inns and Cathedrals by adding the following two:


And finally, I extended The River by adding a river branch, (which required an additional river end) and a straight section of river:



But there was a problem with The River: I usually play the 10 tiles (now 12) by simply turning them face down on the table.  To be able to keep doing that, I made my own source and both ends.  This allowed me to stick the new river branch and the new river section to the front of the original source and end.  This worked because the additional thickness of the tiles due to the adhesive paper is not enough to make the tiles distinguishable when they are face down.

If you want to reproduce the tiles, download the images in this articles and print them with the scale of 100%.  As they have a resolution of 600dpi, they look as good as the originals!

2020-04-01: I have updated this post, but only to ensure that all images were displayed correctly. As of today, 6y 4m after posting this article, I have played 317 different board games a total of 1246 times, but Carcassonne has remained one of my favourite, with 211 plays. Check out my page on BoardGameGeek for more.

Tuesday, October 22, 2013

KenKen and CalcuDoku Revisited

Almost two years ago, I posted an article to this blog about KenKen and CalcuDoku.  In that article, I compared the 9x9 puzzles made available in the web sites kenken.com (® Nextoy LLC), calcudoku.org, and zambon.com.au (my own).  Like last time, I will use K to identify the puzzles provided by kenken.com, C to identify those provided by calcudocu.org, and Z to identify mine.

Of the three web sites, only the K site provides 9x9 puzzles of different levels of difficulty, but I have only ever solved the "tough" ones.

After solving more than 500 9x9 puzzles, I have a much better feel about the differences between the puzzles generated by the three sites.

K and Z are comparable in terms of difficulty and general "feel".  The C puzzles are different.

First of all, the C puzzles include many more single-cell cages.  Patrick (the developer of the C site) told me that he uses singles to remove ambiguities.  I understand why the singles are there, but I have always found it annoying that their average number exceeds 9.  K puzzles include very few singles (0 to 3), and I can configure my generator to limit the number of singles to whatever I like.  I normally set the maximum number of singles to 3, but I could also set it to 0 (I have tried it out) and systematically generate puzzles without singles at all, although it requires on average a longer time to generate each puzzle.

I don't think that Patrick's decision to "single out" the ambiguities was a good one.  I commented on the C web site that I didn't like to go through the chore of filling up so many singles when starting with a new puzzle, but other users replied that it didn't bother them.  Fair enough.

Another problem I have with C puzzles is that the difficulty of solving them is not uniform as you progress: invariably, it is easy to fill in a third of the cages or so without much need for reflection.  Then, you hit a wall and the cages suddenly become very difficult.  It might be connected to the fact that there are many single cages used for disambiguation, but I am not sure.

I have lived for almost two years with the two problems I have just mentioned, because 9x9 C puzzles also have an interesting feature: they can have divisions and subtractions in cages with more than two cells.  For example, an angled three-cell cage with "2:" as target admits 841, 822, 631, 421, and 211 as possible solutions.

But there is another problem that has finally convinced me to stop solving C puzzles for good: some of them are not solvable analytically, and I refuse to solve a puzzle by trial and error.  I find it very frustrating when I encounter a puzzle that cannot be solved without guessing.

I know what you are thinking: perhaps I'm not good enough.  It's possible, but, perhaps not surprisingly, I don't think so.

I believe that the problem is due to the fact that C puzzles sometimes have too many large[r] cages with sums and subtractions.  This can result in untameable combinatorial explosions.  Those angle cages with targets ranging between 13+ and 20+ and between -0 and -4 sometimes combines in ways that leave too many alternatives open.

Patrick calculates for each puzzle a difficulty level, which for 9x9 puzzles is in the range 100±30 (i.e., I haven't seen anything outside that interval).  I asked him how he arrives to those figures, but he refused to divulge his algorithm.  I understand that when he started his web site he went though several tests, but his calculations are not right.  Last June, I solved a puzzle with an alleged difficulty of 129.3, but in September I didn't succeed in solving a puzzle with a difficulty of 70.2.

Here are the statistics for the June puzzle:
#1-cell: 8
#2-cell: 16 (3+, 9-, 2x, 2:)
#4-cell: 4 (1+, 2x, 1:) all T-shaped
#5-cell: 5 (2+, 3x) 1 cross-shaped, 4 angled

And here are those for the September puzzle:
#1-cell: 9
#2-cell: 13 (2+, 3-, 8x)
#3-cell: 6 (1+, 4-, 1x) all angled
#4-cell: 4 (3+, 1-) 1 T-shaped, 2 squares, 1 lightning-shaped
#5-cell angled: 2 (1+, 1x) 1 cross-shaped, 1 tap/fawcett-shaped

Do you see what I mean?  The June puzzle, which was supposed to be among the most difficult ones, had no 3-cell cages, and of the 9 cages with 4 and 5 cells, only 3 had sums.  The September puzzle, which was supposed to be among the easiest 9x9s, had only two multiplications among the 12 cages with at least 3 cells.  In two adjacent columns, there were three 3-cell cages with 4-, 1-, and 0-, and arranged in such a way that they took up six cells of one column.

4- can be 941, 932, 831, 822, 721, 611; 1- can be 971, 962, 953, 944, 861, 852, 843, 751, 742, 733, 641, 632, 531, 522, 421, 311; and 0- can be 981, 972, 963, 954, 871, 862, 853, 844, 761, 752, 743, 651, 642, 633, 541, 532, 431, 422, 321, 211.  Yes, there were some crossings that reduced the possibilities, but the same puzzle also included two 4-cell 15+, a 4-cell 16+, a 4-cell 0-, and a 5-cell 32+.  No way that it could have been solved analytically!

All in all, I finally got fed up with the C puzzles.  That's why a couple of days ago I gave up on them.

The C web site has the best application to solve the puzzles online, but for the 9x9 puzzles (and I am not interested in the smaller ones), the best way is to print them out and use pencil and eraser.  Therefore, no loss there...

Monday, May 27, 2013

Einstein's Puzzle


I saw an informal IQ test that is fun to do. It is called Einsteins’ Puzzle, although it is not clear whether it was Einstein who actually invented the test. I found it in http://sesquiq.thelogics.org/freeiqtests.html together with other tests, but a Google search for “Einstein’s test” will take you to many pages on the subject.

According to Larry Neal Gowdy, who wrote the page where I found the test, the time people take to solve the test is linearly correlated to their IQ percentile. Apparently, unless you are in the top 2% of IQ percentile (the level that qualifies you to join Mensa), you will never succeed in solving the puzzle!

Here is a graphic representation of what Gowdy said:


That is, according to Gowdy, somebody who scraped through the Mensa qualification test takes two hours to solve Einstein’s puzzle. If you want to try it out, start your timer immediately before reading the text of the test.

Here it is:

There are 5 houses in 5 different colors. In each house lives a man with a different nationality. The 5 owners drink a certain type of beverage, smoke a certain brand of cigar, and keep a certain pet. No owners have the same pet, smoke the same brand of cigar, nor drink the same beverage.

The Brit lives in the red house.
The Swede keeps dogs as pets.
The Dane drinks tea.
The green house is on the left of the white house.
The green house's owner drinks coffee.
The person who smokes Pall Mall rears birds.
The owner of the yellow house smokes Dunhill.
The man living in the center house drinks milk.
The Norwegian lives in the first house.
The man who smokes Blends lives next to the one who keeps cats.
The man who keeps the horse lives next to the man who smokes Dunhill.
The owner who smokes Bluemasters drinks beer.
The German smokes Prince.
The Norwegian lives next to the blue house.
The man who smokes Blends has a neighbor who drinks water.
Who owns the fish?

If you give up and want to know how I solved it, keep reading.

First of all, I expressed the statements of the test in a compact form:

A. Brit - red
B. Swede - dogs
C. Dane - tea
D. green | White
E. green - coffee
F. birds - PallMall
G. yellow - Dunhill
H. center - milk
I. first - Norwegian
J. (cats) | Blends | (cats)
K. (Dunhill) | horse | (Dunhill)
L. beer - Bluemasters
M. German - Prince
N. (blue) | Norwegian | (blue)
O. (water) | Blends | (water)

I did it because I wanted to avoid being distracted by the wordiness of the original statements.

Then, I made a table with one column for each house position, from left to right.

We can immediately use I, H, and N to begin populating the table:


1st 2nd 3rd 4th 5th
colour

blue



citizenship
Norwegian




pet





drink


milk


cigars






After combining D with E and J with O, we are left with:
A. Brit - red
B. Swede - dogs
C. Dane - tea
DE. green - coffee | White
F. birds - PallMall
G. yellow - Dunhill
JO. (cats) - (water) | Blends | (cats) - (water)
K. (Dunhill) | horse | (Dunhill)
L. beer - Bluemasters
M. German - Prince

DE tells us that green and coffee are on the left of white. This means that green cannot be in first position because otherwise it would have blue on its right. Obviously, it cannot be in second position either because it is green and not blue. And it cannot be in third position because its occupant drinks coffee and not milk. This means that green is in fourth position:

1st 2nd 3rd 4th 5th
colour

blue

green
white
citizenship
Norwegian




pet





drink


milk
coffee

cigars






Then, red must be in third position because only two positions have an undefined colour, the first position is occupied by a Norwegian, and, according to A, red’s occupant is a Brit. Before redrawing the table, we can also write yellow in first position (the only position with undefined colour) and apply to it G:


1st 2nd 3rd 4th 5th
colour
yellow
blue
red
green
white
citizenship
Norwegian

Brit


pet





drink


milk
coffee

cigars
Dunhill





The remaining statements are:
B. Swede - dogs
C. Dane - tea
F. birds - PallMall
JO. (cats) - (water) | Blends | (cats) - (water)
K. (Dunhill) | horse | (Dunhill)
L. beer - Bluemasters
M. German - Prince

Now, statement K forces us to write horse in the second house because we know that Dunhill is in the first one:


1st 2nd 3rd 4th 5th
colour
yellow
blue
red
green
white
citizenship
Norwegian

Brit


pet

horse



drink


milk
coffee

cigars
Dunhill





And we are left with the statements:
B. Swede - dogs
C. Dane - tea
F. birds - PallMall
JO. (cats) - (water) | Blends | (cats) - (water)
L. beer - Bluemasters
M. German - Prince

According to C, Dane/tea can either be in the second house or in the fifth one. The same applies to beer/Bluemasters according to statement L. Therefore, we have two possible situations:


1st 2nd 3rd 4th 5th
colour
yellow
blue
red
green
white
citizenship
Norwegian
Dane
Brit


pet

horse



drink

tea
milk
coffee
beer
cigars
Dunhill



Bluemasters


1st 2nd 3rd 4th 5th
colour
yellow
blue
red
green
white
citizenship
Norwegian

Brit

Dane
pet

horse



drink

beer
milk
coffee
tea
cigars
Dunhill
Bluemasters




The following statements remain to be applied:
B. Swede - dogs
F. birds - PallMall
JO. (cats) - (water) | Blends | (cats) - (water)
M. German - Prince

In either case, water must be in first position. This makes the second situation impossible, because statement JO stipulates that water is neighbouring Blends, while with the second situation the neighbour would be Bluemasters. Then:


1st 2nd 3rd 4th 5th
colour
yellow
blue
red
green
white
citizenship
Norwegian
Dane
Brit


pet

horse



drink
water
tea
milk
coffee
beer
cigars
Dunhill
Blends


Bluemasters

We still don’t know whether cats are on the left or on the right of Blends. Therefore, we have to keep the J part of JO:
B. Swede - dogs
F. birds - PallMall
J. (cats) | Blends | (cats)
M. German - Prince

Statement M can only apply to the fourth position, because it is the only one with both citizenship and cigars undefined. Then, the Swede of statement B can only be in fifth position:


1st 2nd 3rd 4th 5th
colour
yellow
blue
red
green
white
citizenship
Norwegian
Dane
Brit
German
Swede
pet

horse


dogs
drink
water
tea
milk
coffee
beer
cigars
Dunhill
Blends

Prince
Bluemasters

The two statements left are:
F. birds - PallMall
J. (cats) | Blends | (cats)

PallMall of condition F can only be in third position, which means that the Brit owns the birds. This resolves statement J because the only unknown pet neighbouring the Blends is in first position:


1st 2nd 3rd 4th 5th
colour
yellow
blue
red
green
white
citizenship
Norwegian
Dane
Brit
German
Swede
pet
cats
horse
birds
fish
dogs
drink
water
tea
milk
coffee
beer
cigars
Dunhill
Blends
PallMall
Prince
Bluemasters

And it is the German who owns the fish!

I did waste some time at the beginning, before finding the right way of organising the information, but it took me 31 minutes to solve it. This is equivalent to an IQ percentile of 99.58, not inconsistent with what I had scored in the five IQ tests I had previously completed (from the most recent to the oldest: 99.96, 99.98, 99.82, 99.89, 99.87, 99.50).

Friday, November 16, 2012

Yet another book of puzzles

The last thing I would like is to put off readers of this blog by posting too many advertisements for my books. But, after all, I don’t publish things too often, do I?

I have just released a new puzzle book:



For the time being, you can only buy it from Lulu in print for AU$ 9.99 or from Smashwords in various e-book formats for US$ 1.99. It will take a while before you will find it on Amazon, Barnes & Noble, etc. It always does.

This book contains 100 difficult CalcuDoku puzzles. CalcuDokus, introduced in 004 as KenKen® (a registered trademark of Nextoy LLC), is a 9x9 numeric puzzle similar to Sudoku. But, unlike Sudoku, CalcuDoku doesn’t require you to learn complex strategies.

Each cage contains a target number and a code to indicate one of the four basic operations: “x”, “+”, “-”, and “:”. To solve a CalcuDoku puzzle, you have to solve all its cages; and to solve each cage you must write in its cells the digits that give you the cage target when you apply to them the cage operation.

Unless a cage consists of a single cell (in which case there is no operation and its solution coincides with its target), you can solve it in several ways. For example, a 2-cell cage marked “7+” admits six solutions: 61, 16, 52, 25, 43, and 34. But only one of those solutions is correct and will let you solve the whole puzzle.

You can discard the wrong solutions of all cages by repeatedly applying the rule that each digit between 1 and 9 can only appear once in each row and column.

The first sixty puzzles of this book consist of randomly generated cages, like the following one:


They are difficult, but I limited their difficulty by setting to 2 the maximum number of cages admitting more than 200 combinations. Therefore, although I haven’t tried them all, I’m pretty confident that they can be solved analytically. That is, without having to guess.

To create the other forty puzzles, I used a different strategy: instead of generating random cages, I arranged them in fixed patterns and only generated random digits, targets, and op-codes. Here is the type of puzzle you can expect:


These puzzles are in most (but not all) cases more difficult than the random ones. In fact some of them are quite diabolical. The first couple of patterned puzzles are easier than those that follow. Otherwise, the difficulty of the puzzles varies in no particular order.

Of the pattern-puzzles, I solved those numbered from 61 to 98. I haven't solved puzzle 99 but I believe it should be possible to complete it without having to guess (which I never do). Puzzle 100 is a different type of challenge: it admits two solutions, which differ in three cages. I could have removed the ambiguity by splitting one of affected cages, but I thought you might like to check it out, just for fun.

In case you are wondering, the shading of patterned CalcuDokus serves no practical purpose. It’s only there because it makes them prettier.

Sunday, February 26, 2012

Board Games

Years ago, I played some board games like Monopoly, Diplomacy, and Halma.  But then, for whatever reason, I stopped.  Earlier this year, I was talking with Glen of Mind Games about numeric puzzles and he suggested that I attend Cancon 2012, Canberra's biggest gaming convention, organised by the Canberra Games Society.

I was there all three days and looked at several games, like Carcassonne, Dominion, Tanto Cuore, and Alien Frontiers.

I discovered that:
  1. Some games, like Tanto Cuore and Alien Frontiers have very complex rules.  Certainly, they create an almost unlimited number of different situations.  But they also make it necessary to play quite a bit before becoming proficient and exploiting all possibilities.  Too many things to remember, especially for an impatient person like me.
  2. All games have an element of randomness, realised by drawing cards, rolling dice, or picking tiles.
  3. All games make possible to develop strategies to improve your chances of winning.  Sometimes it is realised by letting the players buy other cards (like in Dominion and Tanto Cuore).  Or by choosing between different playing options (like in Alien Frontiers), or deciding where to lay a tile (like in Carcassonne).
  4. Most games hev extensions.  Their purpose clearly is twofold:  keep the game new and stimulating, and make more money for the game developer and publisher!
Pretty obvious, really.  The randomness gives you the thrill of the unexpected and, when you are not doing so well, the hope that a lucky turn of events will let you recover.  And the possibility of strategising lets you be, at least to a certain extent, in control of your own future.  You can perceive most victories as resulting from your shrewdness and most defeats as due to bad luck.

Anyhow, the visit to the Convention made me itchy.  I wanted to buy a game and play it.  But they are so expensive, and none of them was completely right for me.  And my wife, who was going to be my most regular adversary, is even more choosy then me...

I ended up not buying any game and deciding to develop one.  For one thing, I didn't want to have to learn thick manuals before being able to play.

My first attempt was an abstract game named "Beeing About".

You start with the following 112 tiles that you lay on a board.

 

The board consists of 169 hexagonal cells and 48 half-cell edges, arranged to form a large hexagon.  Half of the edges are marked to 'connect' the two adjacent cells.  Seven of the cells are 'crossroads' marked in such a way that all six sides are connected with each other:

 

The game preparation is trivial:  Each player draws a number of tiles from the bag and places them face up on the table, where they are visible to all players.  The number of tiles drawn by each player is 6 with two players, 5 with three or four players, and 4 with five of six players.

The whole rule book is as follows.

Each player in turn plays a tile by laying it on one of the hexagons of the board.  For a play to be valid, the following rules must be respected:
  1. The played tile must be in contact with at least one of the tiles that are already on the board. Alternatively, the tile can be laid adjacent to a crossroad cell, but only if the crossroad is already in contact with one or more tiles.  The only exception to this rule is when the first player plays his very first tile.  In that case, he lays the tile in contact with the crossroad in the middle of the board.
  2. The paths of the played tile must continue the paths of the tiles (and possibly of a crossroad or an edge)  to which it comes into contact.  Note that the colours of the paths are different only to easily distinguish the tiles with different numbers of contact points.
Here are examples of correctly played tiles:

 

And here are examples of incorrectly laid tiles, because not all adjacent paths connect:

 

After laying a tile, a player draws a new tile from the bag, unless the bag has been emptied.

If a player cannot lay any of his tiles, he can replace one or more of his tiles with tiles from the bag.  To do so, he places his tiles into the bag and gives it a good shake before drawing from it the same number of tiles.  This obviously means that, especially towards the end of the game, he could draw the same tiles he has just discarded.  If, after replacing tiles, the player still cannot play any of them, he sits his turn.  That is, a player can only exchange tiles once before each one of his turns, and only if he cannot play any of the tiles he is holding.

Instead of exchanging tiles, a player can also decide to sit a turn.  If the bag is empty, the player obviously cannot exchange tiles and is forced to sit the turn.

A tile can be laid on a crossroad cell, but only if its paths connect to the paths of all tiles adjacent to the crossroad.

That's it.

I played it a few times, and it turned out that strategising was not really possible, because the players couldn't plan beyond their second next move.  In Carcassonne, you draw a tile at a time, but the mix of tiles and their meaning make possible for you to roughly plan some moves ahead.  Carcassonne is a tile-laying game with very simple rules and very smartly designed.  That's why it is so successful.

I could have worked on "Beeing About" and improve its strategising possibilities, but the game had another problem: it was too abstract.  The most successful new board games don't only tickle your intellect.  They also stimulate your imagination through nice sceneries and dazzling graphics.  And I suddenly had the urge to develop a successful board game.

For the graphics, I will have to find a partner, but I feel that "Beeing About" is not so suitable anyway.  I am now working on a different game, based in space.  More about that in a future article.  For now, I shall only say that it also has a board of hexagonal cells.  Hexagons are much more exciting than squares or triangles.  Don't you agree?

Before I end this article, here are some further reflections on the tiles of "Beeing About".

I wanted to draw all possible combinations of connections between the sides of hexagons. The tiles with 1 point of contact (the black dead end) and with 2 (green) and 3 (blue) points do just that.  But if you carefully look at the tiles with 4 points of contact (red), you will notice that several of them are redundant.  In the game, the only thing that matters is the distribution of points of contacts on the edge of the hexagons.  How they are connected within the tile is irrelevant.  For example, the following three tiles:

have the same points of contact among themselves.  And the following ones too:
 

and these:


Only three combinations of four points of contacts are functionally distinct:

 

It makes sense, because having four points of contacts means that you leave two of the six sides free.  And we know from the tiles with green paths that there are only three ways in which you can choose two sides...

Similarly, the tiles with five points of contacts (magenta) are all functionally identical, because there is only one way of leaving a side of the hexagon free of contacts.

But the different patterns looked nice...

Tuesday, December 20, 2011

A Puzzling year indeed

In yesterday's article, I forgot to say that in 2011 I also developed a CalcuDoku-solving game for the iPad (search iTunes for CalcuDokus and you'll find it in your local iTunes store).

I first made a $0.99 version with 100 puzzles, and then a free version with 17 puzzles and advertisements.

Despite my attempts at getting some review sites to look at it, the results were quite disappointing.  Apple's AppStore is saturated with applications, and it has become very difficult to get noted.  Big games-developing companies systematically hit jackpots, but nanodevelopers like me have close to no chance.

Far from me the idea that my application is exceptionally good and overlooked.  But I am pretty sure that a couple of years ago, it would have sold reasonably well.  So, why did I wait for 2011 and a saturated market before developing for the iPhone/iPad?  Because I am stupid.  That's why.  I did the same with the Web: in the early nineties, instead of being one of the first web developers on the market, I developed an application for the Mac (MacDOS) that went nowhere.

Another missed opportunity...

Monday, December 19, 2011

A Puzzling Year

This has been a year during which I have concentrated on developing puzzles and writing about it.  I had always been interested more in developing programs to generate and solved numeric puzzles than to solve the puzzles themselves.  Towards the end of 2010, I finally dedicated myself to it.

The first thing I did was to write two programs to generate and solve Sudoku Classic puzzles.  I also added to the Generator the code necessary to create pattern Sudokus (i.e., puzzles in which the initial clues are arranged in a pre-determined way).  Once I was done with Sudoku Classics, I wrote a program to combine five pattern Sudokus into a Samurai Sudoku puzzle.

This work on Sudoku resulted in my first puzzle book, Sudoku Programming, which I self published at the beginning of April.  365 pages of strategy explanations, walk-throughs of "C" code, and examples.

Shortly after that, I thought that a book describing in detail the strategies to solve Sudoku Classic puzzles could be useful, and wrote Sudoku Explained, a booklet of 94 pages that I published at the end of May.  I offered it to the game shop Mind Games, that has since sold some copies.  Forget what they say about eBooks.  In terms of satisfaction, nothing compares with seeing your printed books on the shelves of a physical, old fashion, shop.

I had designed the head with the "Sudoku Brain" for my first book, and had the idea of placing small heads on the two sides of my name.  But, after flipping the small head to place on the right-hand side of the cover, given my perfectionism, I flipped each digit inside the brain back to its original direction, so that they could be read.  The devil is indeed in the details...

At that point, I decided that "C", after all, was less popular than Java, and decided to rewrite all my Sudoku programs in Java. This took a few months during the middle of the year.  After that, it seemed natural to rewrite "Sudoku Programming" for Java.  This time, I chose the more catchy title How to Create Your Own Sudokus with Java.  I contacted some publishers and also some agents, but nobody was interested in publishing it.  They all claimed that it was a very difficult book to place.  As a result, once more, I decided to publish it myself.

But while I was looking for a publisher for my Java book, I started working on another puzzle: CalcuDoku (see several recent articles in this blog).
I developed a program to generate and solve CalcuDokus, but this time I decided not to write books that explain how the programs work.  Similarly to what I had done with Sudokus, I wrote a program to compose CalcuDokus into larger puzzles.

Over the past couple of months, I have published three books of puzzles: 200 Puzzling Hearts, with 200 heart-patterned easy Sudokus, 200 Puzzling Shamrocks, with 200 difficult Sudokus patterned like four-leafed clover, and 100 Double CalcuDokus.

     

I am currently publishing what is going to be my last puzzle book (at least, that's what I am thinking now): 50 Samurai CalcuDokus.  This book has a larger format because the samurai puzzles are LARGE!



Next year, I will have to work on something else.  I confess that I feel a bit saturated with puzzle programming.  Perhaps, I will resume writing my historical novel Ciao Biondina.  But also a crime novel or an alternate history might inspire me.  We shall see...

Thursday, December 8, 2011

Double CalcuDoku #2

I can now generate Double CalcuDokus with any overlapping, although, at least for the time being, the overlapping region can only be a square.  Here is an example of a 6x6 overlap:



I find puzzles with large overlaps more interesting. It makes it easier to exploit the fact that the cells of each row and columns that are not share must coincide.  For example, in the above example, the three bottom cells of the middle column of the right puzzle include two singles: a 4 and a 2.  This means that also the top three cells of the same column must include a 4 and a 2.  As the 2-cell cage "9x" cannot possibly contain an even digit, it means that the they must be in the other two cells.

And here is an example of a 7x7 overlap:



The "edge effect" is particularly strong when the overlapping is 7x7, and makes the solution of the overall puzzle easier.  To keep the difficulty at a challenging level, I have therefore tweaked the configuration parameters and made the individual puzzles a bit more difficult.  Notice that in the above example there are three 5-cell cages and seven 4-cell cages.

I have just published a book with one hundred puzzles:


You can buy it in print from Lulu for US$9.99 or in several eBook formats from Smashwords for US$0.99.

Friday, December 2, 2011

Double CalcuDoku

I imagine that you are familiar with the double Sudokus like the following one:



I though: wouldn't it be nice to make overlapping CalcuDokus? Well, here is the first one I generated:


As you can see, I overlapped a 3x3 area. To explain how this works, I have coloured the puzzle, which is normally in B&W. The two squares are two normal CalcuDokus, but the green area belongs to both the yellow and the blue puzzles.

Notice that cages can cross the boundary. For example, the right-side cell of the 2-cell cage "2:" belongs to both puzzles, while its left-side cell only belongs to the yellow puzzle.

As I don't like puzzles that admit multiple solutions, I ensured that the program delivers a unique solution. The interesting thing with overlapping CalcuDokus is that they can overlap by any amount of rows and/or columns, while Sudokus, to maintain the integrity of the boxes, can only overlap by 3 or 6 rows and/or columns.

For the time being, my program only supports an overlapping of 3 rows and 3 column, but I am going to parameterise it. Then problem is not in generating and solving the puzzle, but in displaying it.

Concerning the name to give to these puzzles, I thought that Niken would be a nice possibility. This is because "Ni" means "two" in Japanese and KenKen (which is a registered trademark of Nextoy LLC) is much more widely known than CalcuDoku. In any case, "CalcuDoku", as a name, is quite long on its own. As "Ken" is a normal Japanese word (which, as you probably know, means "wisdom"), I don't believe that Nextoy could accuse me of infringing their trademark. I could also call it KenTwo or TwoKen but, somehow, it doesn't seem right. Also Kenni is not good. What do you think?

Saturday, November 26, 2011

KenKen and CalcuDoku

I found three websites that let you play daily KenKen (® Nextoy LLC) /CalcuDoku puzzles: kenken.com, calcudoku.org, and my website zambon.com.au.

While the other two websites include puzzles of different sizes, and calcudoku.org also includes variants, my website only includes 9x9 puzzles. KenKen and CalcuDoku are the same puzzle, but their implementation is done by different people. Each implementation has a different feel and, on average, different levels of difficulty.

I know how my puzzles are developed, but, obviously, I have no idea what algorithms the other developers use. I thought it would be interesting to identify some of the differences from a statistical point of view.

For this purpose, I analysed 10 puzzles taken from each website. I know that 10 is too small a sample to make good statistics, but it was a lot of counting...

Anyhow, what follows is a summary of what I came up with. To avoid repeating the domain names, I will use K to identify kenken.com, Z for zambon.com.au, and C for calcudoku.org. ‘A’ indicates values obtained by averaging all. The triplets of numbers indicate minimum, average, and maximum values.

Number of cages: K=[31, 33.2, 38]; Z=[32, 34.3, 37]; C=[33, 34.2, 35]; A=[32.0, 33.9, 36.7].

The average number of cages is for everyone around 34. But it is interesting to note that K's spread is 7, Z's is 5, and C's only 2. This might indicate that, while K and Z do not set any limits to the number of cages, C determines the cages not completely as a result of random choices. This might be consistent with the fact that C sometimes presents puzzles that have the cages arranged in particular patterns (although none of the puzzles I randomly picked belonged to that group). It would be interesting to know what Patrick (C's developer) would have to say about this.

With larger samples, I expect that Z's (i.e., my) number of cages would turn out to be normally (i.e., randomly) distributed. Actually, as I generate the puzzles, I don't need to do the counting, because the computer automatically lists for the number of cages. I can check it out right now.

...

It turns out that the number of cages calculated for 100 Z's puzzles is [32, 34.83, 38].

The following image shows how the normal distribution (the magenta squares) fits to the measured values (the blue diamonds; these are the default of Excel and I didn't bother to change them). The vertical bars represent a standard deviation from the normally distributed values. In other words, if the distribution reflects reality, there is a 68.2% probability for each measurement to fall within the bars. At the very least, the plot confirms that the number of cages in my puzzles is not in disagreement with a normal distribution. I confess I would have been shocked if it had not been so, because the distribution is the result of several [pseudo]random choices...


The following table summarises the counts of operation codes and cage sizes.


C has about 6 times the number of 1-cell cages that K and Z have, and half the number of 2-cell cages.  I will go out on a limb and say I believe that such differences are not due to statistical fluctuations within the samples. C also seems to have fewer divisions (1.3 vs. 3.5 and 5.5) and more cages with more than 3 cells (6.4 vs. 3.1 and 3.9). It seems reasonable to assume that the lower number of divisions (and perhaps subtractions) is due to the lower numbers of 2-cell cages.

In general, I have the impression that C's puzzles are more difficult than those of K and Z, and it seems reasonably safe to assume that the higher number of large cages is a contributing factor.

To deduce more from such a small sample would be inappropriate.

Tuesday, November 1, 2011

You can buy CalcuDoku for the iPad

My application to play CalcuDoku on the iPad is finally available in the iTunes App Store:



You can also check it out on itunes.apple.com

What are you waiting for?  http://planetsmilies.net/happy-smiley-567.gif

Saturday, October 22, 2011

The CalcuDoku application for the iPad is ready

I have just uploaded the CalcuDoku application for the iPad to Apple’s application store.  They could still find something I didn’t do right and reject it, but I think (and hope) that everything will go smoothly.  I don’t know how long it will take before it will appear in the AppStore, though...

Unfortunately, I am also not sure that it will be available in the Australian Apple store.  The problem is that I am not registered for GST (for the non-Australians: GST stands for Goods and Services Tax and is Australia’s 10% value-added tax).  It is only compulsory to register for GST if your Australian business revenue exceeds 75 kAUD, and it is such a bureaucracy that you don’t really want to get into it unless you do have such an income and/or incur significant GST-deductible expenses.

It is not clear to me whether Apple will simply not pay me when they sell my application in Australia or (more likely) the Australian residents will be unable to buy the application locally.  In any case, they should still be able to buy it from the US store for USD 0.99 instead AUD 0.99 (actually a cent or two cheaper).  We shall see.

Now that this application is done, I will go back writing fiction.  I confess I am a bit fed up with programming.  As I said in a previous article, Apple’s development environment is great, but not bug-free.  In a couple of occasions, I had to find some workarounds to get done what I needed.