Skip to content

Commit

Permalink
New Operators
Browse files Browse the repository at this point in the history
- xor
- letters_of
  • Loading branch information
LilyMakesThings authored Feb 13, 2024
1 parent 75fa25a commit 3bb7a82
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions blocks_vertical/operators.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,32 @@ Blockly.Blocks['operator_or'] = {
}
};

Blockly.Blocks['operator_xor'] = {
/**
* Block for "xor" boolean comparator.
* @this Blockly.Block
*/
init: function() {
this.jsonInit({
"message0": Blockly.Msg.OPERATORS_XOR,
"args0": [
{
"type": "input_value",
"name": "OPERAND1",
"check": "Boolean"
},
{
"type": "input_value",
"name": "OPERAND2",
"check": "Boolean"
}
],
"category": Blockly.Categories.operators,
"extensions": ["colours_operators", "output_boolean"]
});
}
};

Blockly.Blocks['operator_not'] = {
/**
* Block for "not" unary boolean operator.
Expand Down Expand Up @@ -341,6 +367,34 @@ Blockly.Blocks['operator_letter_of'] = {
}
};

Blockly.Blocks['operator_letters_of'] = {
/**
* Block for "letter _ to _ of _" operator.
* @this Blockly.Block
*/
init: function() {
this.jsonInit({
"message0": Blockly.Msg.OPERATORS_LETTERSOF,
"args0": [
{
"type": "input_value",
"name": "LETTER1"
},
{
"type": "input_value",
"name": "LETTER2"
},
{
"type": "input_value",
"name": "STRING"
}
],
"category": Blockly.Categories.operators,
"extensions": ["colours_operators", "output_string"]
});
}
};

Blockly.Blocks['operator_length'] = {
/**
* Block for string length operator.
Expand Down

0 comments on commit 3bb7a82

Please sign in to comment.