Crates.io | game24 |
lib.rs | game24 |
version | 0.3.2 |
source | src |
created_at | 2020-09-23 06:10:02.524869 |
updated_at | 2020-09-25 09:05:39.88255 |
description | 24 game solver with extensions |
homepage | |
repository | https://github.com/GalAster/game24-rs |
max_upload_size | |
id | 291982 |
size | 28,639 |
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
!