|
Screenshots
In this example, the start graph contains no actor. Rule Ask For Value asks the user for the number n for which n! should be computed:
Now the start graph consists of one actor holding the number n.
Rule Delegate delegates the task for n-1 to a new actor. This rule is applied until number 2 is reached:
When we are done applying delegate, a chain of actors has been created, just as shown in the figure above. Now, rule endDelegate is applicable once.
Then, rule multiply is applicable: it takes the numbers of the last two actors and multiplies them. The result is stored in the last but one actor, while the very last one is deleted. Applying rule Multiply as long as possible yields the following result, where there is only one actor left, containing the computed result for n!.
Revision: