Onono! The Puzzle Game
Implementation of a known puzzle game Nonogram, consisting of coloring
a white grid based on given instructions. Game was created using the pygame library, responsible for all the GUI interactions.
One of the main extensions of this game is the possibility of converting any image (PNG) to a game puzzle. This results in a quick and an efficient way of creating new puzzles and brings a whole new level of replayability to the game. Puzzles can also be generated completely randomly.
Closer information about the project itself, algorithms used and possible extensions can be found in the attached report.pdf file.
Dependencies, installation
Dependencies are listed in the requirements.txt text file. Most notable of them are:
- pygame (GUI)
- numpy (savegame representation, game logic operations)
- PIL (image operations)
- pytest, pylint, pyautogui (testing)
Installation process:
- Make sure you are in the root repository (same one as this README).
- Install the dependencies with the
pip install -r requirements.txtcommand. - Launch the game with the
python ononocommand. - You can exit the game from the GUI window or by pressing Ctrl+C in the terminal.
Testing
Test files were contained in the tests/ directory. Further directory structure is determined by the logical modules of the code.
Some of the things that are tested:
- Linting with PEP-8 (using
pylint) - Basic GUI testing (using
pyautogui) - Incorrect save files, corrupted images
- Internal game logic
Tests can be launched with the pytest command.
Onono! The Puzzle Game - Czech
Semestrální práce implementuje známou puzzle hru Nonogram, spočívající v obarvování bílé mřížky na základě zadaných instrukcí. Hra je implementována za pomocí knihovny pygame, která se stará o veškeré vykreslování GUI.
Jedním z hlavních rozšíření této hry je možnost nahrát libovolný obrázek formátu PNG a nechat jej převést na samotnou hádanku. To umožní ve hře rychlé a jednoduché vytváření hádanek a velkou míru znovuhratelnosti.
Bližší informace o práci jako takové, jejím vývoji a možném rozšíření se nachází tzv. reportu v souboru report.pdf.
Závislosti a instalace
Závislosti jsou popsány v souboru requirements.txt. Jediné velké externí balíčky, o které se práce opírá, jsou pygame (pro celé vykreslování GUI), numpy (pro práci s herními savy a víceméně veškeré operace s poli) a PIL (tj. Python Imaging Library; pro zpracování vstupního obrázku). Pro testování jsou dále využity balíčky pytest, pylint a pyautogui.
Proces instalace a spuštění:
- Ujistěte se, že se nacházíte v kořenovém adresáří.
- Nainstalujte veškeré závislosti pomocí příkazu
pip install -r requirements.txt. - Spusťte hru pomocí zadání příkazu
python ononodo příkazové řádky. - Hru můžete ukončit tlačítkem v menu, zavřením okna nebo klávesovou zkratkou Ctrl+C v terminálu.
Testování
Testovací soubory jsou obsaženy v adresáří tests. Některé z nich pracují i s vlastními herními savy (mezní případy nesprávných vstupů), takové jsou v adresáři saves\tests, resp. saves\images\tests. V souboru test_lint se nachází automatická kontrola linterem pylint, všechny moduly by měly (s vyjímkou uvedených odůvodněných varování) procházet na plné skóre, což znamená že zdrojový kód semestrální práce je v souladu s PEP 8.
Testy je možné spustit pomocí příkazu pytest, spuštěného v domovském adresáří.
Metadata
Release files for onono 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| onono-1.0.1.tar.gz | 1.1 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| onono-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.1 MB
Release files / onono-1.0.1.tar.gz
| Download URL | onono-1.0.1.tar.gz |
|---|---|
| Size | 1.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3ff595b3199f828269ba385bd231e28f0f3ecb964fef2bb2076a861ea301f811
|
|
BLAKE2b-256 checksum How to use checksums |
8ad6a032d8629cc8c06acab28b11d1e6d561d3796b72d2521129091b3cad0c6d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.13
|
Release files / onono-1.0.1-py3-none-any.whl
| Download URL | onono-1.0.1-py3-none-any.whl |
|---|---|
| Size | 13.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
711f9802c18bba94076efe5c0563b613f6b144790f9f90a281ebb84e551f4bd4
|
|
BLAKE2b-256 checksum How to use checksums |
57a1f63379c1b6be1357321317269ce5d95e616f4c33c24430550fe3fbc14b41
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.13
|