towers-solver

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 8 Imported by: 0

README

towers puzzle solver

solve a towers puzzle

input format
n                      ; n: size               int
t1 t2 ... tn           ; ti: hint-top-side     []int
b1 b2 ... bn           ; bi: hint-bottom-side  []int
l1 l2 ... ln           ; li: hint-left-side    []int
r1 r2 ... rn           ; ri: hint-right-side   []int
c11 c12 ... c1n        ; cij: cell-matrix      [][]int
c21 c22 ... c2n
 ...
cn1 cn2 ... cnn
example
go run . < ./samples/sample-size5.in > ./samples/sample-size5.out
input
5
0 0 2 0 4
0 0 2 0 0
0 0 2 0 1
3 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 2 0
0 0 0 0 0
0 0 0 0 3
output
Problem
            2       4  
  ---------------------
  |   |   |   |   |   | 3
  |   |   |   |   |   |
2 |   |   |   | 2 |   |
  |   |   |   |   |   |
1 |   |   |   |   | 3 |
  ---------------------
            2

Number of Answer: 1
Answer No. 1
            2       4
  ---------------------
  | 2 | 5 | 3 | 4 | 1 | 3
  | 4 | 3 | 1 | 5 | 2 |
2 | 3 | 1 | 5 | 2 | 4 |
  | 1 | 4 | 2 | 3 | 5 |
1 | 5 | 2 | 4 | 1 | 3 |
  ---------------------
            2

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL