Skip to the content

Kotoba言葉

Load only the word lists you need, mark repeated letters correctly and play a daily or seeded word game.

Kotoba is the Japanese word for words. About the name

Contents

Reference · Marking, scores and game rules

eraseWordGamefunction

The last thing typed taken back: romaji not yet a kana first, then the last kana or letter.

Import it

import { eraseWordGame } from "@johnmorrisdotca/kotoba";

Definition

function eraseWordGame(game: WordGame): WordGame

Parameters

NameTypeDescription
gameWordGame

The current immutable word-game state.

Returns

WordGame

The last thing typed taken back: romaji not yet a kana first, then the last kana or letter.

Examples

import { eraseWordGame, startWordGame, typeWordGame } from "@johnmorrisdotca/kotoba";

const game = startWordGame("en",5,"apple");
const typed = [..."apple"].reduce((state,key)=>typeWordGame(state,key,1000),game);
console.log(eraseWordGame(typed).typed);
[ 'a', 'p', 'p', 'l' ]

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/kotoba 1.2.0.