-
Notifications
You must be signed in to change notification settings - Fork 74
/
cell-size-3.bf
42 lines (42 loc) · 1.67 KB
/
cell-size-3.bf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
[ This contains a VERY simple check for the three common bit sizes.
It's the original version for the Bitwidth.b test program.
In addition a check has been added on the start to check
for really large, or non-binary, cells.
]
[-]>[-]
++++ [<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>-]
<[>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<-]
>[<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>-]
<[>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<-]
>[<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>>+<-]
+< [>>[-<<
----------------------------------------------------------------
>>]<<
[-]>[-]+++++++++++++[<++++++>-]<.>++++++++[<++++>-]<+.-.>++++++++[<-----
--->-]<-.>+++++++++[<++++++>-]<-.+++++++.+++++.-------------.>++++[<++++
>-]<+.+++++++.[-]++++++++[>++++<-]>.<++++++++++[>++++++++<-]>-.+++.[-]++
++++++[<++++>-]<.>+++++++++[<++++++++>-]<.+++++++++++++.--------------.-
-.[-]++++++++[>++++<-]>.<+++++++++++[>++++++<-]>+.++.+++++++..+++++++.<+
+++++++++[>-------<-]>+.[-]++++++++++.[-]<
]>[[-]>[-]<
// Calculate the value 256 and test if it's zero
++++++++[>++++++++<-]>[<++++>-]
+<[>-<
// Not zero so multiply by 256 again to get 65536
[>++++<-]>[<++++++++>-]<[>++++++++<-]
+>[>
// Print "32"
++++++++++[>+++++<-]>+.-.[-]<
<[-]<->] <[>>
// Print "16"
+++++++[>+++++++<-]>.+++++.[-]<
<<[-]]] >[>
// Print "8"
++++++++[>+++++++<-]>.[-]<
<[-]]<
// Print " bit cells\n"
+++++++++++[>+++>+++++++++>+++++++++>+<<<<-]>-.>-.+++++++.+++++++++++.<.
>>.++.+++++++..<-.>>-
Clean up used cells.
[-]<[-]<[-]<[-]<
]