My subject probably makes no sense, but I wasn't sure how to explain it.
I'm making a word search game. The game works great right now, but there is a ton of code and I am wondering if there is a way to shrink it.
I'm using an array to store a 1 or 0 value for each letter in the grid.
I am using that to check if a word is formed. When a letter is clicked on, it turns the array index of that letter to a 1.
Say the word is bat at position 1,2,3. I check if array.at(1) and array.at(2) and array.at(3) are = to 1. If so, that word is found. however, I also need a condition if all the other letters are set to 0. So for each word there is 26 lines of actions.
Is there anyway to shrink this? Eventually I would like to just create strings of data to build new boards and have a Key variable has the key for each board.
I hope that makes sense.