Predictive Text Quick Reference

Understanding The Gamestate

Your calculateMove() function will be passed the current state of the game, the 'gameState'. The gameState is a python dictionary containing the following keys:

  • GameStatus - A string that will have value "RUNNING" if the game is in progress or a reason the game has ended otherwise.
  • Redacted - The list of sentences to identify either the missing two letter words or the incorrect two letter words. If the game type is missing words then each missing word will be identified in the list as '__'.
  • guesses - A two part list that contains your and your opponents current guesses. The position in the list is determined by your PlayerIndex value e.g. if you are PlayerIndex 0 then your list of guesses will be the first in the list.
  • EndTime - The epoch time, in milliseconds at which this game will end.
  • IsMover - A boolean that represents whether you can submit a guess. Always set to True as long as game is running.
  • PlayerIndex - Your player index reference this can be either 0 or 1.
  • GameId - An integer representing the unique game id for the current game.
  • OpponentId - A string containing the name of your opponent.

Understanding the List of Sentences

The list contained in Redacted is the list of words that make up each sentence.
For example if you are playing the missing word game your list of sentences could look like this:

[['Columbus', 'and', 'his', 'crew', 'knew', 'a', 'number', '__', 'things', 'before', 'they', 'raised', 'their', 'anchor.'], ['Through', 'the', 'brief', 'summer', 'the', 'family', 'had', '__', 'toil', '__', 'lay', '__', 'crops', 'against', 'the', 'long', 'hard', 'winter.'], ['Edge', '__', 'the', 'arch', 'between', 'the', 'pharynx', 'and', 'soft', 'palate.'], ['__', '__', 'very', 'extensible,', 'and', 'that', '__', 'what', 'made', '__', 'astonish', 'its', 'discoverers', '__', 'its', 'bouncing.'], ['They', 'give', '__', 'a', 'quality', '__', 'resilience,', '__', 'spring,', 'while', 'still', 'supporting', 'it.']]

Understanding the List of Guesses

Initially this will contain a list of empty strings with the correct number of entries depending on how many two letter words are in each sentence. Every time you or your opponent submit a guess this list will be filled out with the submissions.
So with a list of sentences as follows:

[['Columbus', 'and', 'his', 'crew', 'knew', 'a', 'number', '__', 'things', 'before', 'they', 'raised', 'their', 'anchor.'], ['Through', 'the', 'brief', 'summer', 'the', 'family', 'had', '__', 'toil', '__', 'lay', '__', 'crops', 'against', 'the', 'long', 'hard', 'winter.'], ['Edge', '__', 'the', 'arch', 'between', 'the', 'pharynx', 'and', 'soft', 'palate.'], ['__', '__', 'very', 'extensible,', 'and', 'that', '__', 'what', 'made', '__', 'astonish', 'its', 'discoverers', '__', 'its', 'bouncing.'], ['They', 'give', '__', 'a', 'quality', '__', 'resilience,', '__', 'spring,', 'while', 'still', 'supporting', 'it.']]

The list of guesses would initially look like this:
[[[''], ['', '', ''], [''], ['', '', '', '', ''], ['', '', '']], [[''], ['', '', ''], [''], ['', '', '', '', ''], ['', '', '']]]

Note there are two sets of guesses, one for you and one for your opponent. The position of your guesses is determined by your PlayerIndex value.

Submitting a guess

To submit a guess you need to give the position of the word and your guess. For example:

myGuess = [0,1,"it"]

would submit the answer "it" to sentence 0 missing/changed word number 1.
When the game is in play your answers along with your opponents will be displayed in the list of sentences.

Jargon:

  • Epoch time - The number of seconds (or in our case milliseconds) that have elapsed since January 1 1970 00:00 UTC.
iconPredictiveTextBlack.png
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License