thoughtstem / morugamu

7 stars 6 forks source link

Clock++ rule system #27

Closed srfoster closed 5 years ago

srfoster commented 5 years ago

Add a rule system called clock++. It can import the list rule system, the clock numbers system. This system is for expressing mathematical computations on multi-digit numbers (unlike the clock numbers, which is for single digit numbers 0 through 9).

Example: A multi-digit number 21 would be defined like this:

(cons 1 (cons 2))

Create rule cards for the following:

S: Adds one to a multi-digit number
P: Subtracts one from a multi-digit number

An expression like (S (cons 1 (cons 2)) should evaluate to (cons 2 (cons 2)).

An expression like (S (cons 9 (cons 2)) should evaluate to (cons 0 (cons 3)).

An expression like (S (cons 9 (cons 9)) should evaluate to (cons 0 (cons 0)) -- i.e. it wraps back around.

HINT FOR THIS TICKET: Don't just start coding. Getting this right will require using the whiteboard and actual Morugamu pieces. Talk it over with people!