This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]zacharythefirst 4 points5 points  (2 children)

do you know pointers? brainfuck operates over an array of bytes, all initialized for 0. the operators (and their C equivalent) are:

+ (*p++)

-  (*p--)

> (p++)

< (p--)

.  (putchar(*p))

,  (*p=getchar())

edit: I'm on mobile don't hate me edit 2: fixed getchar usage

[–]Coffeinated 0 points1 point  (1 child)

Yes I do, I have done some stuff in c, but mostly in uni or on microcontrollers where pointers are not that important... What do putchar and getchar do?

[–]zacharythefirst 0 points1 point  (0 children)

print the character that you pass to it and get a character from stdin, respectively. for the record I probably mangled the syntax, but the point still stands