Basic math algorithms

This commit is contained in:
Yannick Reiß 2023-09-20 16:52:59 +02:00
parent edf9421cd6
commit e85f940218
No known key found for this signature in database
GPG Key ID: 5A3AF456F0A0338C
1 changed files with 18 additions and 0 deletions

18
algorithms/basic_math.bf Normal file
View File

@ -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* < [-] ]