Domain Name Forum

Domain Name Forum (http://www.domainnameforum.org/index.php)
-   Legacy and Other Languages (http://www.domainnameforum.org/forumdisplay.php?f=139)
-   -   how to replace element in difference list of prolog?? (http://www.domainnameforum.org/showthread.php?t=99760)

webdev 06-05-2010 01:46 AM

how to replace element in difference list of prolog??
 
hi: want to replace all elements with the number of its depth in the difference list in prolog. such as: ?- deepList([a, [b]], L). L = [0, [1]]. ?- deepList([a, [b, c, [d, e]], f], L). L = [0, [1, 1, [2, 2]], 0]. Thank!


All times are GMT -4. The time now is 07:29 PM.

Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.