Should be something like this in pseudo code:
if selected = 3
-- operator = +
-- system compare two values : block1.value+block2.value = answer
----- pick all blocks selected
destroy blocks
-- operator = -
-- system compare two values : block1.value-block2.value = answer
----- pick all blocks selected
destroy blocks
-- operator = *
-- system compare two values : block1.value*block2.value = answer
----- pick all blocks selected
destroy blocks
-- operator = /
-- system compare two values : block1.value/block2.value = answer
----- pick all blocks selected
destroy blocks