-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerators.ts
More file actions
49 lines (43 loc) · 1.86 KB
/
generators.ts
File metadata and controls
49 lines (43 loc) · 1.86 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
Blockly.Python['scrollbit_import'] = function (block) {
// TODO: Assemble Python into code variable.
const code = 'from scrollbit import *\n';
return code;
};
Blockly.Python['scrollbit_scroll'] = function(block) {
var text_input = Blockly.Python.valueToCode(block, 'text', Blockly.Python.ORDER_ATOMIC);
// TODO: Assemble Python into code variable.
var code = 'scroll(' +text_input+ ')\n';
return code;
};
Blockly.Python['scrollbit_write'] = function(block) {
var text_input = Blockly.Python.valueToCode(block, 'text', Blockly.Python.ORDER_ATOMIC);
// TODO: Assemble Python into code variable.
var code = 'write(' +text_input+ ')\n';
return code;
};
Blockly.Python['scrollbit_draw'] = function(block) {
var text_col = Blockly.Python.valueToCode(block, 'text1', Blockly.Python.ORDER_ATOMIC);
var text_row = Blockly.Python.valueToCode(block, 'text2', Blockly.Python.ORDER_ATOMIC);
var text_icon = Blockly.Python.valueToCode(block, 'text3', Blockly.Python.ORDER_ATOMIC);
// TODO: Assemble Python into code variable.
var code = 'draw_icon(' +text_col+ ', ' +text_row+ ', ' +text_icon+ ')\n';
return code;
};
Blockly.Python['scrollbit_pixel'] = function(block) {
var text_col = Blockly.Python.valueToCode(block, 'text1', Blockly.Python.ORDER_ATOMIC);
var text_row = Blockly.Python.valueToCode(block, 'text2', Blockly.Python.ORDER_ATOMIC);
var text_bright = Blockly.Python.valueToCode(block, 'text3', Blockly.Python.ORDER_ATOMIC);
// TODO: Assemble Python into code variable.
var code = 'set_pixel(' +text_col+ ', ' +text_row+ ', ' +text_bright+ ')\n';
return code;
};
Blockly.Python['scrollbit_show'] = function(block) {
// TODO: Assemble Python into code variable.
var code = 'show()\n';
return code;
};
Blockly.Python['scrollbit_clear'] = function(block) {
// TODO: Assemble Python into code variable.
var code = 'clear()\n';
return code;
};