Getting the foundry a turn earlier is a bigger benefit than getting another population 1 turn earlier. The biggest problem with figuring out food vs production start strategies is that its very dependent on how many food/production you start with. A loss of 4 production, but you're ahead an entire turn of food production. If, instead, you spend 2 turns on food, and once you grow, switch both people to production, you get 8 food and 8 production in those 3 turns. If you spend 3 turns with your population on production, you get 12 production. With a decent food start, you should grow in 3 turns, 2 with your population working it. Chances are, unless you're playing the Wild Walkers, or got a really good start, your first building is going to take 9+ turns to complete.Įven if you put another guy on it, it'll take 6+ turns. SecretWord = chooseWord( wordlist).I disagree with #2 100%. # and run this file to test! (hint: you might want to pick your own # When you've completed your hangman function, uncomment these two lines Print( "Good guess: " + getGuessedWord( secretWord, lettersGuessed)) Print( "Oops! That letter is not in my word: " + getGuessedWord( secretWord, lettersGuessed)) Print( "Oops! You've already guessed that letter: " + getGuessedWord( secretWord, lettersGuessed)) PrintEachRoundResult( guessLeft, lettersGuessed) If isWordGuessed( secretWord, lettersGuessed): Print( "I am thinking of a word that is " + str( len( secretWord)) + " letters long.") Partially guessed word so far, as well as letters that theįollows the other limitations detailed in the problem write-up. * After each round, you should also display to the user the * The user should receive feedback immediately after each guessĪbout whether their guess appears in the computers word. * At the start of the game, let the user know how many Starts up an interactive game of Hangman. SecretWord: string, the secret word to guess. Print( "Available letters: " + getAvailableLetters( lettersGuessed)) Print( "You have " + str( guessLeft) + " guesses left.") Guess = input( "Please guess a letter: ")ĭef printEachRoundResult( guessLeft, lettersGuessed): RetList = list( "abcdefghijklmnopqrstuvwxyz") Returns: string, comprised of letters that represents what letters have not What letters in secretWord have been guessed so far.įor index, item in enumerate( secretWord):ĭef getAvailableLetters( lettersGuessed): Returns: string, comprised of letters and underscores that represents Returns: boolean, True if all the letters of secretWord are in lettersGuessed ĭef getGuessedWord( secretWord, lettersGuessed): LettersGuessed: list, what letters have been guessed so far SecretWord: string, the word the user is guessing # so that it can be accessed from anywhere in the programĭef isWordGuessed( secretWord, lettersGuessed): # Load the list of words into the variable wordlist Print( " ", len( wordlist), "words loaded.") Words are strings of lowercase letters.ĭepending on the size of the word list, this function may # but you will have to know how to use the functions # You don't need to understand this helper code,
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |