# A Shingoki Puzzle

This is a Shingoki puzzle.

Rules of Shingoki:

• Draw lines between the dots to form a single loop without crossings or branches.
• The loop should pass through every circled number in the grid.
• For white circles, the loop must pass through in a straight line.
• For black circles, the loop must make a 90-degree turn when passing through them.
• The numbers in the circles show the sum of lengths of the 2 straight lines going out of that circle.

An example is shown below for greater clarity.

Example Puzzle:

Shown below is the solution with some explanation:

Note how the total length is calculated for the '6' black circle and '5' white circle.

The actual puzzle to solve is shown below:

For your convenience, you may use this link, where a version of the puzzle has already been created using the penpa editor. Select "Mode" to be 'Edge' to draw the lines.

Good luck and have fun!

• In the example the line also goes through all the dots. I assume that is a requirement, correct? – hkBst Oct 22 '20 at 11:51
• @hkBst No, that is not a requirement. It just happened to be a coincidence in the example. – Alaiko Oct 22 '20 at 11:55
• (How were you able to place numbers on dots? I'm cooking up a shingoki puzzle too hehe) – oAlt Nov 7 '20 at 15:34
• @oAlt Using the penpa editor, select 'Border' to be "ON". Then, select Mode to be "Number". You will then see a small red square on the grid, which indicates where to place the number and you can use that to place numbers on the grid intersection points. You can look here for more information. – Alaiko Nov 8 '20 at 1:48
• yeah it works-- thanks :D – oAlt Nov 8 '20 at 3:41

The solution is:

Step 1:

Begin by extending lines through white circles on the edge, and radiating in from black circles on the edge. Black circles in corners can be extended in both directions.

The 9 in the top-left can be fully resolved, terminating a single dot away from the white 3 below it and the black 2 to its right (otherwise these smaller numbers would be violated). The 2 and 3 can then also be fully resolved, as can the white 3 in row 7. We can also place at least 3 line segments extending through the white 4 in row 2.

Now the black 5 at the end of row 3 can only extend at most 3 segments to the left (else it meets the line from the white 3, violating its constraint). It must therefore extend at least 2 segments down, since up is not an option (the line will end up trapped in a corner). But this means that the line snaking from the 2 in row 1 must extend down 1 unit further, meeting the line from the 5 and setting its length to 1. Thus we must have 4 units of line extending down from the 5.

This means that the black 3 at the end of row 9 can extend vertically at most 1 unit and must therefore extend 2 units to the left.

Meanwhile, the line through the white 7 on the bottom row can also be extended at least 3 spaces to the left (since only room for 4 on its right), and at least 3 to the right (since cannot meet the line coming from the 3 bottom-left). The black 3 above it can be partially resolved.

Step 2:

Note that the 2 at the end of row 10 can now only be resolved one way. This then resolves the white 7, the two black 3's in the bottom left, then the other numbers in the bottom-left corner section also.

Step 3:

Next, note that the white 5 cannot be satisfied horizontally, or the line extends through the nearby 4 and violates its constraint. It must therefore be crossed vertically instead. To avoid violating the black 2 below it, there is only one way to satisfy it. This forces the 2 to link to the nearby black 3 and also finalises the loop passing through the nearby 4, with knock-on deductions resulting in the top-right section being fully resolved.

Step 4:

The black 3 in line 3 must now have a line extending 2 spaces to the left (it can only extend 1 either up or down). This then forces the resolution of the white 4 in row 2 and has some knock-on effects for the black 3 and its neighbouring black 5.

Now the white 4 in row 5 can only be satisfied horizontally.

Step 5:

Now an interesting logical step: Consider what would happen if the black 5 were to be satisfied by extending the line downwards - we end up in an impossible position which separates the top and bottom of the grid into separate loops:

Thus the 5 must be completed using the line to the left instead.

Step 6:

The 4 loose points in the centre must all connect up to each other to avoid dead ends. Thus the rest of the grid can be resolved:

And now there is only one way to lay the last segments to keep one single loop!

• Well done! Very nice and easy to follow explanation. Btw, did you forget to place the completed grid at the end? – Alaiko Oct 21 '20 at 13:27
• @Alaiko Thanks - actually I deliberately left it out as it was already present at the start and it should be clear by eye which way the final 2 segments should go, I hope! :) – Stiv Oct 21 '20 at 13:30
• OK, yeah that's good enough! – Alaiko Oct 21 '20 at 13:31
• @Alaiko Deceptively tricky, by the way, to find the next logical steps at each stage. I'd never done one of these before - it was a very enjoyable challenge. Thanks for posting it! – Stiv Oct 21 '20 at 13:32

The best way to solve it would be to start with the circles on the edges.

If a white circle is on an edge you must have that the line passing through it is parallel to the edge.

If a black circle is on an edge you know that a line must go into it perpendicular to edge.

Following this and a bit of deduction you arrive at solution.

• I see two loops here, when the puzzle rules state there should be only one, right? – Braegh Oct 21 '20 at 12:34
• @Braegh Oh nice catch. Sorry, this is not the answer then. – Alaiko Oct 21 '20 at 12:49
• It would be good to show your deductive reasoning as well for a good answer. You could just add in the key steps. – Alaiko Oct 21 '20 at 13:21
• You're right. I was going to but someone beat me to it! – Rom Oct 21 '20 at 13:22