Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.71 KB | None | 0 0
  1. class CharHiveBot() {
  2.     CharHiveBot(string[] words, char letter, Event anotherBotFoundWord)
  3.     string solveWord();
  4. }
  5.  
  6. /*
  7. == Problem statement =
  8. 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.
  9. The Event parameter can be used to communicate to other bots that the word has been found.
  10.  
  11.  
  12. == Example usage =
  13. Assume N = 3 for the following example.
  14.  
  15. words := [CAT DOG HAS MAX DIM TAG]
  16.  
  17. CharHiveBot D = CharHiveBot(words, 'D');
  18. CharHiveBot O = CharHiveBot(words, 'O');
  19. CharHiveBot G = CharHiveBot(words, 'G');
  20.  
  21. assert(D.solveWord()) == assert(O.solveWord()) == assert(G.solveWord()) == "DOG"
  22. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement