Hi All,
I have a simple question, I hope.
Here's the overview of the problem:
"There is a board game with 9 squares on it (three rows of 3 squares). Each square has a coin on it. The coins can be either heads or tails side up. You can only flip the coins that are heads, but when you do flip a head, the immediate coins to the left, right, above and below this coin also flip. However, if the coin being flipped is on the edge of the board, then you do not wrap around. For example, if the coin is in the center of the board, then there are 4 other coins that flip with it. If the coin is in the top right corner, then only two other coins flip with it."
There is an input file with 10 different "boards" in it. Represented as follows:
T T H
H T H
H H H
My Problem is how to load this file into my 2D array and let the compiler know if its a head or a tail? I was thinking of representing H with a 1 and T with a 0, but don't have an idea on how to go about it. I'm pretty sure I have an idea on what to do on the rest of the problem, but this starting step is giving me some trouble.
If you have any ideas on how to go about it please advise me on it. I'm not asking for you guys to write the whole program for me :), just this starting step. How to load an input file with ten boards of similar design represented above and how to let compiler know if its a head or a tail. Of course tips on other parts of the program will be appreciated :)
Thanks for your time,
bratok