## Introduction

Futoshiki is a challenging logic game in which players use a combination of methods to solve a Latin square. Please refer to Figure 1. At the start of a game the program presents a 6x6 grid of squares. Most of these squares will be empty except for tiny candidate numbers along their top and bottom edges, but a few squares will already have their answers filled in. Between some pairs of squares the inequality symbols < and > are displayed to indicate the relative sizes of their answers. To solve the puzzle players must place each of the digits 1 - 6 exactly once in every row and column so that they are consistent with the given inequality symbols.

## Futoshiki Example

Figure 1. is a screen dump from futoshiki. The large digits are the current answers and the small digits are the remaining candidate answers for the individual squares. The inequality symbols < and > indicate the relative value of the answers to adjacent squares. Click to see an animation showing the use of the hint button to solve this complete puzzle. The delay between images is 2 seconds.

## Summary

The program starts with a randomly selected puzzle displayed. The possible candidate answers are written in the unsolved squares. These numbers are buttons: left-clicking will delete a candidate, middle-clicking on its position will rewrite it, right-clicking will set it as the answer and delete any other candidates present. These actions are sufficient to finish a puzzle. But, if stuck, players can request hints including: Simple Filter(SF), Relative Size(RS), Hidden Single(H1), Naked Pairs(N2), Naked Triples(N3), naked quad(N4), Hidden Pairs(H2), Hidden Triples(H3), X Wing(Xw).

Simple filter applies Exclusion Rule, and deletes candidates which are already set as answers to squares in the same row or column. Relative Size uses the < and > symbols between squares. The others are Sudoku methods. All of the programs 5000 built-in puzzles (1000 for each grid size) can be solved using the algorithms listed above. If the player right-clicks on the hint button, the program will repeatedly apply simple filter until it has no effect, clearing the candidates as it goes. Otherwise, a left click on the hint button will request a single hint. Hints are shown by highlighting the candidates that can be deleted in red and the reasons in green. While the hint is active (shown by the wand icon leaning backwards) clicking on the wand with the middle mouse button will cause a pop-up to appear containing a short explanation of the hint. A further left click will delete the red candidates and unhighlight the green candidates.

At the top of the display is a Toolbar. The jigsaw piece button at the left is a menu which has options for configuring the display and saving the current settings. A less than symbol is used for selecting a random puzzle from the programs built in puzzles; a wand for selecting and executing hints; a thumb for checking and correcting errors, and a sad smiley for showing the solution. To the right of this are 3 numbers. The first is the puzzle number, the next the puzzle difficulty and the next a clock which ticks every 5 seconds. The puzzle number display is also an input box: players can position the cursor over this area and type in a number between 0 and 999 followed by "Enter" to load the corresponding puzzle. When a hint is requested the clock display is used to show a 2-letter abbreviation for the name of the hint found. The program will not report errors until the player clicks on the thumb or requests a hint. Errors are reported by the thumb turning down and the incorrect squares being highlighted. A further click on the thumb will correct the error(s) and undo all subsequent changes. At any time, hitting "Enter" will restart the current puzzle.

## Font Size

The puzzle menu has an option to choose either large or small font. All screenshots shown in the web site are actual size for the small font. Click on the "small font" screenshot to see the same game using large font.

## Colours

Using an option in the puzzle menu players can set the colours of the boxes, the text, and the various highlights. The gaudy adjacent screenshot serves as a warning.

## Grid size

Using an option in the puzzle menu players can select to try puzzles with grid sizes ranging from 5 to 9. For each grid size the program has 1000 built-in puzzles. When the player requests a new game by clicking on the < symbol in the Toolbar the program will randomly select a puzzle for the current grid size. All the descriptions here assume a grid size of 6x6.

## Playing

Each of the squares which have yet to be given a value contain tiny "candidate" numbers 1-6. These are buttons which can be left clicked for removal or middle clicked for setting the number for the square. A right click will replace a deleted candidate. In this way they can be used as a simple notepad while working towards the solution for each square. If the player cannot make progress, hints are available.

## Using Hints

Hints are requested using the wand icon in the Toolbar. Two modes can be set via the "Hint Mode" option in the puzzle menu: either the program will find the "Simplest" hint or it will find the one which removes the most candidates ("Most Effective"). The simplest hint is the one with the lowest difficulty score. In both cases, if the Exclusion algorithm can operate, it will be given priority (this is because the coding of the other algorithms requires that all Exclusion operations are performed first).

When a hint is requested the program highlights, in red, the candidates which can be deleted and, in green, the reason. For example, in the adjacent Naked Pairs screenshot the 2 and 4 candidates highlighted in red can be deleted because 2 and 4 must be the answers for the squares where they are highlighted in green.

When a hint is requested the wand icon flips to its mirror image. If the player clicks on it while it is in that configuration the program will automatically remove all the candidates highlighted in red, unhighlight those in green, and the wand will revert to its normal orientation. Otherwise the player can delete the red candidates using mouse clicks.

## Hint Example

In row 6 there are two squares which contain only 2 different candidates (2,4, shaded green). As they are the only remaining candidates in these squares, they must be their answers. Therefore the other 2,4s in the row (shaded red) can be deleted.

