The task is to create an extremely difficult to beat guessing game for a word. I have included some example code but not sure of how to go about doing it.
class myWords
{
// These two lists already store words and letters guessed as needed.
List<string> myWords = new List<string>();
List<char> allGuessedLetters = new List<char>();
}
So above are just two simple Lists that store our words for the user to guess (These will all be if the same length)
Say the word list contains: Belly, Telly, Happy, Toast, Eggsy, Teams
They would be split up like this and the biggest group of words would be updated to the currentWords list and the correct "guessed letters" would display to the user.
User guesses letter 'E' creates the following groups.
- E - - - , -> Group 1: Belly, Telly, Teams
E - - - - , -> Group 2: Eggsy
- - - - - , -> Group 3: Happy, Toast
So since Group 1 was the biggest. currentWords would now consist of: Belly, Telly, Teams. The following would be displayed to the user - E - - -
My Idea was to perform some form of Loop:
public void OurGroups()
{
List<string> wordGrouping = new List<string>();
foreach(string curWord in myWords)
{
// Split groups here
}
}