So for Christmas I got The Art of Computer Programming by Donald Knuth, which has an interesting way of defining algorithms. It basically works with states and string substitutions.
Basically, that algorithm says this:
j (the state ID) to be 0.
σ to be a string.
θ value of state j occurs in
σ, call the algorithm with the first occurrence of
σ replaced with the
ϕ, and the
j is now the
b value. If it doesn't occur, keep the same
σ and set
j to the
If that makes any sense.
The example program that I wrote finds the gcd of 2 numbers, represented by the amount of as and bs.
The states are listed as
b separated by spaces.
The inputs are the word
input followed by a string.
Make a program by editing
sample.eso in a fork and running. Here's a sample hello world:
0 "" "Hello, World!" 1 1 input ""