-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclue_print.pro
77 lines (64 loc) · 2.55 KB
/
clue_print.pro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
% Indicate that the given argument was invalid in some way.
invalid_command :-
writeln('Invalid command! Please try again.').
% prints out the list of available weapons and corresponding abbreviation
print_weapons :-
writeln('"k". - knife'),
writeln('"c". - candlestick'),
writeln('"r". - revolver'),
writeln('"ro". - rope'),
writeln('"l". - lead pipe'),
writeln('"w". - wrench').
% prints out the list of rooms and corresponding abbreviation
print_rooms :-
writeln('"k". - kitchen'),
writeln('"b". - ballroom'),
writeln('"c". - conservatory'),
writeln('"bi". - billiard room'),
writeln('"l". - library'),
writeln('"s". - study'),
writeln('"h". - hall'),
writeln('"lo". - lounge'),
writeln('"d". - dining room').
% prints a list of all game characters with corresponding abbreviation
print_characters :-
writeln('"s". - Miss Scarlett'),
writeln('"m". - Col. Mustard'),
writeln('"w". - Mrs. White'),
writeln('"g". - Mr. Green'),
writeln('"p". - Mrs. Peacock'),
writeln('"pl". Prof. Plum').
% prints out the list of cards and corresponding abbreviation
print_cards :-
writeln('"s". - suspect card'),
writeln('"w". - weapon card'),
writeln('"r". - room card').
% Print the list of available menu commands.
print_commands :-
writeln('"next" - finish the turn.'),
writeln('"record" - record a card shown to you.'),
writeln('"suggest" - record a suggestion.'),
writeln('"history" - list the database of events.'),
writeln('"suggestions" - list all the suggestions.'),
writeln('"cards" - list all the cards.'),
writeln('"players" - list all the players.'),
writeln('"accuse" - check if an accusation can be made.'),
writeln('"restart" - clears all current game information.'),
writeln('"hint" - provides a suggestion hint.'),
writeln('"current" - shows who the current player is.'),
writeln('"quit" - end game and stop the program.').
% %%%%% CURRENT GAME HISTORY
% prints out the history of card information that we know
history :-
history_cards,
history_players,
history_suggestions.
history_cards :-
writeln('Current Card Information: '),
findall(card(X,Y,Z), card(X,Y,Z), AllCards), maplist(writeln, AllCards), nl.
history_players :-
writeln('Current Player Information: '),
findall(player(N, T), player(N, T), AllPlayers), maplist(writeln, Allplayers), nl.
history_suggestions :-
writeln('Previous Suggestions: '),
findall(suggestion(P,X,Y,Z), suggestion(P,X,Y,Z), AllSuggestions), maplist(writeln, AllSuggestions).