Additions and changes to Blockly for France-IOI.
Requires buttonsAndMessages from bebras-modules for variable prompts.
Block text_eval
requires acorn and the associated utility acorn-walk; they're both available in the bebras-modules repository as well.
Include the file dist/fioi-blockly.min.js
after including Blockly javascript files, and before using Blockly.
If you modify the source, launch the command gulp
to recompile.
Blocks to handle dictionnaries.
- Block
dict_get
: set element at index - Block
dict_get_literal
: set element at index - Block
dict_keys
: get the list of keys - Block
dicts_create_with
: create a dictionnary
Blocks to handle 2D and 3D tables.
Blocks to handle inputs from stdin.
- Block
input_num
: read an integer - Block
input_char
: read a single character - Block
input_word
: read a word (delimited by whitespaces) - Block
input_line
: read a line
- Block
lists_append
: append an element to a list - Block
text_print_noend
: print some text without a newline at the end - Block
text_eval
: allow user to input an expression to be evaluated, for instancelist[x+2]*5
- Block
logic_compare
: use the standard notations for blocks instead of special characters (for instance,!=
instead ofโ
)
- Allow only names starting with [a-zA-Z_].
- Default name: "element"
- Repeat blocks: start with 0
- Python procedures: stop global variables