Skip to content

NoelHuibers/Hashiwokakero

Repository files navigation

Hashi - Bridges Puzzle

Folder Structure

The project is organized into three main folders:

  • backend: Contains the backend code for the Hashi - Bridges Puzzle game.
  • benches: Contains the code required for benchmarking.
  • common: Shared code and resources that are used by both the backend and frontend.
  • frontend: Houses the frontend code, responsible for the user interface and interactions.
  • solutions: Contains the .cnf and solution .txt files for all initial test problems.

How to Run

To run the project, follow these steps:

To run the project, open a terminal in the project root directory and execute the following command for frontend:

cargo run --package frontend

or for backend:

cargo run --package backend -- --mode [MODE] --input [FILEPATH] --output [FILEPATH]

MODE

We currently support three modes:

Flag Alias Functionality
encode Reads a .txt file containing an ASCII hashi puzzle and generates an according .cnf in that directory
solve Reads a CNF file and solves it using minisat
encodesolvereconstruct esr Reads a .txt file containing an ASCII hashi puzzle, generates a .cnf, solves the CNF file using minisat, reconstructs the solution and prints the reconstructed solved hasi puzzle.

To build the project, open a terminal in the project root directory and execute:

cargo build --release

To execute the rlease build for test1 and print the reconstructed solution:

../target/release/backend --mode esr --input ./input/test1.txt --output ./input/test1.minisat-output.txt

To execute the integration test containing all given test scenarios and some aditional edge cases:

cargo test --package backend --test integration_test -- test_integration --exact --nocapture

Benchmarking

To execute the criterion benchmarking open a terminal in the project backend directory and execute:

cargo bench

See Evaluation

SAT Conversion

See Clauses

Team Responsibilities

Noel:

  • Initialize the project.
  • Develop the Command Line Interface (CLI) for our application.
  • Implement SAT-Solver integration and the ability to select the appropriate solver based on input data.
  • Clap integration encode or solve.
  • Solver Error no DIMACS File
  • Frontend Leptos/Yew integration.
  • Generator

Laura:

  • Handle the parsing of input files.
  • Error Handling of input files.
  • Establish a data structure for passing input data within the application.
  • Manage the creation and formatting of output files.
  • Test structure
  • Benchmarking
  • Game Board Format
  • Evaluation of Performance

Florian:

  • Translate input data into clauses.
  • Implement parsing functionality for calculating DIMACS.
  • Parsing for CLI output
  • Rule 3 in CNF
  • Reproduce / Fix unwrap errors in Rule 3
  • Update instructions on how to run

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published