I'm trying to create a Kakuro with Pascal, the program should get the Kakuro empty (something like this) and return it completed (something like this). I already have loaded the data (from a file) and pass to one 2d array.
The problem I've found is related with the diagonally divided squares, I don't know how I can print this division and a number in each of the sides with Pascal console.
I've tried to use Pascal graphic libraries, but the alghoritm should run on several computers with diferent compilers and Pascal has not unified libraries, only crt and don't help with this (or I can't find it).
Also I try something like ASCII, creatings grid with -- and ’|` but when I print the values with two digits deform all the output, the code is this:
for c := 1 to maxc do
begin
for f := 1 to maxf do
begin
WriteLn('+---+');
WriteLn('|\',tablero[v,f,c],'|');
WriteLn('| \ |');
WriteLn('|', tablero[h,f,c], ' \|');
WriteLn('+---+');
end;
WriteLn();
end;
And the problem in the output you can see this:
+---+
|\-1|
| \ |
|23 \|
+---+
+---+
|\0|
| \ |
|0 \|
+---+
I thought of creating another 2d array inside my 2d array but if I do that I get something like:
+---+
| |
|---|
| |
+---+
Divided by half, and it need to be done diagonally, so doesn't work very well either.