Page 74 - ThinkGPT_V2.1_C7_Flipbook
P. 74

The output appears on the Game simulator.


























                  If we change the value of the variable num to -6 in the set to block, no output will be shown because

                  the condition becomes false.
                  Let us create another project to check whether a number is even or odd using the if-then-else block.
                  Follow the given steps to do so:


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



                                                                                                      4  Type 5 in the
                                                                                                     value box of the
                                                                                                     set to block to
                                                                                                     set the value
                                                                                                     of the number
                                                                                                     variable to 5.





                     1  Click on the
                    Variables blocks
                    category.




                                                     2  Create a variable
                                                    named number.












                       72    Premium Edition-VII
   69   70   71   72   73   74   75   76   77   78   79