diff --git a/algorithms/basic_math.bf b/algorithms/basic_math.bf new file mode 100644 index 0000000..5f4c5d7 --- /dev/null +++ b/algorithms/basic_math.bf @@ -0,0 +1,18 @@ +Assignment: cell(ptr x 1) = cell(ptr) +Using: cell(ptr); cell(ptr x 1); cell(ptr x 2) + +[ >+>+<<- ] >> [ << + >> - ] << + +Addition: cell(ptr) = cell(ptr) x cell(ptr x 1) +Using: cell(ptr); cell(ptr x 1) + +> [ <+>- ] < + +Subtraction: cell(ptr) = cell(ptr) _ cell(ptr x 1) +Using: cell(ptr); cell(ptr x 1) + +> [ <->- ] < + +Conditional: if (cell(ptr) greater 0) then do stuff + +[ > *do stuff here* < [-] ]