Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 109 - 2609_Logiccode
P. 109

    USING LOGIC BLOCKS

                     In MakeCode Arcade, logic blocks are used to handle decision-making and control flow in your
                     projects. We can access these blocks by clicking on the Logic blocks category. The Logic blocks
                     are divided into three types:

                         Conditionals: These blocks, also known as decision-making blocks, are fundamental
                       constructs in programming that allow a program to make decisions and execute different
                       blocks of code based on certain conditions. There are two conditional blocks in MakeCode
                       Arcade, which are as follows:

                               Block                       Name                            Description

                                                                              Allow us to execute code only if a certain
                                                  if-then
                                                                              condition is true.

                                                                              Allow us to execute one block of code if a
                                                  if-then-else                condition is true, and a different block of
                                                                              code if the condition is false.

                       Comparison: These blocks help you compare values. By default, MakeCode Arcade shows
                       only three comparison blocks, which are as follows:

                               Block                       Name                            Description

                                                                              Return true  if both  the  numbers  are
                                                  equal
                                                                              equal.

                                                                              Return true if the first number is less than
                                                  Less than
                                                                              the second number.

                                                                              Return true  if both  the  text  values are
                                                  equal (for text)
                                                                              equal.

                     However, when we click on the down arrow of these blocks, we will get more comparison options
                     like not equal to, greater than, greater than or equal to, and less than or equal to.

                                                                                             More on MakeCode Arcade  107

| 104 105 106 107 108 109 110 111 112 113 114 |