Skip to content

Commit 5ab3d22

Browse files
Create 1001-add.bf
1 parent e2e36c3 commit 5ab3d22

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
, ; read character and store it in p1
2+
> ; move pointer to p2 (second byte)
3+
, ; read character and store it in p2
4+
[ ; enter loop
5+
< ; move to p1
6+
+ ; increment p1
7+
> ; move to p2
8+
- ; decrement p2
9+
] ; we exit the loop when the last cell is empty
10+
< ; go back to p1
11+
------------------------------------------------ ; subtract 48 (ie ASCII char code of '0')
12+
. ; print p1

0 commit comments

Comments
 (0)