Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function checkRows : boolean;
- begin
- for i:=1 to 81 do
- begin
- if (length(ansArray[i]) = 1) then //if the string length is 1, the answer is decided. need to remove the number from the row
- begin
- row := (((i-1)/9)+1); //determines the row
- for v:=1 to 81 do
- begin
- if (row = (((v-1)/9)+1)) then //checks if the row of boxes 1-81 matches the row of the string above ^
- begin
- if not (v = i) then //if the box is not the same box as the correct string ^
- begin
- if not ((pos(ansArray[i], ansArray[v])) = 0) then //if the string can be found in any of the strings on the same row
- begin
- //writeln(ansArray[i]+' is at box '+inttostr(i)+' and removed from box '+inttostr(v)+' because they are at the same row');
- delete(ansArray[v], (pos(ansArray[i], ansArray[v])), 1); //finds and removes said string from the other string
- result := true;
- end;
- end;
- end;
- end;
- end;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement