|Enter a Puzzle Code||X|
Local storage is disabled in this browser.
Settings will revert to defaults when the next puzzle is loaded.
Zoom Board ([Shift-]Ctrl-Up/Down): This setting can only be changed with the keystroke sequences.
With the exception of Zoom Board, keystrokes will not execute commands or change settings. Keystrokes will still be processed by the browser.
Click the timer to pause/resume.
The position in the history can be used to identify positions in a puzzle. This setting can also be toggled by right-clicking the Toggle Bookmark button.
User input and solver output will be displayed in different colors.
Determines whether the mousewheel will execute undo/redo or goto previous/next bookmark (*).
X's drawn by undo or redo will be animated. All x's drawn by go to previous or next bookmark, or by the solver in some cases, will be animated if only x's are drawn.
If the solver mode is One Move, this setting is ignored and only non-trivial x's are displayed. If the Trivial option is selected, the solver writes no lines; it's mainly intended for use with auto-solve and the grid display.
Whenever the solver executes, a bookmark is added before the first move it makes and after the last move it makes. Use this setting to add a bookmark before every move (when the solver mode is Manual or Auto). (A 'move' can consist of multiple lines and/or x's.)
The remaining settings in this section will be ignored, except for 'Solve based on Only One Solution' if its value is 'Never'.
An 'x' will be placed where a line would complete a loop that is not the solution.
Deductions will be made based on the fact that the solution must pass through each row and column an even number of times (*).
Deductions will be made based on the puzzle having only one solution (*,*). All puzzles generated at this site are guaranteed to have only one solution. Select the 'Never' option if a puzzle (generated somewhere else) is not guaranteed to have only one solution. This will prevent the logic from being used when the solver is operating at full strength.
A few simple patterns will be used (*).
Horizontally or vertically adjacent threes (*), and diagonally adjacent threes (*), will be solved if this setting or Use Patterns is enabled. The latter will also be solved if Extended Logic is enabled.
If Use Patterns is enabled, this setting is ignored and extended logic is used. With Solve Loops on and this setting off, the solver completely solves all Easy and Normal puzzles of any size, but only about 2% of Hard 10x10's. With this setting on, that number jumps to 90%. Therefore, with Solve Loops and this setting on, clicking 'New' with auto-solve on will display a solved puzzle 90% of the time. The Skip Puzzles setting can be used to skip over the solved puzzles. (With the solver at full strength, the solve rate for Hard 10x10's is 99%.)
Whenever the board is changed by a mouse click or drag, and no position is locked, and the solution is unknown, the solver will attempt to solve the puzzle in the background. If successful, the Check button will flash green, and its icon will be replaced with the full size checkmark, indicating that the solution is known and more advanced error checking is available. That the solver could solve the puzzle also means that 1) no mistake has been made up to that point, and 2) it will always be possible to get a move by right-clicking the Solve button, or pressing Ctrl-V, unless a subsequent mistake is made. If one or more positions are locked, the solver will try to solve the puzzle when the positions are unlocked.
If Solved/Unsolved is selected, when a new puzzle is requested, puzzles will be generated - up to the maximum number, and within the maximum time - until one is produced that the solver - operating with current settings or at full strength - can't/can completely solve. This setting is ignored for Easy and Normal puzzles unless Solve Loops is disabled because they will always be solved. The average wait time for a puzzle increases with the size of the puzzle, mostly due to the increased time spent generating the puzzles. This feature is about as slow as expected in IE11 & IE10, but it's (currently) extremely slow in MS Edge. To see activity, open the Developers Console (F12) before clicking the 'New' button (or before loading the page).
How To Play
The solution to a Slitherlink puzzle is a single closed loop that passes through the indicated number of sides of every numbered square.:
To draw the loop, use left or right mouse clicks, or draw multiple connected lines or x's with a mouse button held down. X's are not part of the solution, but can be used in places that have been determined to be not part of the loop.
NOTE: The browser being used (Safari?) lacks a component (MouseEvent.buttons) that is necessary for drawing with a mouse button held down.
The generator used at this site produces puzzles that have only one solution, a fact that can sometimes be used to make deductions. (This is the norm.)
The Wikipedia Slitherlink page illustrates many basic deductions and patterns, and a couple of advanced strategies. This page contains several, more complex patterns. This page is an introduction to "shading," an elegant solving technique that is supported by this app.
If the Easy 3x3's generated here aren't simple enough to get started, these smaller puzzles may be of use: . (These puzzles were generated at this site.)
Commands & Settings
Ctrl-Up/Down: Zoom board in/out 1%.
Shift-Ctrl-Up/Down: Zoom board in/out 5%.
A: Toggle shading. A shade is applied to a square and indicates whether the square is inside or outside the loop that is the solution to the puzzle. Shades are not included in the history or in locks, and are not considered by the solver or error checker; they will be included in an exported SVG file. Shift-A: If there are calculated shades on the board, clear them; otherwise (turn shading on and) calculate the shades for the current position. Right-click the Toggle Shading button for the same command. The shades are calculated based only on existing lines and x's and trivial x's deduced by the solver. The only rule used is two adjacent squares with a line/x between them must have opposite/equal shades. This implies that no deduction can be made unless the shade of one of the two squares is known. At the start of the calculation, the squares with known shades are those shaded by the user, and the two rows and columns of virtual squares beyond the four sides of the board; the latter are outside the loop. No error checking is done. If a shade is produced that violates the one rule being used, it implies that there is an error on the board (an incorrect line or x).
T: Toggle display of the timer. Click the timer to pause/resume.
Shift-P: Toggle display of the position in the history (for identifying positions in the puzzle). Right-click the Toggle Bookmark button for the same command.
H: Scroll the 'highlight' setting. Highlight user input, solver output, or neither.
G: Toggle grid display. (The grid display is modelled on Simon Tatham's.)
Shift-A: Toggle animation of x's in the grid display. X's drawn by undo or redo will be animated. All x's drawn by go to previous or next bookmark, or by the solver in some cases, will be animated if only x's are drawn.
D: Toggle alternate normal display. Right-click the Toggle Grid button for the same command.
F: Scroll the font. One of the fonts is unavailable with Internet Explorer.
Shift-F: Scroll the darkening value of the current font. Values are 0, 10%, 20% ... 100%. There is a separate setting for each of the three fonts.
Shift-B: Scroll the container background color.
Left/Right, Ctrl-Z/Y: Undo/Redo. Shift-Left/Right: Go to start/end of user or solver set of moves. Right-click the Undo/Redo buttons for the same commands.
Up/Down: Go to previous/next bookmark. The beginning and end of the history function as bookmarks. If Up is pressed and all lines and x's disappear, that's why, just press Down to recover if it wasn't intended. Shift-Up/Down: Go to beginning/end of the history. Right-click the Previous/Next Bookmark buttons for the same commands.
Mousewheel Up/Down: Depending on the Mousewheel setting, either undo/redo or go to previous/next bookmark. If the setting is 'Default', if auto-solve is off, undo/redo, else go to previous/next bookmark. With the left or right button pressed, that behavior is reversed (move the mouse pointer away from the board before pressing the button; this may not work in Safari or IE).
Enter: Add/Remove bookmark at the current position in the history.
V: Execute the solver. Ctrl-V: Execute the solver at full strength for one move. Right-click the Solve button for the same command. Ctrl-Right-click the Solve button to execute the solver at full strength for as many moves as possible (the puzzle will be completely solved if possible).
Shift-V: Scroll the solver mode. 1 = solve one move when V is pressed, 2 = solve as much as possible when V is pressed, 3 = solve as much as possible automatically whenever the board is changed by a mouse click. 1 is the default.
Ctrl-Shift-V: Scroll the solver mode for locked positions.
Shift-E: Toggle extended logic (disabled by default). When the 'Use Patterns' setting is enabled, the 'Extended Logic' setting is ignored and extended logic is used.
Shift-L: Toggle the solving of loops - placing x's in places where a line would complete a loop that is not the solution (enabled by default).
Shift-R: Toggle the solving of rows and columns - making deductions based on the fact that the solution must pass through each row and column an even number of times (*) (disabled by default). See 'More about the solver', below, for info.
Shift-N: Toggle the use of patterns (disabled by default). See 'More about the solver' for info.
Shift-O: Scroll solving based on the puzzle having only one solution (*) (disabled by default). See Settings and 'More about the solver' for info.
Shift-X: Scroll the solver's "display x's" mode. 0 = no x's are added to the board; 1 = only non-trivial x's are added; 2 = all x's are added; 3 = only trivial x's - and no lines - are added. 2 is the default. 1 isn't working perfectly, some trivial x's are being added. If the solver mode is One Move, this setting is ignored and only non-trivial x's are displayed. 3 is mainly intended for use with auto-solve and the grid display.
Ctrl-B: Toggle the adding of a bookmark before every solver move.
1: Lock the current position.
2: Reset to the last locked position; if at the last locked position, unlock. A position can be locked at any point in the history, and if it's unlocked by a reset, the history will be unchanged.
3: Unlock all locked positions. After the positions are unlocked, the solver will execute if auto-solve is on.
4: Reset to the last locked position and switch the first move. Right-click the Reset button for the same command. If auto-solve is on, the solver will execute immediately after the switch. Because this command might inadvertently result in the loss of moves, it must be enabled with a setting.
Shift-4: Enable/disable Reset And Switch (disabled by default).
S: Save current puzzle to local storage in its current state. Right-click the 'Save' button, or choose 'Browse saved puzzles' from the More Commands menu, to load or remove saved puzzles. Click 'Export' for a set of links to all saved puzzles including histories. Click 'Import' to import puzzles that were previously exported, or to import puzzles from any block of text that contains puzzle codes.
Shift-S: Remove current puzzle from storage (if previously saved).
L: Load current puzzle (if previously saved). When a puzzle is drawn it will be loaded automatically if previously saved, unless the url contains a history. A puzzle is identified by its 'puzzle code', which is always included in the url (see Notes, below).
0: Clear the board. The history is also cleared.
Shift-0: Show the solution if it's known. The history and locked positions will be discarded, so save the puzzle first if that's not wanted.
M: Load the current puzzle at Simon Tatham's site (in a new tab or window) to view the solution, if necessary.
Spacebar: Search the puzzle for errors. If the solution is known (when the puzzle is drawn, the solver attempts to solve it in the background), the puzzle background will flash green or red, otherwise it will flash yellow or red. With Ctrl-Spacebar (or Right-click the Check button), the first search is for errors that can be determined without knowing the solution; the first such error found will blink. Then, if the solution is known, the first error added to the board will blink and remain highlighted. The main reason for the first search is that it's sometimes possible to draw a single loop that passes through the indicated number of sides of every numbered square – except one. And on large boards, that one square can be hard to find. (Here are two examples.) Whether or not the solution is known is indicated by the Check button. If the solution isn't known, the checkmark icon will be noticeably smaller than the other icons.
C: Toggle display of connected lines. When on, hover over a line to show all connected lines. This feature can be useful on large puzzles.
P: (Right-click 'New' for the same command.) Prompt for a puzzle code, and draw the puzzle. See the Notes section for the definition of 'puzzle code'. The best way to manually enter a puzzle code may be to use an 'a' for each blank square (e.g., '3aaa2' instead of '3c2') and a carriage return after each row (set 'Submit on Enter' to 'No', or use Shift-Enter). This way, if the code is entered correctly each line will have the same number of characters, which will be noticable. A minus sign or period can be used in place of 'a'. If this method is used, the width and height can be omitted from the textarea, in which case: 1) only these characters are permitted: ".-a0123" and Enter; 2) if the width is not specified above the textarea, it will be set to the length of the first line; 3) when a character is appended to the last line so that the length of the line becomes equal to the width, a carriage return will be appended automatically; 4) if a valid key is held down (after the width is known), the character will repeat only to the end of the line, making it easy to fill the remainder of a line with blanks; 5) the lines will be adjusted when characters are inserted or deleted anywhere in the puzzle code; 6) if the width and height are specified above the textarea, the puzzle code can be entered and submitted using only these keys: ".-a0123" (without pressing Enter or clicking Draw). If the width and height are specified in the textarea, all whitespace is allowed and ignored. If 'Submit on Enter' is set to 'No', Shift-Enter submits the puzzle code. The textarea is resizable, but apparently not in IE 11.
No Key: A few settings, including 'Skip Puzzles', can only be changed in the Settings window. Some commands cannot be executed with a keystroke.
This Slitherlink app features undo and redo with bookmarks, unlimited locked positions, and shading. Puzzles can be saved to local storage with their complete histories, and the saved puzzles can be browsed. Saved puzzles can be exported, and imported on a different machine. A link can be generated that will load the current puzzle in its current state with its complete history, allowing puzzles to be easily shared. A puzzle can be exported, in its current state, to an SVG file (image only, no script), which can be used in most contexts like any other type of image file. Puzzle codes can be entered, and effort was taken to make the manual entry of a puzzle code as efficient as possible.
The main feature is a rudimentary solver that can be executed while the user is solving a puzzle. It can be executed manually, as needed, or be set to execute automatically whenever the board is changed by a mouse click or drag. It can be set to execute a single move (the default), or as many moves as possible. It has six settings that determine the types of logic it uses, though it's always possible to execute it at full strength. When a puzzle is drawn, the solver attempts to solve it in the background, and if it succeeds the user can know at any time if and where a mistake has been made. If it doesn't succeed, the puzzle can still be checked for the types of errors that can be determined without knowing the solution.
The puzzle generator – written for Simon Tatham's 'Loopy' page by Mike Pinna and/or Tatham and made freely available by Tatham – allows the user to select from four levels of difficulty. The solver completely solves all 'Easy' and 'Medium' puzzles, of any size, so beginning players will always be able to check for errors and click for a move when stuck. More advanced players may want to set the solver to execute automatically (on 'Hard' puzzles or puzzles obtained from other sites), to skip over the easier moves and go straight to the more difficult positions.
The solver has two levels of logic: basic and extended. In the extended logic mode (which is not the default), with 'Solve Loops' enabled, it will completely solve over 90% of Hard 10x10 puzzles, compared to only 2% in the basic mode. In either mode, with 'Solve Loops' enabled, it completely solves all Easy and Normal puzzles, of any size, so playing with auto-solve will only make sense with Hard or Tricky puzzles. To avoid displaying puzzles that have been completely auto-solved, a setting - 'Skip Puzzles' - can be used to pass over puzzles that can be completely solved with current settings. See the second note in the Notes section for a brief description of how the solver operates. (With the solver at full strength, the solve rate for Hard 10x10's is above 99%.)
When the solver deduces an error (and makes a mess on the board) it implies that, at some point, a mistake has been made by the user. (The mistake can be in a puzzle code that was entered manually.) Before every release, the solver is tested on a batch of 90,000 puzzles, so the possibility that it is making an invalid deduction is virtually zero.
The app was developed on a laptop, and has not been tested on any handheld device.
What is a 'puzzle code'?
A 'puzzle code' is in the form: WxHdD:S, where W and H are integers indicating the width and height of the board (in squares, not points), D is a digit from 0 to 3 indicating the difficulty of the puzzle, and S is a string of characters that indicates where the numbers are placed on the board, from left to right and top to bottom. A lower case letter is used to indicate one or more blank squares: a = 1, b = 2, etc. Some sites require a letter for blank squares following the last number; here it's optional. The two characters indicating difficulty will be recongnized only at this site, and can be omitted.
For example, the code for the following puzzle is 6x4:e3b2e02233b1b.
In addition to Simon Tatham's site, a puzzle code can be entered at this site, which also features a very fine generator and solver. Currently, both sites will ignore the characters indicating difficulty.
More about the solver
With its 'basic' and 'extended' logic, the solver only makes deductions that are possible while looking at one point or one square at a time. When it looks at a square, it considers the number of the square (0, 1, 2, 3, or blank), the four sides of the square, and the eight external grid segments intersecting its four corners. For each square, it reads from, and writes to, only these twelve grid segments. The difference between 'basic' and 'extended' logic is that the former reads only lines and x's that have previously been written to the board (by the solver or user), and writes only lines and x's to the board, whereas the 'extended' mode extends the same logic by writing and reading pseudo lines and x's. If 'Use Patterns' is enabled, the solver also looks at the four neighbors of each square (there is a virtual row/column of blank squares on each side of the board) - the number and the four sides of each neighboring square.
With the default settings, aside from 'Solve Loops', there are only two cases where the solver considers the numbers of more than one square to make a deduction: at the start of execution - before it starts to iteratively scan the board - it looks for horizontally or vertically adjacent 3's and diagonally adjacent 3's. (The latter is also solved by the extended logic.)
In the three sections that follow, live puzzle boards are used for examples. After clicking on a link, click Next Bookmark or right-click Solve for the next move. Here, with the mouse pointer positioned over a board - popup or embedded - the corresponding keys are Down-Arrow and 'V' (the solver will be at full strength), but the mousewheel will be most efficient; roll it down to see the next move. Except in the 'Solve Rows and Columns' section, executing the solver after the first move may produce errors because the boards have multiple solutions and the 'Solve based on Only One Solution' logic is enabled. Whenever the mouse pointer passes into a board, it will be reset to its initial position.
If the 'Solve Loops' setting is enabled (the default), the solver looks for individual grid segments that would complete a loop if they contained a line. If the loop would be a solution to the puzzle, a line is drawn, otherwise an 'x' is drawn.
The solver doesn't use trial and error.
The app is much slower in IE11 & IE10 than in Chrome or Firefox.
It seems that the puzzle generator is running extremely slow in MS Edge, making the 'Skip Puzzles' feature practically unusable. (Nov 8, 2018)
During testing, using Chrome, local storage became corrupted such that some saved puzzles could not be deleted. If that happens, clicking here should fix the problem. (Oct 2, 2017)
In the 'Saved Puzzles: Export' window, Select All doesn't work consistently in Chrome. Click anywhere except on a button or link before clicking the Select All button and it will work. Also in Chrome, Ctrl-C isn't copying the selected links to the clipboard; the copy must be done with the context menu (right-click). (Oct 2, 2017)
After switching from the grid display to the normal display, IE (v11.0) does not display x's correctly. This doesn't happen in Chrome, Firefox or Opera. The problem is resolved when the page is reloaded. (Mar 21, 2017)
If the height of a puzzle is large enough to necessitate a vertical scrollbar, Firefox (v50.1.0) will also add an unnecessary horizontal scrollbar, making less of the puzzle visible. This doesn't happen in Chrome, Opera or IE. (Jan 8, 2017)
Bug reports and comments can be mailed to firstname.lastname@example.org.