Alright! Here's what I want you to do. You must complete at least the Required Tasks to earn credit for this requirement. The Challenge Tasks are optional and are generally a little harder or complex. Feel free to use the Contact Me page to ask me any questions. Good luck!
Required prolog tasks
These must be completed in order, as later tasks require earlier tasks to be complete.
1) Add facts for your patrol.
* Add all of the members of your patrol as facts.
* Add your patrol leader as a fact.
* Add your friends from other patrols or the whole troop! (although that's a lot of typing, you only need to add your patrol)
* Feel free to delete my facts if you add more than just your patrol.
2) Create a new set of facts for inTroop(Troop,Scout).
3) Create a new rule for sameTroop(Scout1,Scout2).
* This rule should only return true when two scouts are in the same troop.
* It will be similar to the samePatrol(Scout1,Scout2) rule.
* Test your rule!
4) Add a new rule for sameTroopAndPatrol(Scout1,Scout2).
* This rule should only return true when two scouts are in the same troop and patrol.
* This rule will only use other rules, it won't use any facts!
* Add facts where two scouts are in different troops, but have the same patrol name. Can your program understand the difference?
* Test your rule!
Be sure to test your code by asking it questions in the SWI-Prolog to make sure it's actually doing what you think it's doing!
1) Add facts for your patrol.
* Add all of the members of your patrol as facts.
* Add your patrol leader as a fact.
* Add your friends from other patrols or the whole troop! (although that's a lot of typing, you only need to add your patrol)
* Feel free to delete my facts if you add more than just your patrol.
2) Create a new set of facts for inTroop(Troop,Scout).
3) Create a new rule for sameTroop(Scout1,Scout2).
* This rule should only return true when two scouts are in the same troop.
* It will be similar to the samePatrol(Scout1,Scout2) rule.
* Test your rule!
4) Add a new rule for sameTroopAndPatrol(Scout1,Scout2).
* This rule should only return true when two scouts are in the same troop and patrol.
* This rule will only use other rules, it won't use any facts!
* Add facts where two scouts are in different troops, but have the same patrol name. Can your program understand the difference?
* Test your rule!
Be sure to test your code by asking it questions in the SWI-Prolog to make sure it's actually doing what you think it's doing!
Optional challenge tasks
1) Update rule leads(Leader,Scout) to add a check for Troop.
* A scout should only be the leader of another scout if he is a patrol leader, is in the same troop, and is in the same patrol.
* Try to make this rule as simple as possible
2) Be creative!
* What else can you add to this system?
- Facts about which patrols are working on NHP?
- Rules about what scouts are working on NHP?
- Facts and rules for SPL?
* A scout should only be the leader of another scout if he is a patrol leader, is in the same troop, and is in the same patrol.
* Try to make this rule as simple as possible
2) Be creative!
* What else can you add to this system?
- Facts about which patrols are working on NHP?
- Rules about what scouts are working on NHP?
- Facts and rules for SPL?