Of course, use of the hint option is not obligatory and purists can work out everything for themselves and simply use the candidate buttons as notepad for each square.

## Checking for Errors

Clicking on the hand button causes the program to check the puzzle for errors (which can occur due to the player removing incorrect candidates). If errors are detected the hand will flip to the thumbs down position. A further click on the hand will reverse all moves made by the player, back to the last time the puzzle was error free. Note that when a hint is requested the program always checks the puzzle for errors first. If errors are detected no hint search will be performed, the hand will flip to thumbs down and the squares with errors will be highlighted.

## Difficulty Score

The Difficulty Score is the middle of the three numbers at the top of the games window. Because puzzles can be solved in many different ways, and players may find harder or easier ways than those the program used when it calculated the score, the Difficulty Score can only provide a rough indication of the difficulty. Nevertheless it does give a useful indication of the relative difficulty of puzzles.

Algorithm | Score(D) |
---|---|

Relative Values | 1 |

Hidden Singles | 2 |

Naked Pairs | 4 |

Naked Triples | 5 |

Hidden Pairs | 7 |

Hidden Triples | 8 |

Naked Quads | 8 |

X-Wing | 9 |

The score for a puzzle is calculated as follows. Let D_{i} be the
difficulty score for algorithm i, and N_{i} be the number of squares
algorithm i was successfully applied to in solving the puzzle.
The difficulty total for the puzzle is then the sum
of N_{i} x D_{i} for all i. The Difficulty Score is the difficulty total divided by the number of squares in the grid (to make the score independent of the grid size). During this analysis the program always uses the algorithm with the lowest difficulty score which is effective when applied to the current state of the grid.
The algorithms are explained by examples below.

## Algorithms

The algorithms used by Futoshiki are explained using examples. In the explanations, rows and columns are numbered from the bottom left hand corner of the grid, starting at 1,1. Candidates highlighted in green are the "reasons" that the candidates highlighted in red can be removed.

## Exclusion Rule

The exclusion rule: only one of each digit can occur in any row or column, so once an answer is set all other occurrences of that digit in its row or column can be deleted. The answer to column 6, row 5 is set to 5. Only one 5 can occur in each row, so all others 5s in row 5 can be deleted.

## Relative Size

The < and > symbols denote the relative size of the answer for a pair of cells. The answer to the square with the candidate shaded green is at least 2, but the < symbol shows that the answer for the square below is larger, so the candidates 1 and 2 in this square can be deleted.

## Hidden Single

Hidden single: all rows and columns must contain exactly one of each of the digits; if a cell contains the only remaining copy of a digit in a row or column, that digit must be the answer for that cell, and any other digits in that cell can be deleted. The square at row 6, column 4 contains the only remaining candidate 6 in row 6. Therefore it must be the answer for this square and all other candidates in the square can be deleted.

## Naked Pairs

Naked pairs: all rows, and columns must contain exactly one of each of the digits; if a pair of cells each contain only the same two digits, then those digits must be the answers for the two cells, and any other occurrences of those digits in the corresponding row or column can be deleted. In row 6 there are two squares which contain only 2 different candidates (2,4, shaded green). As they are the only remaining candidates in these squares, they must be their answers. Therefore the other 2,4s in the row can be deleted.

## Hidden Pairs

Hidden pairs: all rows and columns must contain exactly one of each of the digits; if a pair of cells contain the only copies of two digits in a row or column, those digits must be the answers for the two cells, and any other digits in those cells can be deleted. In column 6 only two squares still have candidates 5,6. So 5 or 6 must be the answers to these two squares and the other candidates in those squares can be deleted.

## Naked Triples

Naked triples: all rows and columns must contain exactly one of each of the digits; if three cells each contain only the same three digits, then those digits must be the answers for the three cells, and any other occurrences of those digits in the corresponding row or column can be deleted. In row 4 there are three squares which between them contain only 3 different candidates (1,2,3, shaded green). As they are the only remaining candidates in these squares, they must be their answers. Therefore the other 1,2,3s in the row can be deleted.

## Hidden Triples

Hidden triples: all rows and columns must contain exactly one of each of the digits; if three cells contain the only copies of three digits in a row or column, those digits must be the answers for the three cells, and any other digits in those cells can be deleted. In row 5 only three squares still have candidates 1,2,3. So 1,2 or 3 must be the answers to these three squares and the other candidates in those squares can be deleted.

## X Wing

X wing: all rows and columns must contain exactly one of each of the digits; if cells in two rows (or columns) contain the only copies of one digit in those two rows (or columns) and those four cells form a rectangle, then that digit is the answer for two of those cells, one in each of the intersecting columns (or rows), and other occurrences of that digit in the two columns (or rows) can be deleted. The candidates shaded green are the only 1s in columns 1 and 6. If 1 is the answer for row 1, column 1, then it is also the answer for row 6, column 6. Alternatively, if 1 is the answer for row 1, column 6, then it is also the answer for row 6, column 1. One of these two possibilities has to be the answer for these two columns. Either way, all the 1s in the intersecting rows (shaded red) can be deleted.