Something that the other (excellent) answer did not mention:
Access to the list item by its position means that you need to go through the list. Access to the term argument should be possible at a constant time. Thus, for random access, the term should be more effective.
Put aside: you can try to make the list move slightly faster. But the SWI-Prolog implementationnth0_det/3 almost smells like despair;)
, . , .
.
:
:
: , , . , . - : Prolog .
, , , . , , .
, , , . , , " " ++, , ( " O" ) , .
user1812457