From 1232423124f5a4593c8102bcbab17fdc4d2aa583 Mon Sep 17 00:00:00 2001 From: yannickreiss Date: Wed, 20 Sep 2023 23:44:50 +0200 Subject: [PATCH] Add basic logic --- algorithms/basic_logic.bf | 4 ++++ algorithms/basic_math.bf | 4 ---- algorithms/rice_board.bf | 5 +++++ 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 algorithms/basic_logic.bf create mode 100644 algorithms/rice_board.bf diff --git a/algorithms/basic_logic.bf b/algorithms/basic_logic.bf new file mode 100644 index 0000000..48f7b25 --- /dev/null +++ b/algorithms/basic_logic.bf @@ -0,0 +1,4 @@ +Endless loop +Affect: cell(ptr) + ++[ >< ] diff --git a/algorithms/basic_math.bf b/algorithms/basic_math.bf index 5f4c5d7..4e1df68 100644 --- a/algorithms/basic_math.bf +++ b/algorithms/basic_math.bf @@ -12,7 +12,3 @@ 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* < [-] ] diff --git a/algorithms/rice_board.bf b/algorithms/rice_board.bf new file mode 100644 index 0000000..a2dbfea --- /dev/null +++ b/algorithms/rice_board.bf @@ -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