katsu #1460(2007/07/26 09:36 GMT) [ Prolog ] Rating0/0=0.00
非実用的解です。 考え方自体は、言語非依存です。 一秒おきに、逆順に表示します。
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]).
Rating0/0=0.00-0+
[ reply ]
katsu
#1460()
[
Prolog
]
Rating0/0=0.00
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]).Rating0/0=0.00-0+
[ reply ]