| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Lua-Data-Described Markov Algorithms executer.
malgorithm{ -- doubles string "aaa" to "aaaaaa"
name = "double",
{["*a"] = "aa*"},
{["*"] = "", terminating = true},
{["a"] = "*a"}
}
malgorithm{ -- takes "aaa-aa" and returns "a" (unary)
name = "diff",
{["a-a"] = "-"},
{["a-"] = "a", terminating = true},
{["-a"] = "-a", terminating = true},
{["-"] = "", terminating = true}
}
malgorithm{ -- converts "0101" to "aaaaa" (binary to unary conversion)
name = "toun",
{["1"] = "0a"},
{["a0"] = "0aa"},
{["0"] = ""}
}
malgorithm{ -- takes "aaa*aa" and returns "aaaaaa" (unary multiplication)
name = "mult",
{["Ba"] = "aB"},
{["Aa"] = "aBA"},
{["A"] = ""},
{["a*"] = "*A"},
{["*a"] = "*"},
{["*"] = ""},
{["B"] = "a"},
}
malgorithm{ -- takes "aaaa|aa" and returns gcd(aaaa, aa) (unary gcd)
name = "gcd",
{["aA"] = "Aa"},
{["a|a"] = "A|"},
{["a|"] = "|B"},
{["B"] = "a"},
{["A"] = "C"},
{["C"] = "a"},
{["|"] = ""}
}
malgorithm{ -- takes "aaaaa/aa" and returns "aaRa" (unary division with remainder)
name = "div",
{["*A"] = "Pc*"}, -- 4
{["cP"] = "Pc"}, -- 5
{["*"] = ""}, -- 6
{["cc"] = "c"}, -- 7
{["c"] = "x"}, -- 8
{["P"] = "a"}, -- 9
{["Aa"] = "aA"}, -- 2
{["a/a"] = "/A"}, -- 1
{["/aA"] = "/ar"}, -- 10
{["rA"] = "Ar"}, -- 11
{["/a"] = "/"}, -- 12
{["A"] = "*A"}, -- 3
{["rx"] = "xr"}, -- 13
{["xr"] = "xRr"}, -- 14
{["/r"] = "Rr"}, -- 15
{["/"] = ""}, -- 16
{["r"] = "a"}, -- 17
{["x"] = "a"}, -- 18
}
You can get more Lua-described Markov algorithms examples in sorting.lua and chains.lua.
To make Your Markov algorithm to be able to run in this program You need
Application relies on
Example installation with homebrew:
$ brew install lua luarocks
$ luarocks install argparse
Then, app can be run with
$ lua markov.lua <options>
Try
$ lua markov.lua --help
to get movin on.
If You have any problems running markov-algorithms-lua, You are welcome at the issues tab.
| Back | FazBrowse Home | New Git URL |