Add basic logic
This commit is contained in:
4
algorithms/basic_logic.bf
Normal file
4
algorithms/basic_logic.bf
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
Endless loop
|
||||||
|
Affect: cell(ptr)
|
||||||
|
|
||||||
|
+[ >< ]
|
||||||
@@ -12,7 +12,3 @@ Subtraction: cell(ptr) = cell(ptr) _ cell(ptr x 1)
|
|||||||
Using: 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* < [-] ]
|
|
||||||
|
|||||||
5
algorithms/rice_board.bf
Normal file
5
algorithms/rice_board.bf
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
, set the first cell
|
||||||
|
[ > ++ > + << - ] copy cell(ptr) to cell(ptr x 2) and two times to cell(ptr x 1)
|
||||||
|
>>[ << + >> - ] << move cell(ptr x2) back to cell(ptr) and move to cell(ptr)
|
||||||
|
> move forward to restart (not working, as no nested loops are implemented)
|
||||||
|
. output the double
|
||||||
Reference in New Issue
Block a user