You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exercise 4 Design a function between that takes two Posns as input and returns a Posn that is almost their midpoint, but randomly moved a little bit. The distance of random movement must be proportional to the distance between the two inputs, so use (drift (* 0.2 (dist ... ...))) twice, once to move the x coordinate and once to move the y coordinate. Here dist is from Assignment 6. So use dist, drift, and midpoint. For testing, remember to use check-random.
Testing this function requires check-random, but if the tested Posns don't form a pythagorean triple, then you end up with inexact numbers and check-random refuses to compare. Similarly, you can't use check-within because it doesn't do randomness determinization.
Activity
mfelleisen commentedon Dec 10, 2019
For the record, the proper English is
"Design the function
between, which takes two .." (and the comma should be type-set in code mode :-)shhyou commentedon Oct 7, 2026
Completed by @samth.