Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(debug :search) wrong display of results #41

Open
wpasieka opened this issue Apr 2, 2018 · 0 comments
Open

(debug :search) wrong display of results #41

wpasieka opened this issue Apr 2, 2018 · 0 comments

Comments

@wpasieka
Copy link

wpasieka commented Apr 2, 2018

Dear Mr Norvig,

When running some examples with the debug feature, it seems to be a bug in the code, or I am doing something wrong.

The last result of the first "search" which is (12 13 7) is displayed only when executing another command, like shown below.

I am using CMUCL, but I dont think this is related to the Cl distribution.

Could You please have a look and to advice the solution.

CL-USER>
950(depth-first-search 1 (is 12) (finite-binary-tree 15))
951
952;; Search: (13 7)
953;; Search: (1)
954;; Search: (2 3)
955;; Search: (4 5 3)
956;; Search: (8 9 5 3)
957;; Search: (9 5 3)
958;; Search: (5 3)
959;; Search: (10 11 3)
960;; Search: (11 3)
961;; Search: (3)
962;; Search: (6 7)
963
964 12
965CL-USER> (show-city-path (trip (city 'san-francisco) (city 'boston) 1))
966
967;; Search: (12 13 7)
968;; Search: (#<Path to (SAN-FRANCISCO 122.26 37.47) cost 0.0>)
969;; Search: (#<Path to (RENO 119.49 39.3) cost 4355.0>)
970;; Search: (#<Path to (GRAND-JCT 108.37 39.05) cost 4427.3>)
971;; Search: (#<Path to (DENVER 105.0 39.45) cost 4428.3>)
972;; Search: (#<Path to (KANSAS-CITY 94.35 39.06) cost 4492.0>)
973;; Search: (#<Path to (INDIANAPOLIS 86.1 39.46) cost 4507.1>)
974;; Search: (#<Path to (PITTSBURGH 79.57 40.27) cost 4514.8>)
975#<Path 4514.8 km: San-Francisco - Reno - Grand-Jct - Denver - Kansas-City - Indianapolis - Pittsburgh - Boston>
976CL-USER>

(depth-first-search 1 (is 12) (finite-binary-tree 15))
977
978;; Search: (#<Path to (BOSTON 71.05 42.21) cost 4514.8>)
979;; Search: (1)
980;; Search: (2 3)
981;; Search: (4 5 3)
982;; Search: (8 9 5 3)
983;; Search: (9 5 3)
984;; Search: (5 3)
985;; Search: (10 11 3)
986;; Search: (11 3)
987;; Search: (3)
988;; Search: (6 7)
989
99012

Kind Regards,
Adrian W. Pasieka

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant