Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CharHiveBot() {
- CharHiveBot(string[] words, char letter, Event anotherBotFoundWord)
- string solveWord();
- }
- /*
- == Problem statement =
- An N-length word is chosen from a list and each letter is assigned to a bot. There are N bots. Implement the solveWord function so that it returns the chosen word.
- The Event parameter can be used to communicate to other bots that the word has been found.
- == Example usage =
- Assume N = 3 for the following example.
- words := [CAT DOG HAS MAX DIM TAG]
- CharHiveBot D = CharHiveBot(words, 'D');
- CharHiveBot O = CharHiveBot(words, 'O');
- CharHiveBot G = CharHiveBot(words, 'G');
- assert(D.solveWord()) == assert(O.solveWord()) == assert(G.solveWord()) == "DOG"
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement