motemen / kanjile

A word guessing game made using React, Typescript, and Tailwind
https://motemen.github.io/kanjile/
MIT License
22 stars 1 forks source link

A character may consume radicals in multiple characters #10

Open tarao opened 2 years ago

tarao commented 2 years ago

Maybe this is intended behavior.

There is a guard for checking correct radicals:

https://github.com/motemen/kanjile/blob/6bbc5ba796f9086b34c836c3c87b835a94d5b9ad/src/lib/statuses.ts#L96-L98

but there is no guard for checking present radicals:

https://github.com/motemen/kanjile/blob/6bbc5ba796f9086b34c836c3c87b835a94d5b9ad/src/lib/statuses.ts#L119-L121

This causes the matcher, for example, to give hint YBBR not YRBR for 一両日中 against 唯一無二. ( and both have radical but in is consumed by the first in 一両日中, which has already been consumed in 唯一無二.)