Skip to content
This repository has been archived by the owner on Dec 5, 2021. It is now read-only.

Latest commit

 

History

History
40 lines (31 loc) · 878 Bytes

README.md

File metadata and controls

40 lines (31 loc) · 878 Bytes

Turing Machine

This is the code of a turing machine that does multiplication or potentiation on a binary tape.

▶️ Running

You can use the machine just using Ruby to running the main script with some flags:

ruby ./main.rb -m 0011 true
  • The first flag need to be -m for the multiplication machine or -p for the power of machine.
  • The second flag need to be the initial tape state
  • The last flag is optional, and means that you wish to have a print of the machine proccess.

The output will be the final state of the tape.

Examples:

Do 2 * 2 with print process:

ruby ./main.rb -m 0011 true

Do 3 ^ 1 ^ 4 without printing the process:

ruby ./main.rb -p 00010000

Do 2 * 2 * 2 *2 without printing the process:

ruby ./main.rb -m 00110011

---

Victor Costa - BCC IV