TURING MACHINE ✦ CONTENTS (please read all of it) : What's a Turing Machine? How to write new code Notes Example programs Credits WHAT'S A TURING MACHINE? A Turing machine is a simple theoretical computer that helps us understand how real computers work at the most basic level. It has a tape that goes on infinitely in both directions with "units" on the tape that holds symbols, usually a default blank(_), 0, and 1. A "head" can read the unit in front of it, and based on that, execute commands. It has "transitions" which are basically scripts that help instruct the machine. A transition runs when 2 arguments are met: - It's in the "state" x - The unit in front of the head is y If they are both true, it can do 3 things: - Replace the unit's symbol in front of the head with a new symbol (must be 1 symbol only) - Move the head left or right once - change the "state" to something else With multiple of these transitions, you would be able to create many types of programs. For more information, go to https://en.wikipedia.org/wiki/Turing_machine or https://www.geeksforgeeks.org/theory-of-computation/turing-machine-in-toc/ HOW TO WRITE NEW CODE: Click the (>_) button, then write a single transition. Format The transition like below: thisstate/ab>/thatstate - thisstate is the needed state - a is the needed symbol - b is the symbol it will write - > is the direction it will move - thatstate will be the state when this transition is done - The starting state, or the state which the machine will first be in, MUST be called "0" - You must include the slashes ( / ) - There can only be 1 symbol in each unit - There are only 3 possible directions: • Left: "<" • Right: ">" • Don't move: "|" - The states and symbols CANNOT include "<", ">", "|", "/", or space - states can be longer than 1 character NOTES: - Enable turbomode to run faster (shift+greenflag) - When importing or writing new code, write nothing to cancel - Don't import code when a program is running - Big programs might take a while to import - Comment your programs so I might put them in Example programs - Scroll to zoom or scroll - If you want to run programs faster: https://turbowarp.org/1189952203?hqpen&fps=200&turbo EXAMPLE PROGRAMS (copy and paste into "import code"): Binary counter by @snory: 0/_1>/1 0/01>/1 0/10</0 1/__</0 1/00>/1 1/11>/1 Binary adder by : Set the tape to: "0_valueA_valueB_]" Values must be in binary (for example: "0_101_101_]" means 5+5) 0/__>/Rc Rc/__>/Ra Rc/00>/Rc Rc/11>/Rc Ra/__>/R+ Ra/00>/Ra Ra/11>/Ra R+/__>/R+ R+/00>/Rb R+/11>/Rb Rb/__</-~ Rb/00>/Rb Rb/11>/Rb -~/0_</-0 -~/1_</-1 -0/__</~0 -0/00</-0 -0/11</-0 -1/__</~1 -1/00</-1 -1/11</-1 ~0/__</~0 ~0/0_</0r ~0/1_</1r ~1/__</~1 ~1/0_</1r ~1/1_</2r 0r/__</0p 0r/00</0r 0r/11</0r 1r/__</1p 1r/00</1r 1r/11</1r 2r/__</2p 2r/00</2r 2r/11</2r 0p/__>/0s 0p/00</0p 0p/11</0p 1p/__>/1s 1p/00</1p 1p/11</1p 2p/__>/2s 2p/00</2p 2p/11</2p 0s/00</0c 0s/11</0c 1s/01</0c 1s/10</1c 2s/00</1c 2s/11</1c 2s/11</1c 0c/_z>/Rc 1c/_1>/Rc R+/]_</C C/__</C C/00|/C C/11|/C CREDITS: for PTE Everything else by