Git Product home page Git Product logo

hangmangame's Introduction

HangmanGame

Big Picture: Have you ever wanted to play a game of hangman but had no one to play it with?I will be programming a game of hangman which will use Turtle Programming to draw the “man” in the game with the appropriate number of limbs, etc. First the user will be prompted for a level of difficulty of the the word/ phrase choice, ranging from “easy”, “medium” and “hard”. This will generate a word with the appropriate number of blank spaces shown to the user based on the difficulty of word choice. The user will then input one letter at a time. If correct, all the letters in the word or phrase will appear on the screen. If incorrect, it will prompt the turtle program to open and draw the first element of the “man”, or the head in this case. After each input, the user will be asked if they want to guess the word, which they can answer either yes or no to. If they attempt to guess the word and are wrong, another element of the man will be drawn. After enough incorrect guesses where the drawing of the man is complete, the user will lose the game where an appropriate message will be displayed. If guessed correctly by the user’s input or if all the letters are guessed before the drawing is complete, it will display a “winning” message. In either case, the program will ask the user if they want to continue and play another game, in which the whole program will restart.

First Round:

First, user will only have choice of three different "easy" category words, only 5 letter ones. Then, from a random, predetermined list of words, user will be shown the appropriate number of letter slots for the mystery word. Then, the user will be prompted to enter a letter. If correct, the letter will appear in the appropriate slot, if incorrect, turtle in game will draw a single body part of stick figure, out of 6 different parts, which indicates 6 chances. After last chance, user will be asked if they want to guess word. If not answered correctly, player gets message that they lose. If word guessed correctly, player wins!

Testing Plan:

Test #1: User will begin the game, and and enter a letter. Test is success if turtle draws one body part of "man" if letter was incorrect. If guess was correct, then the letter will appear in the appropriate "slot." If word contains more than one of same letter, then all letters will appear and remain in appropriate slots for each successive guess.

Test #2: Mystery word will be printed. Then user will input wrong word, which then turtle must draw body part, and then user will enter correct word, in which WINNING message should be displayed.

Revisions:

I will try to adapt the game to not only have 5 letter words, use a loop in place of several iterations of something which can be condensed. Furthermore, I will not be simulataneously working on the display and game logic, instead I will work on the "logic" first and then translate that into an appropriate display. I will also adjust for the fact that my original plan did not address the possibility for multiple guesses - whether they may be correct or incorrect. For example, although there are only 6 body parts on the "man" this does not necessarily mean that the user will have 6 tries. for example, the user might input one incorrect guess, followed by 4 correct guesses, and 3 incorrect guesses. However after 6 inputs, they will not have lost the game, instead I need to adjust the program for 6 INCORRECT guesses overall. Also, the input message will be altered to guess a letter OR the word if the user feels they can guess it. An incorrectly guessed letter or word will still "count" as one drawn body part.

hangmangame's People

Contributors

anniepod avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.