8. Doing a Little Math

Scratch provides robust support for performing mathematical calculations. This gives you the ability to develop applications that can manipulate numeric data in a variety of ways. Scratch provides this support through numbers code blocks. Numbers code blocks are reporter blocks and therefore can only be used in conjunction with stack code blocks. This chapter will provide a thorough review of each of these code blocks and will also show you how to create a new Scratch application, the Number Guessing game.

The major topics covered in this chapter include:

  • Learning how to add, subtract, multiply, and divide programmatically

  • Learning how to generate random numbers using any range you specify

  • Instruction on how to perform different types of numeric comparisons

  • Learning how to perform a number of built-in mathematical operations

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.202.54