This is a continuation of my previous project https://github.com/SergioPinilla04/Ahorcado. I highly recommend taking a glance at it before diving into this web version of the program.
In order to transform the Hangman game we already have into a web interface, we will use the module CGI for Python.
First of all, we need to configure our web server to "read" CGI interfaces. In my case it will be Apache, but in any case, we need to edit the configuration file located in Apache24>conf>httpd.conf (on Windows).
Tip
I left my configuration file on this repository in the case you have any problem.
Important
Make sure to restart Apache after doing any changes on its configuration file!
Now we can add the Python files of the Hangman game into the folder Apache24/cgi-bin:
Note
The database is the same as the one of the previous version of the game.
To access the game, we need to search localhost/cgi-bin-index.py in our favourite browser. Here we will access the sign-in page:
But first, we need to register ourselves into the data base trhough the link "Regístrate".
The user has been added to our database:
Now we can sign-in into our game with this new user and access the main manu:
- If we access the "cuenta" link, we will be able to modify or even delet our account:
Warning
On this version of the game, the change of the password and the delete of the account are nor working properly.
- On the "Palabras del Ahorcado" link, we will access another menu, where will be able to choose between:
- Añadir una palabra al Ahorcado: where we will be able to add a word into the game:
This new word has been added into our database:
- Palabras del Ahorcado: where we can see the words that have been added into the database:
- Borrar una palabra del Ahorcado: you will be able to delete any word.
The word has been deleted fon the database:
- Back on the main menu, the "Jugar" link takes us to the game, where a random word of the database is selected and we will try and guess word by word:
The database will register the details of the attempts:
Warning
In this version, the game is not working properly yet.
Feel free to contribute to the development of the game. You can open issues to report bugs or suggest new features.
This work is licensed under CC BY-NC-SA 4.0. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/