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.0.tar.gz (15.6 kB 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.0-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for onono-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c15e6f9a7cdf183ebe833677a823a578f037d9c0fa4d988a5e96d20184256095
MD5 e447c3d9669d9f75afc34ba4224af169
BLAKE2b-256 f759ca78d6449b48318f49e14233f5ba00e1ef59cf7d3525af66529bd0ec30f9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: onono-1.0.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d0d308a87cff6a57a8fe77d6c556733ae5f63ba440e9308fd938f6762a09dc6d
MD5 d6444baed0b974dee23ed6b1f123477e
BLAKE2b-256 da299f63253f2329bd200ad472bd972636e6e115a22d3ce742741ff6b377a92d

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