REPL Wiz
Imagine you want to find the average of a list of numbers. If you know how many
number are in the list, you can perform the calculation in a single step. For
example, use the R.E.P.L. to find the average of 32
, 56
, 15
, 71
, and 66
.
(Don't forget to use parentheses to get the order of operations right.)
> (32 + 56 + 15 + 71 + 66) / 5
Easy enough. But now imagine you want to add just one more number to the list:
44
. To recalculate the average, you'd probably end up retyping the whole thing.
Here's a trick: press the up arrow.
Doing so gives you back the last command you executed. Now you can add the
additional element and change the divisor.
Handy, right? It gets better. Now that you've run two commands, press the up
arrow twice. You can use the up arrow to scroll back through your commands. The
down arrow scrolls through commands in the opposite direction.
Press the ✓ button to see another nifty trick.