// popWordpackWords gets X words from the wordpack. The major difference to
// popCustomWords is, that the wordlist gets reset and reshuffeled once every
// item has been popped.
popWordpackWords gets X words from the wordpack. The major difference to
popCustomWords is, that the wordlist gets reset and reshuffeled once every
item has been popped.
// popWordpackWords gets X words from the wordpack . The major difference to // popCustomWords is that the wordlist gets reset and reshuffeled once every // item has been popped .
func popWordpackWords(wordCount int, lobby *Lobby) []string {
	if len(lobby.words) < wordCount {
		var readError error
		lobby.words, readError = readWordList(lobby.lowercaser, lobby.Wordpack)
		if readError != nil {
			panic(readError)
		}
		shuffleWordList(lobby.words)
	}
	wordIndex := len(lobby.words) - wordCount
	lastThreeWords := lobby.words[wordIndex:]
	lobby.words = lobby.words[:wordIndex]
	return lastThreeWords
}
func popWordpackWords ( wordCount int , lobby * Lobby ) [ ] string { if len ( lobby . words ) < wordCount { var readError error lobby . words , readError = readWordList ( lobby . lowercaser , lobby . Wordpack ) if readError != nil { panic ( readError ) } shuffleWordList ( lobby . words ) } wordIndex := len ( lobby . words ) - wordCount lastThreeWords := lobby . words [ wordIndex : ] lobby . words = lobby . words [ : wordIndex ] return lastThreeWords }
popWordpackWords gets X words from the wordpack.
popWordpackWords gets X words from the wordpack .
//Since this list should've been successfully read once before, we //can "safely" panic if this happens, assuming that there's a //deeper problem.