Skip to content
/ ngram Public

Cross-platform application to solve and build nonograms

License

Notifications You must be signed in to change notification settings

artik02/ngram

Repository files navigation

NGRAM

ngram is a cross-platform application designed to efficiently solve nonograms using a genetic algorithm. This tool automates the process of solving these logical puzzles, providing quick and accurate solutions. It is ideal for both casual players and developers interested in artificial intelligence applied to puzzles.

Nonograms are graphic logical puzzles where you must fill a grid of cells with different colors based on numeric clues. ngram uses a bio-inspired algorithm to find optimal solutions to these puzzles efficiently.

See in another languages:

License

ngram is licensed under the MIT license, allowing users to use, modify, and distribute the software freely, provided they adhere to the same terms and conditions outlined in the license.

Not accepting contributions right now.

Any contribution submitted to the repository must be licensed under the MIT license, ensuring that the added code can be used, modified, and distributed by others under the same terms.

Table of Contents

  1. Installation
  2. Building
  3. Development

Installation

Get the package

To install ngram, first download the compressed package for your platform from the releases page.

ngram is available for the following platforms:

  • Linux: ngram-linux-<version>.tar.gz
  • Windows: ngram-windows-<version>.zip
  • Android: ngram-android-<version>.apk

If you wish to install ngram on a different platform, you will need to build the source code.

Extract the package

Once the compressed package is downloaded, follow the appropriate steps for your platform:

Linux

If you downloaded the compressed file for Linux, extract it using the following command:

tar xvf ngram-linux-<version>.tar.gz

Windows

If you downloaded the compressed file for Windows, extract it using the following command in PowerShell:

Expand-Archive -Path ngram-windows-<version>.zip -DestinationPath .\

Run the application

Once the package is extracted, run the application for your platform:

Linux

Open a terminal and run the following command:

./ngram

Windows

In PowerShell, run the following command:

.\ngram.exe

Android

Install the ngram-android-<version>.apk app and click the app icon from your device's home screen.

Building

Requirements

To build ngram from the source code, you will need to have the following components installed:

  • Version control system Git
  • Programming language Rust
  • Framework for creating cross-platform applications Dioxus (requires Rust)
  • Runtime environment Node.js
  • Package manager npm (requires Node.js)

If you wish to build ngram for mobile devices (Android or iOS), you should also follow the mobile devices guide provided by Dioxus.

Clone the repository

To start building, first clone the ngram repository using the following command:

git clone https://github.com/artik02/ngram.git

Execute the Tailwind CSS compiler

Run the TailwindCSS compiler in the main repository folder to generate it's build artifacts:

npx tailwindcss -i ./input.css -o ./assets/tailwind.css

Supported platforms

ngram is built using the Dioxus framework, so make sure the target platform is compatible. To see the supported platforms, run the following command:

dx help build

Look for the --platform option section for information about available platforms.

Build the application

Once you’ve selected the desired platform, run the following command, replacing <platform> with the corresponding platform:

dx build --release --platform <platform>

The first time you build the application, the process may take longer as dependencies need to be downloaded and compiled. However, subsequent builds will be faster due to caching.

Development

If you want to contribute to the development of ngram, make sure you have all the requirements and have cloned the repository.

To start developing and immediately see changes, run the TailwindCSS compiler in the main repository folder in the background:

npx tailwindcss -i ./input.css -o ./assets/tailwind.css --watch

Next, run Dioxus in the background with the following command to see the changes reflected:

dx serve

This command will start a development server that lets you view the application while making changes to the code.