Giter Site home page Giter Site logo

c-sharp-hangman's Introduction

C-Sharp-Hangman

Assignment 2

Hangman

Your assignment is to create a game called Hangman. Hangman game is a pen and pencil guessing game for two or more players. You can read more about it https://en.wikipedia.org/wiki/Hangman_(game). One player (in our case the application) thinks of a word and the other player(s) tries to guess it by suggesting letters. The word to guess is represented by a row of dashes where each dash represents a letter in the word.

Game Rules to implement:

  • The player has 10 guesses to complete the word before losing the game.
  • The player can make two type of guesses: Guess for a specific letter. If player guess a letter that occurs in the word, the program should update by inserting the letter in the correct position(s).
  • Guess for the whole word. The player type in a word he/she thinks is the word. If the guess is correct player wins the game and the whole word is revealed. If the word is incorrect nothing should get revealed.
  • If the player guesses the same letter twice, the program will not consume a guess.

Code Requirements:

  • The secret word should be randomly chosen from an array of Strings.
  • The incorrect letters the player has guessed, should be put inside a StringBuilder and presented to the player after each guess.
  • The correct letters should be put inside a char array. Unrevealed letters need to be represented by a lower dash ( _ ).

Optional:

  • You unit tests need to have at least 50% coverage.
  • Read in the words from a text file with Comma-separated values and then store them in an array or list of Strings.

c-sharp-hangman's People

Contributors

michael-sjogren avatar

Watchers

James Cloos avatar  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.