|  Developer

xor

  • The XOR logical operator is a When block. It represents the Exclusive OR logical operator. This condition is in a case when the blocks array contains an odd number of conditions which are . It is if the number of ‘true’ blocks is even. In the case of all conditions in the blocks array is , the operator itself becomes . The XOR operation should contain more than two When blocks. The XOR operator could contain nested logical operators.
Edit
Field Type Required Description
blockOptions.method.args.blocks string + The argument declaration of field. The name is “blocks”. The type is “blocks”. The field could contain several when blocks.

This feature is available since advanced_scenes/1.11. Its implementation is modified to represent mathematical XOR since advanced_scenes/1.28.

Edit
				
					{
   "blockType":"when",
   "blockOptions":{
      "method":{
         "name":"xor",
         "args":{
            "blocks":"blocks"
         }
      }
   },
   "fields":[
      {
         "name":"blocks",
         "type":"blocks",
         "value": [
           {
               __WHEN_BLOCK__
           },
           {
               __WHEN_BLOCK__
           },
           {
               "blockType":"when",
               "blockOptions":{
                  "method":{
                     "name":"or",
                     "args":{
                        "blocks":"blocks"
                     }
                  }
               },
               "fields":[
                  {
                     "name":"blocks",
                     "type":"blocks",
                     "value": [
                       {
                           __WHEN_BLOCK__
                       },
                       {
                           __WHEN_BLOCK__
                       }
                     ]
                  }
               ]
            }
         ]
      }
   ]
}