Advanced handouts
Add missing file Co-authored-by: Mark <mark@betalupi.com> Co-committed-by: Mark <mark@betalupi.com>
This commit is contained in:
52
src/Advanced/Esoteric Languages/main.tex
Executable file
52
src/Advanced/Esoteric Languages/main.tex
Executable file
@ -0,0 +1,52 @@
|
||||
% use [nosolutions] flag to hide solutions.
|
||||
% use [solutions] flag to show solutions.
|
||||
\documentclass[
|
||||
nosolutions,
|
||||
singlenumbering
|
||||
]{../../../lib/tex/ormc_handout}
|
||||
\usepackage{../../../lib/tex/macros}
|
||||
|
||||
|
||||
% Factorial (print x! from x=0 onwards)
|
||||
% >++++++++++>>>+>+[>>>+[-[<<<<<[+<<<<<]>>[[-]>[<<+>+>-]<[>+<-]<[>+<-[>+<-[>
|
||||
% +<-[>+<-[>+<-[>+<-[>+<-[>+<-[>+<-[>[-]>>>>+>+<<<<<<-[>+<-]]]]]]]]]]]>[<+>-
|
||||
% ]+>>>>>]<<<<<[<<<<<]>>>>>>>[>>>>>]++[-<<<<<]>>>>>>-]+>>>>>]<[>++<-]<<<<[<[
|
||||
% >+<-]<<<<]>>[->[-]++++++[<++++++++>-]>>>>]<<<<<[<[>+>+<<-]>.<<<<<]>.>>>>]
|
||||
%
|
||||
% Same, fibonacci:
|
||||
% >++++++++++>+>+[
|
||||
% [+++++[>++++++++<-]>.<++++++[>--------<-]+<<<]>.>>[
|
||||
% [-]<[>+<-]>>[<<+>+>-]<[>+<-[>+<-[>+<-[>+<-[>+<-[>+<-
|
||||
% [>+<-[>+<-[>+<-[>[-]>+>+<<<-[>+<-]]]]]]]]]]]+>>>
|
||||
% ]<<<
|
||||
% ]
|
||||
% https://brainfuck.org/fib_explained.b
|
||||
%
|
||||
% Useful:
|
||||
% https://brainfuck.org/
|
||||
%
|
||||
%
|
||||
% +++[[<+>>++<-]>]
|
||||
% This sets up the tape in the format 3*n^2, which looks like
|
||||
% 3 6 12 24 48 96 192 128 0 0
|
||||
% Why is this so important?
|
||||
% Let's go down the list:
|
||||
% - 3 and 6 are boring
|
||||
% - 12: Close to 10 (newline) or 13 (carriage return). Can also be used for the counter for 0-9
|
||||
% - 24: Close to 26, the number of letters in the alphabet
|
||||
% - 48: ASCII for 0
|
||||
% - 96: Close to 97, ASCII for a
|
||||
% - 196 and 128: 196-128=64, close to 65, the ASCII for A.
|
||||
|
||||
|
||||
\uptitlel{Advanced 2}
|
||||
\uptitler{\smallurl{}}
|
||||
\title{Esoteric Programming}
|
||||
\subtitle{Prepared by Mark on \today}
|
||||
|
||||
\begin{document}
|
||||
\maketitle
|
||||
|
||||
\input{parts/00 turing.tex}
|
||||
\input{parts/01 befunge.tex}
|
||||
\end{document}
|
Reference in New Issue
Block a user