aboutsummaryrefslogtreecommitdiff
path: root/examples/cell.b
diff options
context:
space:
mode:
Diffstat (limited to 'examples/cell.b')
-rw-r--r--examples/cell.b21
1 files changed, 21 insertions, 0 deletions
diff --git a/examples/cell.b b/examples/cell.b
new file mode 100644
index 0000000..1dce918
--- /dev/null
+++ b/examples/cell.b
@@ -0,0 +1,21 @@
+Calculate the value 256 and test if it's zero
+If the interpreter errors on overflow this is where it'll happen
+++++++++[>++++++++<-]>[<++++>-]
++<[>-<
+ Not zero so multiply by 256 again to get 65536
+ [>++++<-]>[<++++++++>-]<[>++++++++<-]
+ +>[>
+ # Print "32"
+ ++++++++++[>+++++<-]>+.-.[-]<
+ <[-]<->] <[>>
+ # Print "16"
+ +++++++[>+++++++<-]>.+++++.[-]<
+<<-]] >[>
+ # Print "8"
+ ++++++++[>+++++++<-]>.[-]<
+<-]<
+# Print " bit cells\n"
++++++++++++[>+++>+++++++++>+++++++++>+<<<<-]>-.>-.+++++++.+++++++++++.<.
+>>.++.+++++++..<-.>>-
+Clean up used cells.
+[[-]<]