Hello. I need a help.
There is a task for the last year Ukrainian school programming competition.
To create a program which takes an input where is 2 number (height and width of a game field). Then next lines the program takes an appearance of that field, where 'X' symbol is a barrier, '?' it's an unknown label. And '+' or '-' these are like 'X' and 'O' in a real game. The issue is to return this field without any '?' instead of '?' it must be '+' or '-' and it has to be eventually no winner and no losser. When you're a winner then it has to be more your labels in a filled row or a filled column. That's probably all. I rewrote lots of C++ code but it work only a little. I hope you'll help me:)
Here is exaples:
@whitenite1
I could show you my code, but I'm sure that's all wrong, because there should be some simple logic to solve this. I've done a two-dimensional array and just checked every row and column (rows and columns where instead of '?' it's doubtlessly '-' or '+' or both ++ or --). The code is about 200 lines, there are many 'for' loops. If you don't know how to solve it, I won't annoy you. I'm just preparing to the high programming competition and there are tasks like this. I've done a lot of similar tasks without any help but this task is so annoying.
( Program removed.. )
NOTE: Not even close to what OP wanted, but then, things wanted kept changing, or added to. Nowhere in the original help request was it mentioned that the user inputs and no random. Nowhere is it mentioned either, when the ?'s comes along. So, I'm giving up on solving, and deleted this program and the source on my HD.
Excuse me, but eventually using this code there is a winner but the issue is to print an output and there must be no winner and no loser (numbers of '+' and '-' equal in each row and column)
When that's a tie, then a number of + and - in each row and column is divided by two, because if it is not so, then for example:
4 2
??x?
????
Here the first row ??x? Has 3 unknown positions but always here must be a winner.
And the third column has 1 position.