Assignment AI
Assignment AI
Exercise: 02
In the Context of the Constraint Satisfaction problem write the constraints of your game
In proper format
Hint* A finite set of variables that store the solution V={V 1 ,V 2 ,V 3 ,…,V n }
2. A set of discrete values known as Domain Form which the solution is picked.
D= {D1, D2, D3,…, Dn }
3. A finite set of constraints C={C1, C2 ,C3 ,…,Cn }
Solution:
In this game there are three levels easy, medium and hard and at each level the CSP (Constraint
satisfaction problem) components will approximately the same. However, the variables, domains
and constraint of this game can be defined as follows:
Variables:
In this game the variables are the questions at each level of riddle. So variables at each
level of riddles are:
V= {Question 01, Question 02, Question 03, Question 04, Question 05}
Domains:
The domains for each variable are either the answer is correct or incorrect.
Domain for variable Question 01is:
D1= {Correct, Incorrect}
Domain for variable Question 02is:
D2= {Correct, Incorrect}
Domain for variable Question 03is:
D3= {Correct, Incorrect}
Domain for variable Question 04is:
D4= {Correct, Incorrect}
Domain for variable Question 05is:
D5= {Correct, Incorrect}
Constraints:
Easy Level:
C1: {(Question 01, Question 02, Question 03, Question 04, Question 05), Either of three
questions will be correct.}
Medium Level:
C2: {(Question 01, Question 02, Question 03, Question 04, Question 05), To win the
riddle you are required to earn 30 points.}
Hard Level:
C3: {(Question 01, Question 02, Question 03, Question 04, Question 05), All of the
questions must be correct.}
Exercise: 03
Code your game and explain each instance of your code separately and explain how it is aligned
with the CSP.
Solution:
We use java language to build this game and software that is used to build the game is eclipse.
Guess Riddle Games contains four classes which are as follows:
Each line of the code will be explain in code comments.
***THE END***