https://github.com/cuchi/turmite
Chaotic two-dimensional Turing machine
https://github.com/cuchi/turmite
elixir functional-programming turing-machine
Last synced: 8 months ago
JSON representation
Chaotic two-dimensional Turing machine
- Host: GitHub
- URL: https://github.com/cuchi/turmite
- Owner: cuchi
- Created: 2017-03-10T02:25:44.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-22T02:07:46.000Z (over 8 years ago)
- Last Synced: 2025-01-28T11:48:28.201Z (10 months ago)
- Topics: elixir, functional-programming, turing-machine
- Language: Elixir
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Turmite
Purposes of this project for me:
* Implement the turmite Turing machine _(yeah, really!)_
* Learn Elixir
* Learn to program better in the functional paradigm
* Showcase some of the Elixir features
Currently, it does only the core stuff, you can call `iex -S mix` in the project folder and use it within the shell:
```elixir
iex> t = %Turmite{}
%Turmite{grid: %Grid{cells: %{}, default: 0}, orientation: :north,
position: {0, 0}, state: 0,
transitions: %{{0, 0} => {0, 1, :right}, {0, 1} => {1, 1, :right},
{1, 0} => {0, 0, nil}, {1, 1} => {1, 0, nil}}}
iex> Turmite.step(t, 100)
%Turmite{grid: %Grid{cells: %{{-4, -4} => 1, {-4, -1} => 1, {-3, -4} => 1,
{-3, -3} => 1, {-3, 0} => 1, {-3, 1} => 1, {-3, 2} => 1, {-2, -3} => 1,
{-2, -1} => 1, {-2, 0} => 1, {-2, 2} => 1, {-1, -4} => 1, {-1, -3} => 1,
{-1, 1} => 1, {-1, 2} => 1, {0, -3} => 1, {0, -2} => 1, {0, -1} => 1,
{0, 1} => 1, {0, 2} => 1, {1, -3} => 1, {1, -1} => 1, {1, 1} => 1,
{2, -1} => 1, {2, 0} => 1, {2, 1} => 1, {2, 2} => 1, {3, -3} => 1,
{3, -2} => 1, {3, 2} => 1}, default: 0}, orientation: :east,
position: {-3, -1}, state: 0,
transitions: %{{0, 0} => {0, 1, :right}, {0, 1} => {1, 1, :right},
{1, 0} => {0, 0, nil}, {1, 1} => {1, 0, nil}}}
```
## Next steps
* CLI
* Export to a png file
* Docs
* Tests