Getting Started Guide
SCRATCH CODING KIT
Mole game efficient coding method
Above is the portion of the entire mole game script. There is a way to make this script with ‘If not~’ to be much
simpler. Take a look at a content inside the “’not’. It is a process where you accumulate 1 point every time into
the ‘Score’ variable. Do you think you can make this process easier by replacing the ’If not~’ block with ‘If~’ block?
You can express the script as show above if you use the ‘If~’ block. It may be a small difference, but it is important
to practice making everything as simple as possible when coding. The difference between the two is the presence
of ‘not’. You don’t need to use ‘not’ to accumulate the point to ‘Score’ variable since if you fail to satisfy the
condition of ‘If~’ block you automatically go on to the next block without activating the script.
Like this, it is important to find more efficient ways and use less blocks.
Mole game coding activity