Difference between revisions of "Yes-or-no-dialog Condition"
Jump to navigation
Jump to search
imported>Josiane (Created page with "Image:Yes-or-no-dialog condition.png {| cellpadding="10" cellspacing="0" border="0" width="100%" |- | align="left" valign="top" width="80" | '''Definition:''' | align="lef...") |
imported>Loon911 |
||
Line 32: | Line 32: | ||
|} | |} | ||
+ | |||
+ | [[Category:AgentCubes_Conditions]] |
Latest revision as of 11:29, 20 June 2019
Definition: | The Yes or No Dialog condition lets you write programs that can ask users yes/no questions and act based on their answer. Both the questions asked and the labels for the Yes/No answers can be customized by changing the text fields in the condition.
If the user answers "Yes", the condition is true. If the user answers "No", the condition is false. |
Parameters: | string |
Example: | You can get control over the Shark in the Fish Tank project and decide whether the Shark eats the fish or not.
This is the behavior in the while-runnung method. When the shark sees the fish in front of it, there is a ten percent change that the eat_fish method is invoked.
In the eat_fish method, the yes-or-no-dialog condition can help to decide whether the fish should be eaten or not.
When the Shark encounters the Fish, it asks the user whether it should eat the poor little fishy. If you are feeling mean today, tell him to go for it, but if you want to save the fish, tell the Shark to stay away!
|