-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.txt
108 lines (84 loc) · 1.81 KB
/
config.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
init P
# I use the () to revert the position back to the "current" pyramid's bottom
# left, facing right, in preparation for drawing the next pyramid.
# Replace one square pyramid with 5 pyramids, always ending at the bottom left
# corner facing right.
P ((1PN2PN-N3PN-N4P)UND5P)
# N is used to move forward the width of a single pyramid. It doubles every
# iteration, since every existing pyramid's width doubles at the same rate.
N NN
actions
# 1, 2, 3, 4, and 5 all just set colors. You can remove them from the
# replacement string to simplify it if you want.
1
set_color_r 0.7
set_color_g 0.3
set_color_b 1.0
2
set_color_r 1.0
set_color_g 0.2
set_color_b 0.2
3
set_color_r 0.2
set_color_g 1.0
set_color_b 0.2
4
set_color_r 0.2
set_color_g 0.2
set_color_b 1.0
5
set_color_r 1.0
set_color_g 1.0
set_color_b 1.0
-
rotate 90
(
push_position 0.0
)
pop_position 0.0
N
move_forward_nodraw 1.0
# Face "upwards" to move to the upper pyramid.
U
rotate 45
pitch 45
# Undo the "U" rotation in preparation for drawing the upper pyramid.
D
pitch -45
rotate -45
# P = draw a single square pyramid. Starts at the bottom left corner facing
# right, and ends at the same place.
P
# Keep track of our start position, we'll return here at the end.
push_position 0
# Bottom left -> bottom right, up edge from bottom right
move_forward 1
push_position 0
rotate 135
pitch 45
move_forward 1
pop_position 0
# Bottom right -> up right, up edge from up right
rotate 90
move_forward 1
push_position 0
rotate 135
pitch 45
move_forward 1
pop_position 0
# up right -> up left, up edge from up left
rotate 90
move_forward 1
push_position 0
rotate 135
pitch 45
move_forward 1
pop_position 0
# up left -> bottom left, up edge from bottom left
rotate 90
move_forward 1
rotate 135
pitch 45
move_forward 1
# Return to bottom left, facing right.
pop_position 0