Twenty Four is a number game. The player is presented with a card containing four numbers. The object is to use those four numbers to make the value 24 using the four standard arithmetic operations (plus, minus, times, divide). This Julia module provide solves these puzzles.
Use the solve
function to find solutions to Twenty Four puzzles.
Simply provide two or more values (either integers or rationals).
julia> solve(3,4,5,8)
"(4*8)-(3+5)"
julia> solve(5,5,5,1)
"5*(5-(1/5))"
julia> solve(5,5,5,2)
"No solution"
julia> solve(1//2, 1//3, 7, 3)
"(7-3)/(1/2-1/3)"
10/12/2016
5 months ago
15 commits