emilong / countdown

A Countdown numbers game solver

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Countdown numbers game solver

Mostly just brute forces through all possible combinations using basic dynamic programming and recursion. The only exception is it won't descend into multiplication path if the current number is not a multiple.

The basic solver (solvePN) generates a list of Polish Notation solutions to avoid the need to figure out grouping. Then we run polishNotationToInfix over those solutions to get a nice, normal, infix string, which is eval-able.

There actually are tests. In jest.

About

A Countdown numbers game solver

License:Do What The F*ck You Want To Public License


Languages

Language:JavaScript 100.0%