Comment detail

リストを逆順に表示 (Nested Flatten)
非実用的解です。
考え方自体は、言語非依存です。
一秒おきに、逆順に表示します。
1
2
3
4
5
6
7
wait_do(P,T):-thread_create((sleep(T),P),_,[]).

revp(L):-length(L,LL),
        (between(1,LL,I),nth1(I,L,C),T is LL - I,wait_do(writeln(C),T),fail
        ;true).

:-revp([a,b,c,d,e,f,g]).

Index

Feed

Other

Link

Pathtraq

loading...