Page 15 - Touchcode_C8_Flipbook
P. 15
To perform the task, follow these steps:
Step 1: Visit the link: https://arcade.makecode.com/. Create a
project ‘Number is Even or Odd, and click on ‘Create’.
Step 2: Create a variable ‘number’.
Step 3: Select ‘set number to 0’ block and drop it to the ‘on
start’ block.
Step 4: From ‘Logic’ select ‘if-else’ block and drop it to the ‘on
start’ block below the ‘set number to 0’ block.
Step 5: From ‘Logic’ select the ‘comparison’ block and drop it
to the ‘true’ of ‘if-else’ block.
Step 6: From ‘Math’ select the ‘remainder of’ block and drop it
to the first ‘0’ of ‘comparison’ block.
Step 7: In first ‘0’ of ‘remainder’ block, drag and drop the
variable ‘number’ and in the second ‘1’ of remainder
block change the number from ‘1’ to ‘2’.
Step 8: From ‘Game’ select the ‘splash’ block, drop the block to ‘if’ of ‘if-else’ block and
add the text, ‘Number is Even’.
Step 9: From ‘Game’ select the ‘splash’ block, drop the block to ‘else’ of ‘if-else’ block and
add the text, ‘Number is Odd’.
Step 10: Change the value of number to 6 in ‘set number to 0’ block. Click on ‘Start the
simulator’ to view the output.
Conditionals in Details 13

