DrBrainf-ck/README.tex

62 lines
2.6 KiB
TeX
Raw Normal View History

2018-12-10 13:48:58 +00:00
\documentclass[12pt]{scrartcl}
\title{DrBrainfuck Documentation}
\author{Tommaso Rodolfo Masera \and Claudio Maggioni}
2018-12-11 09:10:52 +00:00
\date{December 2018}
\usepackage[margin=2cm]{geometry}
\newcommand{\brainfuck}{\emph{Brainf*ck }}
2018-12-10 13:48:58 +00:00
\begin{document}
\maketitle
2018-12-11 09:10:52 +00:00
\tableofcontents
\section{User Level}
\subsection{Brief Introduction to \brainfuck}
\brainfuck is a programming language supposed to resemble a working Turing machine and it consists of only eight commands.
A program written in \brainfuck makes use of sequences of these commands and
said sequence might actually have other characters in between that are promptly ignored and treated as comments instead.
The way \brainfuck works includes a program and an instruction pointer, an array of
byte cells initialized to 0 as well as a movable data pointer, starting from the leftmost
position, to address such cells with the given instructions.
What's more \brainfuck makes use of the ASCII encoding for inputs and outputs.
The eight commands \brainfuck is based on are the following:
\begin{itemize}
\item[] \texttt{\textbf{\Large >}} : increments the data pointer to point the cell to the right;
\item[] \texttt{\textbf{\Large <}} : decrements the data pointer to point the cell to the left;
\item[] \texttt{\textbf{\Large +}} : increases by one the byte at the data pointer;
\item[] \texttt{\textbf{\Large -}} : decreases by one the byte at the data pointer;
\item[] \texttt{\textbf{\Large .}} : prints as output the byte at the data pointer;
\item[] \texttt{\textbf{\Large ,}} : asks for an input to store in the byte at the data pointer;
\item[] \texttt{\textbf{\Large [}} : if the byte at the data pointer is zero, jumps forward to the command after the matching \texttt{\textbf{]}} command instead of advancing the instruction pointer to the next instruction;
\item[] \texttt{\textbf{\Large ]}} : if the byte at the data pointer is non-zero, jumps backward to the command before the matching \texttt{\textbf{[}} command instead of advancing the instruction pointer to the next instruction;
\end{itemize}
\subsection{About the Interpreter}
\subsubsection{Running the Program}
You have two different options to run the program: a GUI and a CLI.
For the GUI open the ``\texttt{gui.rkt}'' file from either the `DrRacket' environment or the
Racket CLI tool.
As for the CLI version of the program you should use the ``\texttt{./cli.rkt}'' command followed by your ``\texttt{filename.bf}'' \brainfuck file that you want to execute.
\subsubsection{Current Features}
\textbf{\large TODO}
\section{Developer Level}
\subsection{Interpreter Execution}
2018-12-10 13:48:58 +00:00
2018-12-11 09:10:52 +00:00
\textbf{\large TODO}
2018-12-10 13:48:58 +00:00
\end{document}