Skip to content

serpent7776/msquare

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

msquare

Small awk script solving following puzzle:

Input is a rectangle of numbers. First row and first column specify target sum of corresponding column/row. The task is to remove some values from rectangle so that sums of rows/column match with values given in first column/row. Values at first row/column cannot be modified.

#  4 10 6    -- these values specifies sums of corresponding columns
2  1 2  3
10 4 5  6
8  7 8  9

|
\- these values specifies sums of corresponding rows

Simple input data is given in simple.data file:

#  4 10 6
2  1 2  3
10 4 5  6
8  7 8  9

Feeding above file to msquare.awk with cat simple.data | awk -f msquare.awk will produce:

# 4 10 6
2 _ 2 _
10 4 _ 6
8 _ 8 _

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages