dust/examples/clue_solver.ds
2023-10-16 16:48:02 -04:00

34 lines
587 B
Plaintext

rooms = ["Library", "Kitchen"];
suspects = ["White", "Green"];
weapons = ["Rope", "Lead Pipe"];
show_card = function <card> {
(remove rooms card)
(remove suspects card)
(remove weapons card)
}
make_guess = function <current_room> {
if (length suspects) == 1
&& (length rooms) == 1
&& (length weapons) == 1
{
(output 'It was '
+ suspects.0
+ ' in the '
+ rooms.0
+ ' with the '
+ weapons.0
+ '!'
)
} else {
(output 'I accuse '
+ (random suspects)
+ ' in the '
+ current_room
+ ' with the '
+ (random weapons)
+ '!')
}
}