Details
Numbrix is a logic puzzle game where the goal is to fill the empty squares
in a grid with unique, consecutive numbers that are horizontally or
vertically adjacent. Each puzzle begins with a number of arbitrary squares
in a pattern already occupied by unique numbers, but not necessarily
consecutive to other numbers in potentially adjacent squares.
For example, take the following starting pattern:
┏━━━━┯━━━━┯━━━━┯━━━━┯━━━━┯━━━━┯━━━━┯━━━━┯━━━━┓
┃ │ │ │ │ │ │ │ │ ┃
┠────┼────┼────┼────┼────┼────┼────┼────┼────┨
┃ │ 11 │ 12 │ 15 │ 18 │ 21 │ 62 │ 61 │ ┃
┠────┼────┼────┼────┼────┼────┼────┼────┼────┨
┃ │ 6 │ │ │ │ │ │ 60 │ ┃
┠────┼────┼────┼────┼────┼────┼────┼────┼────┨
┃ │ 33 │ │ │ │ │ │ 57 │ ┃
┠────┼────┼────┼────┼────┼────┼────┼────┼────┨
┃ │ 32 │ │ │ │ │ │ 56 │ ┃
┠────┼────┼────┼────┼────┼────┼────┼────┼────┨
┃ │ 37 │ │ 1 │ │ │ │ 73 │ ┃
┠────┼────┼────┼────┼────┼────┼────┼────┼────┨
┃ │ 38 │ │ │ │ │ │ 72 │ ┃
┠────┼────┼────┼────┼────┼────┼────┼────┼────┨
┃ │ 43 │ 44 │ 47 │ 48 │ 51 │ 76 │ 77 │ ┃
┠────┼────┼────┼────┼────┼────┼────┼────┼────┨
┃ │ │ │ │ │ │ │ │ ┃
┗━━━━┷━━━━┷━━━━┷━━━━┷━━━━┷━━━━┷━━━━┷━━━━┷━━━━┛
Suppose a player starts the puzzle at number '1', then the player can reach
number '6' via four valid paths:
- Up → Up → Up → Left → Left
- Left → Up → Up → Up → Left
- Up → Left → Up → Up → Left
- Up → Up → Left → Up → Left
When the above puzzle is solved, it might look something like this:
┏━━━━┯━━━━┯━━━━┯━━━━┯━━━━┯━━━━┯━━━━┯━━━━┯━━━━┓
┃ 9 │ 10 │ 13 │ 14 │ 19 │ 20 │ 63 │ 64 │ 65 ┃
┠────┼────┼────┼────┼────┼────┼────┼────┼────┨
┃ 8 │ 11 │ 12 │ 15 │ 18 │ 21 │ 62 │ 61 │ 66 ┃
┠────┼────┼────┼────┼────┼────┼────┼────┼────┨
┃ 7 │ 6 │ 5 │ 16 │ 17 │ 22 │ 59 │ 60 │ 67 ┃
┠────┼────┼────┼────┼────┼────┼────┼────┼────┨
┃ 34 │ 33 │ 4 │ 3 │ 24 │ 23 │ 58 │ 57 │ 68 ┃
┠────┼────┼────┼────┼────┼────┼────┼────┼────┨
┃ 35 │ 32 │ 31 │ 2 │ 25 │ 54 │ 55 │ 56 │ 69 ┃
┠────┼────┼────┼────┼────┼────┼────┼────┼────┨
┃ 36 │ 37 │ 30 │ 1 │ 26 │ 53 │ 74 │ 73 │ 70 ┃
┠────┼────┼────┼────┼────┼────┼────┼────┼────┨
┃ 39 │ 38 │ 29 │ 28 │ 27 │ 52 │ 75 │ 72 │ 71 ┃
┠────┼────┼────┼────┼────┼────┼────┼────┼────┨
┃ 40 │ 43 │ 44 │ 47 │ 48 │ 51 │ 76 │ 77 │ 78 ┃
┠────┼────┼────┼────┼────┼────┼────┼────┼────┨
┃ 41 │ 42 │ 45 │ 46 │ 49 │ 50 │ 81 │ 80 │ 79 ┃
┗━━━━┷━━━━┷━━━━┷━━━━┷━━━━┷━━━━┷━━━━┷━━━━┷━━━━┛
Given a nine-by-nine grid with a starting pattern, print a solved Numbrix
puzzle.
External links:
Parade,
Rosetta Code,
Wikipedia
05AB1E is an experimental language, solutions won't contribute to
scoring until the language goes live. Please leave feedback on the
GitHub issue.
ALGOL 68 is an experimental language, solutions won't contribute to
scoring until the language goes live. Please leave feedback on the
GitHub issue.
APL is an experimental language, solutions won't contribute to
scoring until the language goes live. Please leave feedback on the
GitHub issue.
Arturo is an experimental language, solutions won't contribute to
scoring until the language goes live. Please leave feedback on the
GitHub issue.
Befunge is an experimental language, solutions won't contribute to
scoring until the language goes live. Please leave feedback on the
GitHub issue.
BQN is an experimental language, solutions won't contribute to
scoring until the language goes live. Please leave feedback on the
GitHub issue.
CJam is an experimental language, solutions won't contribute to
scoring until the language goes live. Please leave feedback on the
GitHub issue.
CoffeeScript is an experimental language, solutions won't contribute to
scoring until the language goes live. Please leave feedback on the
GitHub issue.
Egel is an experimental language, solutions won't contribute to
scoring until the language goes live. Please leave feedback on the
GitHub issue.
Fennel is an experimental language, solutions won't contribute to
scoring until the language goes live. Please leave feedback on the
GitHub issue.
Harbour is an experimental language, solutions won't contribute to
scoring until the language goes live. Please leave feedback on the
GitHub issue.
Hare is an experimental language, solutions won't contribute to
scoring until the language goes live. Please leave feedback on the
GitHub issue.
Haxe is an experimental language, solutions won't contribute to
scoring until the language goes live. Please leave feedback on the
GitHub issue.
Hush is an experimental language, solutions won't contribute to
scoring until the language goes live. Please leave feedback on the
GitHub issue.
Hy is an experimental language, solutions won't contribute to
scoring until the language goes live. Please leave feedback on the
GitHub issue.
iogii is an experimental language, solutions won't contribute to
scoring until the language goes live. Please leave feedback on the
GitHub issue.
Knight is an experimental language, solutions won't contribute to
scoring until the language goes live. Please leave feedback on the
GitHub issue.
Luau is an experimental language, solutions won't contribute to
scoring until the language goes live. Please leave feedback on the
GitHub issue.
Odin is an experimental language, solutions won't contribute to
scoring until the language goes live. Please leave feedback on the
GitHub issue.
Picat is an experimental language, solutions won't contribute to
scoring until the language goes live. Please leave feedback on the
GitHub issue.
Qore is an experimental language, solutions won't contribute to
scoring until the language goes live. Please leave feedback on the
GitHub issue.
Racket is an experimental language, solutions won't contribute to
scoring until the language goes live. Please leave feedback on the
GitHub issue.
Rebol is an experimental language, solutions won't contribute to
scoring until the language goes live. Please leave feedback on the
GitHub issue.
Rexx is an experimental language, solutions won't contribute to
scoring until the language goes live. Please leave feedback on the
GitHub issue.
Scala is an experimental language, solutions won't contribute to
scoring until the language goes live. Please leave feedback on the
GitHub issue.
Squirrel is an experimental language, solutions won't contribute to
scoring until the language goes live. Please leave feedback on the
GitHub issue.
Stax is an experimental language, solutions won't contribute to
scoring until the language goes live. Please leave feedback on the
GitHub issue.
Uiua is an experimental language, solutions won't contribute to
scoring until the language goes live. Please leave feedback on the
GitHub issue.
Umka is an experimental language, solutions won't contribute to
scoring until the language goes live. Please leave feedback on the
GitHub issue.
Vala is an experimental language, solutions won't contribute to
scoring until the language goes live. Please leave feedback on the
GitHub issue.
Vyxal is an experimental language, solutions won't contribute to
scoring until the language goes live. Please leave feedback on the
GitHub issue.