Hangman Game

Project information

Description

Technologies used

  • Python
  • Django , rest_framework to create RESTful-APIs (Web APIs)
  • Flask , Jinja2
  • HTML , CSS , Bootstrap
  • JavaScript , Fetch API
  • SQLite3 Database
  • Deployed in the site https://www.pythonanywhere.com

Application screenshots

Main screen (after choosing the language).

We can choose:

  • game difficulty
  • some options: show indication (brief definition), show help, remove 3 or 4 or 5 letters (depending on the level)

Example of screen during the game.

We can see: the user's word, the indication, letters.

After the 5th error, we propose a help which consist of a brief hint.

After the 8th error, we propose to remove 3 or 4 or 5 letters (depending on the level).

Screen after the user has won

Screen after the user has failed

Application code samples

Database: SQLite3

Code sample: Model (django) for the words list

Code samples: View (django); there isn't big views in this game.

Code sample: Template (django, HTML, CSS, Bootstrap, JavaScript) for main screen of the game

Fetch API (javascript) to use RESTful APIs (Django).

We use javascript Fetch API (in client side) to get a word from the database using Django RESTful API (in server side).

Code sample: Serializer and View to create a RESTful API to give a word randomly from the database.

Make it so that the words chosen (randomly) are those which have not been chosen frequently.

Deploiement in the site https://www.pythonanywhere.com

HANGMAN DATABASE UPDATING

Description

    A program to update hangman game DATABASE (create and update words).

Technologies used

  • Python
  • Flask , Jinja2
  • HTML , CSS , Bootstrap
  • JavaScript
  • SQLite3 Database

Main screen.

We have the list of words, we can filter and search for a word.

Edit a word.

Add a new word.

Code sample: Function to edit a word linked to a route (Flask)

Code sample: Template (Flask -Jinja2 language-, HTML, CSS, Bootstrap, JavaScript) for editing a word