$ git clone https://github.com/DrankRock/Python-Simple-Turing-Machine.git
$ cd Python-Simple-Turing-Machine
$ python3 SimpleTuring.py -h
usage: SimpleTuring.py [-h] [-b BAND] [-c COLORS [COLORS ...]] [-di] [-ds DISPLAY_SLEEP] [-es END_SYMBOLS [END_SYMBOLS ...]] [-i INT [INT ...]] [-m MACHINE] [-nb N_BANDS] [-nu N_UPLET] [-p PRINT]
[-ph] [-si START_INDEX] [-t TRANSITIONS [TRANSITIONS ...]]
options:
-h, --help show this help message and exit
-b BAND, --band BAND Starting band for the program
-c COLORS [COLORS ...], --colors COLORS [COLORS ...]
Specify a color for a character ( -c B red ). l to list colors
-di, --display-inline
Display the current line inline
-ds DISPLAY_SLEEP, --display-sleep DISPLAY_SLEEP
sleep n milliseconds between each step
-es END_SYMBOLS [END_SYMBOLS ...], --end-symbols END_SYMBOLS [END_SYMBOLS ...]
Specify the symbols to count after ending. Format : -es Y S
-i INT [INT ...], --int INT [INT ...]
integers to add to the band
-m MACHINE, --machine MACHINE
Use a custom machine previously added to the source code above, line 27 and below
-nb N_BANDS, --n-bands N_BANDS
Specify the number of bands (default : 1, min : 1)
-nu N_UPLET, --n-uplet N_UPLET
Specify the accepted n-uplet (default : 4, min : 4)
-p PRINT, --print PRINT
Print a python version of the machine, to add it in the code, line 27 and below
-ph, --print-human Print the current machine as a human readable format
-si START_INDEX, --start-index START_INDEX
Starting index of the machine
-t TRANSITIONS [TRANSITIONS ...], --transitions TRANSITIONS [TRANSITIONS ...]
Transitions (format : '<start state> <read> <action> <end state>' Example : "0 B | 1" "0 | | 0"
Specify a custom band.
python SimpleTuring.py -m cleaner -b "BBB|||||This is a custom band"
Specify a custom color/effect/background for any character
python SimpleTuring.py -c l
python SimpleTuring.py -m cleaner -b "BBB|||||This is a custom band" -c \| yellow B red
Print every step on top of each other instead of the one after the other.
python SimpleTuring.py -m cleaner -i 1 2 -di
Set a delay in milliseconds between each step. Especially useful with --display-inline
, to see the steps happen.
python SimpleTuring.py -m cleaner -i 4 3 -di -ds 500
Set the symbols to count at the end of the execution
python SimpleTuring.py -m cleaner -b "BBB|||Y||BB" -es Y \|
Set the band as a list of integers with the format n = |^(n+1)B
python SimpleTuring.py -i 2 4 -m cleaner
Specify a saved machine to be executed. This machine needs to be saved to the code under the line 30. After creating your machine with the -t
arguments, you can print as a python list with -p
and add it to the code. More of this is explained under the -p, --print tab.
python SimpleTuring.py -i 2 -m cleaner
Print the current machine as a list in python, to be copied in the dedicated space in the SimpleTuring.py code, as shown below. This makes it possible to use it by name with -m, --machine
option.
After executing with -p cleaner | SimpleTuring.py |
---|---|
Not implemented yet, but aims to make it possible to use multiple bands
- gdb mode with s, j <n steps>, c, b <state>, p
- n-bands /!\ Most important
- save machines to .machines file with -s
--> load
--> append multiple machines
--> load machines from custom file
- Complete http://morphett.info/turing/turing.html support
maybe -m <morphet file>
- Accept transitions from file
-t <filename>
- accept * as "do not move"
- .config to save parameters, maybe run -d to run default specified in config
If you encounter any kind of problem, or to have a chat, you can contact me on Discord @MattV#7337