We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e2e36c3 commit 5ab3d22Copy full SHA for 5ab3d22
0x01-c_stacks_queues_lifo_fifo/1001-add.bf
@@ -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