RosettaCodeData/Task/Solve-the-no-connection-puzzle/00DESCRIPTION
2019-09-12 10:33:56 -07:00

55 lines
1.6 KiB
Text

You are given a box with eight holes labelled &nbsp; A-<small>to</small>-H, &nbsp; connected by fifteen straight lines in the pattern as shown below:
'''A''' '''B'''
/│\ /│\
/ │ X │ \
/ │/ \│ \
'''C''' ─ '''D''' ─ '''E''' ─ '''F'''
\ │\ /│ /
\ │ X │ /
\│/ \│/
'''G''' '''H'''
You are also given eight pegs numbered &nbsp; 1-<small>to</small>-8.
;Objective:
Place the eight pegs in the holes so that the (absolute) difference between any two numbers connected by any line is <u>greater</u> than one.
;Example:
In this attempt:
'''4''' '''7'''
/│\ /│\
/ │ X │ \
/ │/ \│ \
'''8''' ─ '''1''' ─ '''6''' ─ '''2'''
\ │\ /│ /
\ │ X │ /
\│/ \│/
'''3''' '''5'''
Note that &nbsp; '''7''' &nbsp; and &nbsp; '''6''' &nbsp; are connected and have a difference of &nbsp; '''1''', &nbsp; so it is &nbsp; ''not'' &nbsp; a solution.
;Task
Produce and show here &nbsp; ''one'' &nbsp; solution to the puzzle.
;Related tasks:
:* &nbsp; [[A* search algorithm]]
:* &nbsp; [[Solve a Holy Knight's tour]]
:* &nbsp; [[Knight's tour]]
:* &nbsp; [[N-queens problem]]
:* &nbsp; [[Solve a Hidato puzzle]]
:* &nbsp; [[Solve a Holy Knight's tour]]
:* &nbsp; [[Solve a Hopido puzzle]]
:* &nbsp; [[Solve a Numbrix puzzle]]
:* &nbsp; [[4-rings or 4-squares puzzle]]
;See also
[https://www.youtube.com/watch?v=AECElyEyZBQ No Connection Puzzle] (youtube).
<br><br>