Please note, this blog entry is from a previous course. You might want to check out the current one.
Make one of your operation buttons be “generate a random number between 0 and 1”. This operation button is not a constant (since it changes each time you invoke it). Nor is it a unary operation (since it does not operate on anything).
In the interface builder change the name of a button to “rand”:
Add an operation without operands to the the calculator model:
private enum Operation { ... case NullaryOperation(() -> Double, String) ... }
Continue reading “cs193p – Assignment #1 Extra Task #4”