forked from hackclub/blot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_pattern.js
More file actions
159 lines (148 loc) · 2.54 KB
/
test_pattern.js
File metadata and controls
159 lines (148 loc) · 2.54 KB
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
// A test pattern you can use while tuning your blot.
// Diagnose issues with your blot using the tuning guide: https://blot.hackclub.com/tuning
const width = 125;
const height = 125;
setDocDimensions(width, height);
const t = createTurtle();
///////////////
// 🅱️ORPHEUS //
///////////////
const dinoHeight = 50;
const dinoFlatWidth = 15;
const hatWidth = 24;
const hatHeight = 5;
// The Spine
t.left(90);
t.forward(dinoHeight);
// The 🅱️eret
t.right(-20); // slant beret
// Get in position...
t.left(90);
t.up();
t.forward(hatWidth/2);
// Bottom part of hat
t.right(180);
t.down();
t.forward(hatWidth);
// Right rounded part
for (let i = 0; i < 8; i++) {
t.forward(1);
t.left(180/8);
}
// Top part of beret
t.forward(hatWidth);
// Left rounded part
for (let i = 0; i < 8; i++) {
t.forward(1);
t.left(180/8);
}
// Vertical Hatching
t.left(90);
for(let x = 0; x < hatWidth+1; x+=2){
t.down();
t.forward(hatHeight);
t.up();
t.right(90);
t.forward(1);
t.right(90);
t.down();
t.forward(hatHeight);
t.up();
t.left(90);
t.forward(1);
t.left(90);
}
// Horizontal hatching
t.up();
t.forward(0.25);
t.down(); t.forward(4.4); t.up();
t.left(90);
t.forward(27);
t.left(90);
t.down(); t.forward(4.4); t.up();
// The beret stalk
t.right(180);
t.forward(4.75);
t.right(90);
t.forward(12);
t.down();
t.left(125);
t.forward(5);
t.right(125);
t.forward(2);
t.right(55);
t.forward(5);
t.left(55);
t.left(180);
t.up();
for(let y = 0; y < 3; y+=2){
t.down(); t.forward(2); t.up();
t.right(90);
t.forward(1);
t.left(90);
t.forward(0.7);
t.left(180);
t.down(); t.forward(2); t.up();
t.left(90);
t.forward(1);
t.left(90);
t.forward(0.7);
}
// Reset position...
//t.down();
t.left(90);
t.forward(9.0);
t.left(90);
t.forward(1.8);
t.down();
t.right(20); // unslant beret
// The 🅱️
t.forward(dinoFlatWidth);
for (let i = 0; i < 8; i++) {
t.forward(5);
t.right(180/8);
}
t.right((9/8)*180);
for (let i = 0; i < 8; i++) {
t.forward(5);
t.right(180/8);
}
t.left(180/8);
t.forward(dinoFlatWidth);
// The Tail
for (let i = 0; i < 5; i++) {
t.forward(5);
t.right(180/8);
}
t.right(180*6/8);
for (let i = 0; i < 4; i++) {
t.forward(5);
t.left(180/8);
}
// The 👀
let drawEye = ()=>{
for (let i = 0; i < 20; i++) {
t.forward(0.7);
t.left(360/20);
}
};
t.up();
t.left(46.9);
t.forward(29.0);
t.down(); drawEye(); t.up();
t.left(-45.9);
t.forward(11.0);
t.down(); drawEye(); t.up();
/*
for (let i = 0; i < 25; i++) {
t.forward(i);
t.left(90);
}
*/
t.translate(
[width/2, height/2],
t.cc
);
drawTurtles([
t
]);