Home > cryparithmetic

cryparithmetic

Cryparithmetic is a project mainly written in Prolog, it's free.

Naive backtracking problem with prolog

Crparithmetic

Running

Open prolog with the file:

swipl -f cryp.pl

Then in Swi run:

solve([T, W, O, F, U, R]).

Problem

Implement a naive backtracking solution to the problem:

 TWO
+TWO
----
FOUR

Each letter represents a different digit and F cannot be 0. The numbers follow the normal rules of addition.

Previous:cachinate