-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbrainfugd_tutorial.txt
120 lines (104 loc) · 4.08 KB
/
brainfugd_tutorial.txt
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
INTRODUCTION:
Your goal in this game is to create programs that fulfill certain tasks.
Your programs have access to a memory containing six numbers, each in a box called a cell.
The cell with a line under it is the currently selected cell. This underline is called the "cell selector".
A program is a list of commands, which will be done one by one in order when the program is running.
There are 8 different commands you can use:
+ Adds 1 to the number in the currently selected cell
- Subtracts 1 from the number in the currently selected cell
> Moves the cell selector one cell to the right
< Moves the cell selector one cell to the left
. Outputs the number in the current cell, and also the corresponding letter in the alphabet
, Takes one number as input from the player and puts that number in the currently selected cell
BRACKETS:
The last two commands you can use are [ and ]. All the commands between a [ and a ] will be repeated over and over until the selected cell's number is 0. This can be done by having a number larger than 0 in the selected cell, and then decreasing it with - until it reaches 0. If it is 0 to begin with, the commands inside get skipped, and if it never reaches 0, the commands will repeat forever.
EXAMPLES:
+++.
This program adds 3 to the first cell and then outputs the 3 (and also the letter C).
+>+>+
This program sets the 3 first cells in the memory to 1.
+++[-]
This program sets the current cell to 3 and then subtracts 1 again and again until the cell is 0.
+++[->++<]
This program adds 3 to the first cell, and then subtracts 1 from the first cell and adds 2 to the second cell until the first cell is 0, and the second cell is 6. Notice how this essentially multiplies 3 by 2.
Welcome to Brainfugd##
A programming language for your GMD system.
###
Spu7Nix systems INC## [c] 2021
~Memory
##
Your goal in this game is to create
programs that fulfill certain tasks.
##
Your programs have access to a memory containing
six numbers,# each in a box called a cell.##
The cell with a line under it is the currently
selected cell.## This underline is called the
"cell selector".
~Commands
##
A program is a list of commands,# which will be
done one by one in order when the program
is running.
##
There are 8 different commands you can use:
##
+## Adds 1 to the number in the current cell
##
-## Subtracts 1 from the number in the current cell
##
[more on the next page]
~>## Moves the cell selector one cell to the right
#
<## Moves the cell selector one cell to the left
#
.## Outputs the number in the current cell,#
and also the corresponding letter in the alphabet
#
,## Takes one number as input from the player and
puts that number in the currently selected cell
##
[more on the next page]
~Brackets
##
The last two commands you can use are [ and ].##
All the commands between a [ and a ] will be
repeated over and over until the selected cell's
number is 0. ##This can be done by having a number
larger than 0 in the selected cell, #and then
decreasing it with - until it reaches 0. #If it is
0 to begin with,# the commands inside get skipped,#
and if it never reaches 0,# the commands will
repeat forever.
~Examples
##
+++.##
This program adds 3 to the first cell and then
outputs the 3 (and also the letter C).
##
+>+>+##
This program sets the 3 first cells in the
memory to 1.
##
[more on the next page]
~+++[-]##
This program sets the current cell to 3# and
then subtracts 1 again and again until
the cell is 0.
##
+++[->++<]##
This program adds 3 to the first cell,#
and then subtracts 1 from the first cell# and
adds 2 to the second cell# until the first cell
is 0,# and the second cell is 6.## Notice how this
essentially multiplies 3 by 2.
~Practical
##
Complete challenge 5 to unlock level completion##
Complete the coin challenges for coin 1 and 2##
Complete challenge 7 for coin 3##
##
In challenges that depend on inputs the input
will be provided automatically when the program
is running# to avoid cheating.## You need 3 successful
runs in a row to complete such a challenge.