Skip to main content

Onono! The Puzzle Game

Project description

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.txt command.
  • Launch the game with the python onono command.
  • 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 onono do 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áří.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

onono-1.0.1.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

onono-1.0.1-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file onono-1.0.1.tar.gz.

File metadata

  • Download URL: onono-1.0.1.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for onono-1.0.1.tar.gz
Algorithm Hash digest
SHA256 3ff595b3199f828269ba385bd231e28f0f3ecb964fef2bb2076a861ea301f811
MD5 72f7652a3ac1e70b5bccd3b30bf42b3a
BLAKE2b-256 8ad6a032d8629cc8c06acab28b11d1e6d561d3796b72d2521129091b3cad0c6d

See more details on using hashes here.

File details

Details for the file onono-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: onono-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for onono-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 711f9802c18bba94076efe5c0563b613f6b144790f9f90a281ebb84e551f4bd4
MD5 1dfe935e440aa1b134b11d821ebe992a
BLAKE2b-256 57a1f63379c1b6be1357321317269ce5d95e616f4c33c24430550fe3fbc14b41

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page