So I am making a script to check whether a Sudoku is correct or not. The task is to check for duplicate numbers in the lines and columns, now for the columns the job was fairly easy using awk with sort and uniq. But to check for the lines is another thing..Since I can not use sort and the likes of that, keep in mind that my sed knowledge is pretty much nothing. Input:
5 3 4 6 7 8 9 1 2
6 7 2 1 9 5 3 4 8
1 3 8 3 4 2 5 6 7
8 5 9 7 6 1 4 2 3
4 2 6 8 5 3 7 9 1
7 1 3 9 2 4 8 5 6
9 6 1 1 3 7 2 8 4
2 8 7 4 1 9 6 3 5
3 4 5 2 8 6 1 7 8
Now on some of the lines there are duplicate numbers, and I want the output to tell something like
line 1 : good
line 2 : good
line 3 : bad
line 4 : good
line 5 : good
line 6 : good
line 7 : bad
line 8 : good
line 9 : bad