Giter VIP home page Giter VIP logo

python-project-5's Introduction

Wordle in Python


This project is a fully functioning python wordle replica, in which players have 6 attempts to find a random 5 letter word. The user will type in a guess, hints will be visually displayed depending on the guess, and the player will try to get closer and closer to the game word.

The link to the deployed app can be found here.

The link to the Github repository can be found here.

mockup site generator image

Table of Contents

User Experience

Technologies Used

Features

Program Diagram

Testing

Site Deployment

Credits

User Experience


User Requirements

  • The app should have clear instructions on how to play the game
  • The app should have an option to play again
  • The letters should be coloured to provide hints on the word
  • The word_bank should have enough words for replayability

User Stories

  • I want to be able to see the correct word if I lose
  • I want to be able to play the game as many times a I want
  • I want to be provided visual hints after each guess

Technologies Used


-Heroku for the app deployment

-Python to build the program

-GitHub for software hosting

-GitPod for development hosting

-app.diagrams.net for the diagram

-fsymbols.com for the emojis and ascii art

-termcolor for coloring the letters

Features


Let's Play Wordle Screen

This is the first screen that prompts once the program is running. It displays a welcome message and a menu that gives the player the choice to play, see the instructions or quit.

wordle image

Instructions

If the player types 2, this set of prints will show, explaining in detail the rules of the game.

instructions image

Play The Game

This is when the game starts to unfold. After the user types a 5 letter word, that same word will be presented on screen with possibly some of the letters coloured. This works as a visual hint for the player. If the word is coloured yellow, they'll know that said letter is a part of the game word, but is in the wrong place. In the image below, we can see that n is not the last letter of the game word, so it must be somewhere else. If the letter is coloured green, then it is in the right place. For instance, using that same example, St are the first two letters of that word.

game image

End Game

If you get the word right, a congratulatory message will be displayed, followed by the possibility to play again. If the player can't guess the word in six attempts, another message shows to let them know they didn't get the word right. The play again prompt still appears in this case.

endgame image

Program Diagram


A diagram that breaks down the way the program works can be found in the image below.

diagram image

Testing


General Testing

To make sure the game is played properly, two validation blocks were included in the code. The first one ensures that, when the options menu appears, the only valid inputs are 1,2 or 3. Any other input will lead to a valueError and the user will be asked to input one of the available options.

menu-error image

The second validation block was put in place to make sure the word a player inputs is 5 letters long. If there was no limit to the number of letters, the player could just write the entire alphabet and find immediately which 5 letters are in the word. If a word of different lenght is input by the player, a valueError will be raised and they will be asked to type a 5 letter word.

word-error image

Validator Testing

Pep8- No errors were shown when put through the pep8 requirements test.

pep8 image

Site Deployment


This site was deployed to Heroku. The steps to deploy it were:

-Create a new app in Heroku

-In Settings, added PORT 8000 to config vars

-In Settings, press BuildPack, and add Python and Node.js

-In the Deploy tab, select the deployment method (github was used in this case)

-Click the connect button

-Choose manual or automatic deploy (manual was used in this ocasion)

Credits


Content

For this project, the following sources of information were used:

-Stackoverflow and w3schools for various code related doubts

-Youtube Python Tutorials

python-project-5's People

Contributors

franciscobarreira 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.