Giter Club home page Giter Club logo

stevealsamarae-python-msp3_aprresub's Introduction

Quiz Python Game

This is a quiz that runs in Python terminal via Heroku.

It is a simplistic quiz that consists of multiple questions, you can beat the computer by answering the questions correctly.

Live Version Of The Game

Thumbnail

How to play

Quiz game consists of 5 different questions, participant has to agree to start to the quiz, which in turn will allow the computer to start posing questions, if answered correctly, you get 1 point. User's final score will also be calculated in percentage.

Features

feature-1

  • Print welcome message in the terminal.
  • Computer automatically asks the participant if they would like to play.
  • If the input is yes, computer will then impose the first the questions.

feature-2

  • If the input is blank the program will prompt again with previous message/task giving a feedback.

feature-3

  • If the input is anything except [y|Y|yes|Yes|YES] the program will terminate giving a feedback.

feature-4

  • If the questions is answered correctly, the computer will then tell you "Correct!"
  • Computer then imposes the second question.

feature-5

  • If the question is answered incorrectly, the computer will then say "Incorrect!" and move on to the second question.

feature-6

  • Computer then generates the score, after all the questions answered.
  • Computer calculates your score in percentages.

Technologies Used

Testing

Lighthouse

  • Manually tested the code, found no bugs.
  • Ran the code through linter with no issues in return.

Code modifications

  • Changed the questions into 1 function
  • Added the questionsAsked variable
  • Edited the score equation
  • Created the main function
  • Created lists of questions & answers
  • Fixed allowance of empty data that causing program to break.
  • Added custom colors module to improve output by adding color.
  • Refactored code and renamed variables following PEP8 style guide.
  • Added user feedback for empty input with prompting again.
  • Enhanced quiz results output.
  • Updated terminal UI and UX.
  • Removed teminal focus after terminating the program.
  • Enhanced frontend for better user experience.

Bugs

  • All bugs found were fixed, such as idententation and terminal errors.

Valditor testing

  • No errors were found when passing through Pep8online.

Deployment

  1. Go to your Gitpod CLI and create a requirements file by typing 'pip3 freeze --local > requirements.txt' in the root directory.
  2. Next, create the Procfile by typing 'echo web: python app.py > Procfile' into the CLI root directory.
  3. Open this file and type the line 'web: python3 app.py'. Make sure you delete any blank lines at the bottom, then save the file.
  4. Add, commit and push your newly created files to your Github repository.
  5. Then, go to Heroku and create an account.
  6. After logging in, click on 'create new app'.
  7. Select the closest region to your location and give the app a name.
  8. Select 'GitHub' as the deployment method.
  9. Within the GitHub profile, enter the name of the GitHub repository you want to deploy from and click 'search'.
  10. Once Heroku has found the repository, click to connect the app.
  11. Go to the 'settings' tab for the app and click 'Reveal Config Vars'.
  12. Set the environment variables by entering key-value pairs (leaving out any inverted commas) so that they match those in your env.py file (see section below for further details).
  13. Click 'deploy'.
  14. Once deployed, your app is now runnable by clicking 'view'.

Credits

  • Code institute
  • Udemy
  • Heroku

stevealsamarae-python-msp3_aprresub's People

Contributors

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