Lab 3.5 - If My Calculations Are Correct...
In this lab, you will write custom reporter blocks to perform a number of useful calculations and computations.
Simple Computations
Write a custom SNAP reporter block called "min" that determines which of two numbers is smaller and reports that value. If the two numbers are equal, report either one.
Write a custom SNAP reporter block called "max" that determines which of two numbers is larger and reports that value. If the two numbers are equal, report either one.
Write a custom SNAP predicate block called "between" that determines if a number is between two other numbers. If the first number is equal to either of the other two numbers or is between them, the block should report "true".
Write a custom SNAP predicate called "at least as long as" that determines whether or not word has at least a specified number of letters.
Stepping Things Up
Write a custom SNAP reporter block called "distance to" that computes and reports the distance from a sprite's position to another point. Use the "x position" and "y position" blocks to determine the sprite's position. Remember that the formula for the distance between points and is .
Write a custom SNAP predicate block called "contains letter" that determines whether or not a word contains a particular letter. You can consider upper-case and lower-case letters to be different for the purposes of matching.