Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ttulka authored Dec 6, 2023
1 parent dde450a commit 571db1f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ Turing-complete programming language

## Overview

Rrr is a programming language to describe a Turing machine using only a binary alphabet
consisting of only two symbols, `R` and `r`.
Rrr is a programming language to describe a Turing machine using a binary alphabet
consisting of symbols, `R` and `r`.

A program in Rrr is a sequence of instructions for a universal machine.
Each command represents a transition, which includes a starting state, a conditional
read symbol, a write symbol, a move action, and a next state.

### How it works

The universal Turing machine reads a description of a Turing machine encoded as a Rrr
program and simulates it.
The universal Turing machine reads a description of a Turing machine encoded in Rrr
and simulates it.

In each state *q<sub>i</sub>* with the current symbol *s* on the tape, the universal
machine searches for a command with the starting state *q<sub>i</sub>* and the read
Expand Down Expand Up @@ -174,12 +174,12 @@ The program alphabet is { ε, `R`, `r` }

### Palindromes

A palindrome is a sequence of symbols that reads the same backwards as forwards, such as rRr or RRrRR.
A palindrome is a sequence of symbols that reads the same backward as forward, such as rRr or RRrRR.

1. Read a symbol from the input.
2. Move to the last symbol of the input.
3. If the last symbol matches the one you read in step 1, clear the cell at the end, move back to the beginning, and start over.
4. If the last symbol is different from the one you read in step 1, clear the entire input and reject by printing `R`.
3. If the last symbol matches the one you read in Step 1, clear the cell at the end, move back to the beginning, and start over.
4. If the last symbol is different from the one you read in Step 1, clear the entire input and reject by printing `R`.
5. If the input is empty (all symbols have been matched and cleared), accept by printing `r`.

![Example Rrr program 4](assets/example4.png)
Expand Down

0 comments on commit 571db1f

Please sign in to comment.