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

changeWordGamefunction

The last kana typed made small or large again (つ and っ), or given the next mark (は, ば, ぱ). Letters have neither: nothing changes.

Import it

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

Definition

function changeWordGame(game: WordGame, change: "size" | "mark"): WordGame

Parameters

NameTypeDescription
gameWordGame

The current immutable word-game state.

change"mark" | "size"

Toggle the final kana size or cycle its voicing mark.

Returns

WordGame

The last kana typed made small or large again (つ and っ), or given the next mark (は, ば, ぱ). Letters have neither: nothing changes.

Examples

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

const game = startWordGame("en",5,"apple");
const typed = [..."apple"].reduce((state,key)=>typeWordGame(state,key,1000),game);
console.log(changeWordGame(startWordGame("ja",2,"はな"),"mark").typed);
[]

What it prints (run when this page was built)

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