Figure 2.9 KnowledgWorks Editor
Let us suppose that when the demo finishes we would like it to ask if we want to play again. Find the definition for GAME-FINISHED
(using the rule browser). One line in the definition is commented out with a ;
(semi-colon) at the start. Remove the semi-colon and re-evaluate the form by choosing Definitions > Compile from the editor menu bar. Press space to return to the editor view. This rule will now ask if the user wants to play again and execution will only stop (the (return)
instruction ends execution) if requested. Run the demo to see this happen.
The rule FETCH-NEW-ANIMAL
also has a commented-out line (repeat) which will make it repeat its prompt until given an animal it does not already know. Remove the semi-colon at the start of the line in and re-evaluate the rule. Run the demo again and try giving the system an animal it recognises. It will prompt again. Give it an animal it does not recognise to finish.