game24

Crates.iogame24
lib.rsgame24
version0.3.2
sourcesrc
created_at2020-09-23 06:10:02.524869
updated_at2020-09-25 09:05:39.88255
description24 game solver with extensions
homepage
repositoryhttps://github.com/GalAster/game24-rs
max_upload_size
id291982
size28,639
SasakiSaki (oovm)

documentation

README

Game24 Solver

Basic

use game24::basic::{solve, solve_all};

#[test]
fn find_one() {
    println!("{}", solve(&[1, 2, 3, 4], 24).unwrap())
}

// (1 + 2 + 3) × 4

#[test]
fn find_all() {
    for v in solve_all(&[1, 2, 3, 4], 24) {
        println!("{}", v)
    }
}

// (1 + 2 + 3) × 4
// (1 + 3) × (2 + 4)
// 1 × 2 × 3 × 4
// 2 ÷ 1 × 3 × 4

Todo list

  • Support unary op like !
  • Time Constraint
  • Search all solutions for a given deck
  • Cli/Web application
  • Meta programming instead of big function map
Commit count: 6

cargo fmt