Page 76 - ThinkGPT_V2.1_C7_Flipbook
P. 76

11  Drag the splash block                                                    12 Type Number
                      from the Game blocks                                                         is even in the
                      category and drop it                                                         message area of
                      inside the if block.                                                         the splash block.


                      13 Drag the splash block                                                     14 Type Number
                      from the Game blocks                                                         is odd in the
                      category and drop it                                                         message area of
                      inside the else block.                                                       the splash block.



                  The output appears on the Game simulator. Change the value of the number variable in the set to
                  block to see more output.
































                        REFRESH

                       A variable is a name given to a location in the computer’s memory to store values or data.
                        Each variable in a program must have a unique name; you cannot use the same name for more than
                       one variable.
                       We can create a variable using the Variables block category.
                       The process of assigning a value to a variable is called initialisation.
                        Math blocks are used to perform various mathematical operations and computations in your games
                       and projects, like addition, subtraction, multiplication and division.
                       Logic blocks are used to handle decision-making and control flow in your projects.









                       74    Premium Edition-VII
   71   72   73   74   75   76   77   78   79   80   81