esolang
Learn · LessonsLesson 5 of 18

Lesson 5

Hello World in brainfuck

The classic Hello World nests two multiplication loops to set up several cells near the letters it needs, then nudges each one into place before printing.

The lesson

Change any + in the example and watch which letter moves.

Brainfuck has its own page, and Run opens this example in the editor.

Example

Output


Exercise 1

Print Hi! (bytes 72, 105, 33).

Run tries your program on the input below. Check runs it on every test.

The tests it must pass
InputExpected output
(empty)Hi!

Output


A hint

72 is 8 × 9; from 105 to 33 is 72 back down.

One answer

Answer: Print Hi! (bytes 72, 105, 33).

Expected output

Hi!
The tests it must pass
InputExpected output
(empty)Hi!

Output


Exercise 2

Copy the input, then print a newline (byte 10).

Run tries your program on the input below. Check runs it on every test.

The tests they must pass
InputExpected output
hellohello
abcabc
(empty)

Output


A hint

After the copy loop the cell is 0, so add ten and print.

One answer

Answer: Copy the input, then print a newline (byte 10).

Expected output

hello
The tests they must pass
InputExpected output
hellohello
abcabc
(empty)

Output


Read more