Skip to content

Commit aee773c

Browse files
committed
Adding configuration for
"What the brainfuck !".
1 parent fe6b1f6 commit aee773c

18 files changed

+131
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
fscanf($stdin, "%d %d %d", $L, $S, $N);
2+
for ($i = 0; $i < $L; $i++)
3+
{
4+
$r = stream_get_line($stdin, 1024 + 1, "\n");
5+
}
6+
for ($i = 0; $i < $N; $i++)
7+
{
8+
fscanf($stdin, "%d", $c);
9+
}
10+
11+
// Write an answer using echo(). DON'T FORGET THE TRAILING \n
12+
13+
echo("answer\n");
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"namespace": "Community\\Training\\Medium\\WhatTheBrainfuck",
3+
"name": "What the brainfuck !",
4+
"group": "whatTheBrainfuck",
5+
"link": "https://www.codingame.com/ide/puzzle/what-the-brainfuck",
6+
"tests": [
7+
{
8+
"name": "A simple start",
9+
"group": "aSimpleStart",
10+
"method": "ASimpleStart",
11+
"file": "01 - a simple start.txt"
12+
},
13+
{
14+
"name": "Hello World!",
15+
"group": "helloWorld",
16+
"method": "HelloWorld",
17+
"file": "02 - hello world!.txt"
18+
},
19+
{
20+
"name": "Inputs multiplication",
21+
"group": "inputsMultiplication",
22+
"method": "InputsMultiplication",
23+
"file": "03 - inputs multiplication.txt"
24+
},
25+
{
26+
"name": "Noisy code",
27+
"group": "noisyCode",
28+
"method": "NoisyCode",
29+
"file": "04 - noisy code.txt"
30+
},
31+
{
32+
"name": "Pointer out of bounds",
33+
"group": "pointerOutOfBounds",
34+
"method": "PointerOutOfBounds",
35+
"file": "05 - pointer out of bounds.txt"
36+
},
37+
{
38+
"name": "Incorrect value",
39+
"group": "incorrectValue",
40+
"method": "IncorrectValue",
41+
"file": "06 - incorrect value.txt"
42+
},
43+
{
44+
"name": "Syntax error",
45+
"group": "syntaxError",
46+
"method": "SyntaxError",
47+
"file": "07 - syntax error.txt"
48+
},
49+
{
50+
"name": "Multiple errors",
51+
"group": "multipleErrors",
52+
"method": "MultipleErrors",
53+
"file": "08 - multiple errors.txt"
54+
}
55+
]
56+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
1 1 0
2+
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.+.+.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
1 4 0
2+
++++++++++[>+++++++>++++++++++>+++<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
1 4 2
2+
,>,><[<[>>+>+<<<-]>>>[<<<+>>>-]<<-]>.
3+
4
4+
9
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
35 4 0
2+
++++++++++ Set the first cell (0) to 10
3+
[ Start of the initialization loop
4+
> Go to cell 1
5+
+++++++ Set it to 7
6+
> Go to cell 2
7+
++++++++++ Set it to 10
8+
> Go to cell 3
9+
+++ Set it to 3
10+
<<< Go back to cell 0
11+
- Decrement it
12+
] Loop until cell 0 value is 0
13+
>++ Add 2 to cell 1 to set it to 72
14+
. Print the 'H' character (72)
15+
>+ Add 1 to cell 2 to set it to 101
16+
. Print the 'e' character (101)
17+
+++++++ Add 7 to cell 2 to set it to 108
18+
.. Print the 'l' character (108) twice
19+
+++ Add 3 to cell 2 to set it to 111
20+
. Print the 'o' character (111)
21+
>++ Add 2 to cell 3 to set it to 32
22+
. Print the ' ' character (32)
23+
<< Go back to cell 1
24+
+++++++++++++++ Add 15 to cell 1 to set it to 87
25+
. Print the 'W' character (87)
26+
> Go to cell 2
27+
. Print the 'o' character (111)
28+
+++ Add 3 to cell 2 to set it to 114
29+
. Print the 'r' character (114)
30+
------ Substract 6 to cell 2 to set it to 108
31+
. Print the 'l' character (108)
32+
-------- Substract 8 to cell 2 to set it to 100
33+
. Print the 'd' character (100)
34+
> Go to cell 3
35+
+ Add 1 to cell 3 to set it to 33
36+
. Print the '!' character (33)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
1 4 0
2+
++++++++++[>+++++++>++++++++++>+++<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
1 4 2
2+
,>,><[<[>>+>+<<<-]>>>[<<<+>>>-]<<-]>.
3+
50
4+
6
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
1 4 0
2+
++++++++++[>+++++++>++++++++++>+++<<<->++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
1 4 0
2+
++++++++++[>+++++++>++++++++++>+++><<<--------------------------]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.

0 commit comments

Comments
 (0)