marlop352 / ant-pri

Implementation in Prolog of ant-pri
1 stars 0 forks source link

print_list #1

Closed nathanmartins closed 8 years ago

nathanmartins commented 8 years ago

Implemented code from print_list.pl into wumpus_world.pl into branch NSS and code won't print list items. Am I doing something wrong?

?- print_list(L).
Lista = [_G1090]

L = [_G1090] ;
, _G1099]

L = [_G1090, _G1099] ;
, _G1108]

L = [_G1090, _G1099, _G1108] ;
, _G1117]

L = [_G1090, _G1099, _G1108, _G1117] ;
, _G1126]

L = [_G1090, _G1099, _G1108, _G1117, _G1126] ;
, _G1135]

L = [_G1090, _G1099, _G1108, _G1117, _G1126, _G1135] 
marlop352 commented 8 years ago

I'm not seeing this branch, did you push it? Yout must call print_list(List) from the scope where the list you wanna print is. As far as I know L is not global.

nathanmartins commented 8 years ago

Which list is the Global List then?

marlop352 commented 8 years ago

there is no global list, the global ""list"" is the database

marlop352 commented 8 years ago

the L list is only used during the world generation and is stored as the "ww_initial_state()" predicate in the database

marlop352 commented 8 years ago

"ww_initial_state(List),print_list(List)." should print the list as it was stored in the database