Page 111 - CG_v2.1_flipBooks_class_6
P. 111

Boolean:  These blocks are used to combine or  invert conditions.  These blocks  represent
                   true/false values and are often used in conditions. They can be used to set or test boolean
                   variables.

                             Block                  Name                            Description


                                               logical and       Return true if both the conditions are true.




                                               logical or        Return true if any of the conditions is true.




                                               logical not       Return true if the condition is false and vice-versa.




                                               boolean true      Set the value as true.



                                               boolean false     Set the value as false.




                 Let us create a project to display a message if a number is positive.



                                                      3  Drag the set to block and drop
                                                      it inside the on start block.




                                                                                                    4  Type 6 in the
                                                                                                    value box of the
                                                                                                    set to block to
                                                                                                    set the value of
                                                                                                    the num variable
                                                                                                    to 6.





                                                                                                    2  Create
                   1  Click on the
                                                                                                   a variable
                   Variables blocks
                                                                                                   named num.
                   category.












                                                                                  More on MakeCode Arcade     109
   106   107   108   109   110   111   112   113   114   115   116