A solver for the bookworm game in pure JS