Shiritori-rs
Shiritori is a famous word chain game in Japan.
Live demo (Wasm)
https://tnantoka.github.io/shiritori-wasm/
Usage
shiritori = { git = "https://github.com/tnantoka/shiritori-rs.git" }
# for Wasm
getrandom = { version = "0.2.6", features = ["js"] }
use ;
use ;
let word_list = load;
let mut game = new;
game.current_turn; # Word
let judgement = game.next_turn;
game.current_turn; # Word
judgement.game_over # true
judgement.winner # You
judgement.reason # LastLetterIsInvalid
Example
$ cargo run --example hello pokemon
bot> ピカチュウ(ピカチユウ)
next: ウ
you> ウーラオス
bot> スイクン(スイクン)
You win
(last letter is invalid)
Development
Update word list
$ cargo run --bin generate
# pretty
$ cargo run --bin generate -- -p
Acknowledgments
- https://clrd.ninjal.ac.jp/unidic/
- unidic-cwj-3.1.0/lex_3_1.csv
- https://github.com/PokeAPI/pokeapi
- data/v2/csv/pokemon_species_names.csv