% Main page of the program main:-welcome. welcome:-write('######################################################'),nl, write('# #'),nl, write('# WELCOME TO #'),nl, write('# VIDEO GAME SUGGESTION SYSTEM #'),nl, write('# #'),nl, write('# #'),nl, write('# #'),nl, write('# #'),nl, write('# This is a program to suggest video games #'),nl, write('# that might suits you.... #'),nl, write('# #'),nl, write('# [Answer the question followed by . before ENTER] #'),nl, write('# #'),nl, write('# Proceed to question ? (y/n): #'),nl, write('# #'),nl, write('######################################################'),nl, read(Ans), start(Ans). % The program ends when the user press n start(n):- nl, write('Goodbye.'), nl. % Questions list start(y):- nl,q1(A),nl, q2(B),nl, q3(C),nl, q4(D),nl, q5(E),nl, q6(F),nl, q7(G),nl, q8(H),nl, q9(I),nl, q10(J),nl, q11(K),nl, q12(L),nl, q13(M),nl, q14(N),nl, q15(O),nl, q16(P),nl, q17(Q),nl, result([A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q]). % The user will start answer the questions given start(X):- not(X=y), not(X=n), write('Please enter valid value (y or n only): '), read(Ans), start(Ans). q1(y):- write('Do you like to compete with other people ?: '), read(y). q1(n). q2(y):- write('Do you like to explore freely in the game world ?: '), read(y). q2(n). q3(y):- write('Do you prefer a relaxing game ?: '), read(y). q3(n). q4(y):- write('Can you handle horor well ?: '), read(y). q4(n). q5(y):- write('Are you a person that like non stop action in a game ?: '), read(y). q5(n). q6(y):- write('Are you a person that cares about storyline in a game ?: '), read(y). q6(n). q7(y):- write('Do you have a limited time to play a game ?: '), read(y). q7(n). q8(y):- write('Are you OK with jump scare ?: '), read(y). q8(n). q9(y):- write('Do you care about rank ? : '), read(y). q9(n). q10(y):- write('Do you like to play alone ?: '), read(y). q10(n). q11(y):- write('Do you easily get bored with games ?: '), read(y). q11(n). q12(y):- write('Are you comfortable with sight of blood and corpse ?: '), read(y). q12(n). q13(y):- write('Do you regularly watch any esport event ?: '), read(y). q13(n). q14(y):- write('Do you like slow paced games ?: '), read(y). q14(n). q15(y):- write('Do you prefer to play on moblie ?: '), read(y). q15(n). q16(y):- write('Do you like to play with friends ?: '), read(y). q16(n). q17(y):- write('Game avatar progression is important to you ?: '), read(y). q17(n). % The results based on the users answer result([y,_,_,_,y,_,_,_,y,_,_,_,y,_,_,y,_]):- write('You are interested in competitive online game .'),nl,nl, write('######################################################'),nl, write('# #'),nl, write('# Some games that you might interested in: #'),nl, write('# #'),nl, write('# 1. Dota 2 #'),nl, write('# 2. League of Legend #'),nl, write('# 3. Overwatch #'),nl, write('# 4. Csgo #'),nl, write('# #'),nl, write('######################################################'),nl,nl, write('Do you wish to answer again?: '), read(Ans), restart(Ans). result([_,y,_,_,_,y,_,_,_,y,_,_,_,y,_,_,y]):- write('You are interested in adventure game .'),nl,nl, write('######################################################'),nl, write('# #'),nl, write('# Some games that you might interested in: #'),nl, write('# #'),nl, write('# 1. GTA 5 #'),nl, write('# 2. Assassin Creed #'),nl, write('# 3. Red Dead Redemption #'),nl, write('# 4. The Elder Scrolls V: Skyrim #'),nl, write('# #'),nl, write('######################################################'),nl,nl, write('Do you wish to answer again?: '), read(Ans), restart(Ans). result([_,_,y,_,_,_,y,_,_,_,y,_,_,_,y,_,_]):- write('You are interested in casual game .'),nl,nl, write('######################################################'),nl, write('# #'),nl, write('# Some games that you might interested in: #'),nl, write('# #'),nl, write('# 1. Fruit ninja #'),nl, write('# 2. Angry Bird #'),nl, write('# 3. Candy Crush #'),nl, write('# 4. Temple Run #'),nl, write('# #'),nl, write('######################################################'),nl,nl, write('Do you wish to answer again?: '), read(Ans), restart(Ans). result([_,_,_,y,_,_,_,y,_,_,_,y,_,_,_,_,_]):- write('You are interested in horor game .'),nl,nl, write('######################################################'),nl, write('# #'),nl, write('# Some games that you might interested in: #'),nl, write('# #'),nl, write('# 1. Outlast #'),nl, write('# 2. Resident Evil 7: Biohazard #'),nl, write('# 3. Alien: Isolation #'),nl, write('# 4. Silent Hill #'),nl, write('# #'),nl, write('######################################################'),nl,nl, write('Do you wish to answer again?: '), read(Ans), restart(Ans). result([n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n]):- write('Sad to see you are not that interested in games '),nl, write('Do you wish to answer again?: '), read(Ans), restart(Ans). result([_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_]):- write('Congragulation !!!! You are an all round gamer!'),nl, write('You will be interested in any game that you will try '),nl, write('Do you wish to answer again?: '), read(Ans), restart(Ans). % The program will either restart or stop based on the user's answer restart(y):- start(y). restart(n):- start(n). restart(X):- not(X=y), not(X=n), start(X).