Re: strange behaviuor
- From: Marco <cimmo@xxxxxxxxx>
- Date: Thu, 12 Jan 2006 17:45:04 +0100
Works here, sort of. I'd tackle this a different way.
generate(N,L,L1) :- length(L,X), X > 0, Y is random(X), remove_nth(Y,L,N,L1).
then
generate(N,[1,2,3],L1).
to get
N = 2 L1 = [1,3]
Many thanx, I'm using SWI-Prolog 5.4.7 and remove_nth doesn't exist...
bye .
- Follow-Ups:
- Re: strange behaviuor
- From: Geoffrey Summerhayes
- Re: strange behaviuor
- References:
- strange behaviuor
- From: Marco
- Re: strange behaviuor
- From: Geoffrey Summerhayes
- strange behaviuor
- Prev by Date: jProlog and RedHat Linux 8.0
- Next by Date: Re: strange behaviuor
- Previous by thread: Re: strange behaviuor
- Next by thread: Re: strange behaviuor
- Index(es):