idiom-solitaire

Crates.ioidiom-solitaire
lib.rsidiom-solitaire
version0.1.0
sourcesrc
created_at2020-11-28 09:34:46.138343
updated_at2020-11-28 09:34:46.138343
description...
homepage
repositoryhttps://github.com/GalAster/IdiomSolitaire
max_upload_size
id317392
size11,591
SasakiSaki (oovm)

documentation

README

Idiom Solitaire

Usage

Web

数据库

Rust

Python

pyo3 bind

Typescript/Javascript

wasm bind

Algorithm

成语接龙模式

pub enum SolitaireMode {
    /// 同字模式, 需要字符完全相同, 允许多音字
    Character = 0,
    /// 同调模式, 需要发音以及音调相同
    Tone = 1,
    /// 同音模式, 允许音调不同
    Sound = 2,
}

自由成语接龙

  • 贪婪算法: solver.solve_greedy(input: &str) -> Result<Idiom>
  • 随机算法: solver.solve_random(input: &str) -> Result<Idiom>

目标接龙搜索

  • BFS: solver.solve_target(input: &str, target: &str) -> Result<Vec<Idiom>>
Commit count: 28

cargo fmt