https://github.com/dvberkel/flippo
A clojure solution to flippo problems
https://github.com/dvberkel/flippo
Last synced: 3 months ago
JSON representation
A clojure solution to flippo problems
- Host: GitHub
- URL: https://github.com/dvberkel/flippo
- Owner: dvberkel
- License: mit
- Created: 2015-03-01T18:30:50.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-05-09T13:04:19.000Z (about 8 years ago)
- Last Synced: 2025-02-07T23:34:16.518Z (4 months ago)
- Language: Clojure
- Size: 25.4 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Flippo [](https://travis-ci.org/dvberkel/flippo)
======This repository solve flippo problems. See
the [blog post](http://fifth-postulate.nl/blog/2016-12-10.4-Number-Game.html)
for more information.Origin
------From the [wikipedia page][flippo] on flippo's
> are typically flat circular cardboard discs which are decorated with
> images on one or both sides.One type of flippo was the [*24*][24-game]. It listed four numbers and
one had to make 24 by combining the listed numbers and the standard
arithmetic operators _+_, _-_, _*_, _/_.Solution
--------Every aritmitical expression can be seen as a tree. For example the
expression `3 * (1 + 2)` corresponds with the following tree```
*
/ \
3 +
/ \
1 2
```We are going to attack the problem along the following lines.
1. Generate all tree structures.
2. Foreach tree structure assign values to the leafs and operations to
the internal nodes.
3. Evaluate each tree and check with the target number.[flippo]: http://en.wikipedia.org/wiki/Pogs
[24-game]: https://www.24game.com/