Welcome to the Game of Harakka.
Enter the desired number of rows and columns: 5 8

 1  2  3  4  5  6  7  8 
 9 10 12 20 13 14 15 16 
17 11 27 21 30 23 31 24 
25 18 26 19 28 22 38 32 
33 34 35 36 29 37 39 40 

Enter move (or 0 to quit): 23

 1  2  3  4  5  6  7  8 
 9 10 12 20 13 14 15 16 
17 11 27 21 30 22 23 24 
25 18 26 19 28 38 31 32 
33 34 35 36 29 37 39 40 

Enter move (or 0 to quit): 21

 1  2  3  4  5  6  7  8 
 9 10 12 20 13 14 15 16 
17 11 27 19 21 22 23 24 
25 18 26 28 30 38 31 32 
33 34 35 36 29 37 39 40 

Enter move (or 0 to quit): 11

 1  2  3  4  5  6  7  8 
 9 10 12 20 13 14 15 16 
17 18 11 19 21 22 23 24 
25 26 27 28 30 38 31 32 
33 34 35 36 29 37 39 40 

Enter move (or 0 to quit): 12

 1  2  3  4  5  6  7  8 
 9 10 11 12 13 14 15 16 
17 18 19 20 21 22 23 24 
25 26 27 28 30 38 31 32 
33 34 35 36 29 37 39 40 

Enter move (or 0 to quit): 30

 1  2  3  4  5  6  7  8 
 9 10 11 12 13 14 15 16 
17 18 19 20 21 22 23 24 
25 26 27 28 29 30 31 32 
33 34 35 36 37 38 39 40 

You have solved the puzzle!