Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code review: Stench function. #2

Closed
nathanmartins opened this issue Jul 31, 2016 · 1 comment
Closed

Code review: Stench function. #2

nathanmartins opened this issue Jul 31, 2016 · 1 comment

Comments

@nathanmartins
Copy link
Contributor

nathanmartins commented Jul 31, 2016

Is the following code used to analise IF the wumpus is there, or is it stating that it is POSSIBLY in theses places?

 stench(yes) :-
   agent_location(X,Y),
   X1 is X + 1,
   X0 is X - 1,
   Y1 is Y + 1,
   Y0 is Y - 1,
   ( wumpus_location(X1,Y) ;
     wumpus_location(X0,Y) ;
     wumpus_location(X,Y1) ;
     wumpus_location(X,Y0) ;
     wumpus_location(X,Y) ),
   !. 
@marlop352
Copy link
Owner

It's checking if it is in any of those places, if it is then it returns "yes", meaning you can sense a 'stench'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants