From cddf516b050c2cb54d7bc52415fa150866e86eb6 Mon Sep 17 00:00:00 2001 From: Jacob Strong Date: Sat, 30 Nov 2019 21:54:55 -0700 Subject: [PATCH] Correction to display_pylons It is legal to place the small disk on top of the large disk. However as it was before it would not display the small disk if it was above the large disk. This line will now display the small disk above the large one if the medium disk is not present. --- cs4700/projects/prolog/adventure/adventure.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/cs4700/projects/prolog/adventure/adventure.pl b/cs4700/projects/prolog/adventure/adventure.pl index 3a025d9..d18bf01 100644 --- a/cs4700/projects/prolog/adventure/adventure.pl +++ b/cs4700/projects/prolog/adventure/adventure.pl @@ -401,6 +401,7 @@ display_top_disk(_):- write(" | "),!. display_middle_disk(Pylon):- location(small_disk,Pylon), location(medium_disk,Pylon), not(location(large_disk,Pylon)),write(" [|] "),!. +display_middle_disk(Pylon):- location(large_disk,Pylon), location(small_disk,Pylon), not(location(medium_disk,Pylon)), write(" [|] "),!. display_middle_disk(Pylon):- location(large_disk,Pylon), location(medium_disk,Pylon), write(" [-|-] "),!. display_middle_disk(_):- write(" | "),!.