Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tommay/clock-in-erlang
Rewrite of my "clock equations" program in Erlang. I'm getting better!
https://github.com/tommay/clock-in-erlang
Last synced: about 6 hours ago
JSON representation
Rewrite of my "clock equations" program in Erlang. I'm getting better!
- Host: GitHub
- URL: https://github.com/tommay/clock-in-erlang
- Owner: tommay
- License: mit
- Created: 2015-02-24T07:00:10.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-12T03:26:39.000Z (about 9 years ago)
- Last Synced: 2023-04-19T16:52:47.732Z (over 1 year ago)
- Language: Erlang
- Size: 156 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
clock_equations
===============Figure out the simple equations that can be made from the time on a digital clock
My 9-year old daughter Chloe and I like to look at the digital clock
sometimes and make equations out of the numbers. For example,
12:02 could be 1*2+0 = 2, and 12:03 could be 1+2 = 0+3.I thought it would be fun to code up a program to find all the "clock
equations". So I did. First in Ruby, now in Erlang.There are two parts: generating the equations, and evaluating their
truth value.Generating the equations is done in clock.erl.
The equations' truth values are determined using an expression
evaluator (pratt_evaluator.erl) built on a generic Pratt parser
(pratt_parser.erl). That was the fun part!