-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpoop.js
More file actions
41 lines (38 loc) · 1011 Bytes
/
poop.js
File metadata and controls
41 lines (38 loc) · 1011 Bytes
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
if (Scratch.extensions.unsandboxed) {
alert('You\'re giving poop too much power!');
throw new Error('You\'re giving poop too much power!');
}
class Poop {
getInfo() {
return {
id: 'poop',
name: 'Poop',
color1: '#59c059', // block color
color2: '#389438', // tab outline
color3: '#389438', // block outline
blocks: [
{
opcode: 'poop',
blockType: Scratch.BlockType.REPORTER,
text: '[AMOUNT] poop',
arguments: {
AMOUNT: {
type: Scratch.ArgumentType.NUMBER,
defaultValue: 1
}
}
}
]
};
}
poop(args) {
// Repeats 'poop ' an AMOUNT of times
// then trims space at the end of the poopstring
if (Number(args.AMOUNT) < 10000) {
return 'poop '.repeat(Scratch.Cast.toNumber(args.AMOUNT)).trim();
} else {
return 'With great poower, comes great respoonsibility'
}
}
}
Scratch.extensions.register(new Poop());