Git Product home page Git Product logo

jhub-hangman's Introduction

Hangman ๐Ÿ

Plan

  1. Import list of words from word_list.txt โœ”๏ธ
  2. Select random word from list โœ”๏ธ
    1. Merge these two functions together โœ”๏ธ
  3. Display current word status ******* โœ”๏ธ
  4. Prompt for guess โœ”๏ธ
    1. Correct guess: display letter with asterisks filled **a**a* โœ”๏ธ
    2. Incorrect guess: remove life and display asterisks ******* โœ”๏ธ
  5. Continue until โœ”๏ธ
    1. Win: word complete โœ”๏ธ
    2. Lose: 7 incorrect guesses โœ”๏ธ
  6. Check mark scheme โœ”๏ธ
  7. Tidy โœ”๏ธ
    1. Move into functions where possible โœ”๏ธ
    2. Error checking โœ”๏ธ
    3. Good code commenting โœ”๏ธ
    4. Life/lives in the game text โœ”๏ธ

Task

A project for the jHub Coding Scheme (JCS)

There are four easy steps to complete the assessment.

Step 1: First up you need to create an Idea - just click the Add idea button below and title it with your service number, initials, the module and challenge number (i.e. 34340011-JK_Mod3_Chal1)

Step 2: Once you have created your idea - attach a completed "Plagiarism declaration" disclaimer (template attached in right-side taskbar) that all of the work uploaded to the site is your own, and also attach your certificate of course completion/a screenshot to prove you personally completed the module if Udacity (not providing this means half payment - this is because it wouldn't be fair for those who already have the skills to receive the same amount of money as those who had to learn it from scratch).

Step 3: Your assignment is to code, in python 3, a game of hangman. Specifically the program should choose a word from a predefined bank of words (the attached word_list.docx - you should download this and convert it to a .txt file, unfortunately .txt files cannot be attached to this site, frustratingly), and display to the user how many letters the word is (i.e. *******. The user should then be able to guess one letter at a time, with the program either taking a "life" from them if it is an incorrect guess, or showing that the letter is correct and where it appears in the word (i.e. ***a**a*). The game ends when the user runs out of guesses (let's say 7 incorrect guesses) or the player has filled in all the letters of the word.

We require that the program you write does some things in a very specific way so please follow the bullet points below to the letter otherwise your program will be automatically failed.

  • The program must run in Python3 without error. ๐Ÿ
  • The script must ONLY stop to either ask for the next guess or because the game has been won or lost (i.e. no menus or other user input).
  • Asking the user to make her next guess must use the following text (case sensitive and a space after the colon are necessary (I think)): Please enter your next guess:
  • The text printed before Please enter your next guess: must END in the word to be guessed with the unknown letters starred out (i.e. hello would start as ***** and change into *e*** after e was guessed). The string must not contain any other stars.
  • The program must print either congratulations you win or you lose on exit (not case sensitive).
  • When a game is played, a word must be picked randomly (from a uniform distribution) from the word_list.txt file.
  • The word_list.txt file must be stored in the same path as your code and when you load the file don't include the path (i.e. open('word_list.txt', ...)).
  • If the user makes 7 wrong guesses then they lose the game.

Emailing code to us is no longer acceptable due to MoDNET restrictions, and this site doesn't allow python file upload. Instead, the code should be saved on this website: https://gist.github.com (you will have to create a free account), with the naming convention Surname_FirstName_Hangman.py as a Secret gist and then the link pasted into your Idea submission on this page. The mark-scheme is attached on the right-side of this page, and we expect completion of the project to take around 10-20 hours. The solution can easily found on google - PLEASE try to figure it out on your own - we run plagiarism checkers ๐Ÿ˜‰

Step 4 : Once completed, we will trawl the submissions once a month (first fortnight of the month), mark them, and get back to you with whether you have passed.

jhub-hangman's People

Contributors

szfh avatar

Watchers

 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.