This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
brainfuck.fim
91 lines (67 loc) 路 3.42 KB
/
brainfuck.fim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
Dear Princess Celestia: Brainfuck!
Did you know that Twilight is the word "++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+."? (Hello World)
Did you know that Princess Luna is many numbers? ("Dictionary", int > int )
I learned whether the code works to get an argument.
Did you know that Spike is the number 0?
Did you know that Thorax is the number 1?
Did you know that Shining Armor is many numbers? (Stack)
Did you know that Trixie is the number 1? (Stack length)
For every character Starlight in Twilight...
If Starlight is equal to '[' then,
Trixie of Shining Armor is Thorax. (Push current index to stack)
Trixie got one more.
Spike got one more.
Otherwise if Starlight is equal to ']' then,
Did you know that Pharynx is the number Trixie minus 1 of Shining Armor?
Thorax of Princess Luna is Pharynx. (Set both-way index in Dictionary)
Pharynx of Princess Luna is Thorax.
Trixie of Shining Armor is the number nothing. (Pop stack)
Trixie got one less.
Spike got one less.
That's what I would do.
Thorax got one more.
That's what I did.
Then you get Spike is 0!
That's all about whether the code works.
I learned how to interpret brainfuck.
Did you know that Applejack is the number 1? (Input Pointer)
Did you know that Fluttershy is many numbers? (Memory Blocks)
Did you know that Pinkie Pie is the number 1? (Memory Pointer)
As long as Applejack had no more than length of a string using Twilight,
Did you know that Rainbow Dash is the letter Applejack of Twilight?
If Rainbow Dash is equal to '>' then,
Pinkie Pie got one more.
Otherwise if Rainbow Dash is equal to '<' then,
Pinkie Pie got one less.
Otherwise if Rainbow Dash is equal to '+' then,
Pinkie Pie of Fluttershy got one more.
Otherwise if Rainbow Dash is equal to '-' then,
Pinkie Pie of Fluttershy got one less.
Otherwise if Rainbow Dash is equal to '.' then,
I quickly said convert a number to char using Pinkie Pie of Fluttershy.
Otherwise if Rainbow Dash is equal to ',' then,
Did you know that Spike is the letter nothing?
I asked Spike.
If Spike was not the letter nothing then,
Pinkie Pie of Fluttershy is convert a char to num using Spike.
That's what I would do.
Otherwise if Rainbow Dash is equal to '[' then,
If Pinkie Pie of Fluttershy is equal to 0 then,
Applejack became Applejack of Princess Luna.
That's what I would do.
Otherwise if Rainbow Dash is equal to ']' then,
If Pinkie Pie of Fluttershy is not 0 then,
Applejack became Applejack of Princess Luna.
That's what I would do.
That's what I would do.
Applejack got one more.
That's what I did.
That's all about how to interpret brainfuck.
Today I learned how to start interpreting brainfuck.
If whether the code works is correct then,
I remembered how to interpret brainfuck.
Otherwise,
I said "Oh no! There's a mismatched bracket somewhere in the code!".
That's what I would do.
That's all about how to start interpreting brainfuck.
Your faithful student, Jaezmien Naejara.