Re: strange behaviuor




"Marco" <cimmo@xxxxxxxxx> wrote in message
news:43c68790$0$342$5fc30a8@xxxxxxxxxxxxxxxxxx
>> 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...
>

So am I. Exercise for the reader :)

--
Geoff


.



Relevant Pages

  • Re: strange behaviuor
    ... I assume this is a typo and reads casuale. ... Works here, sort of. ... Geoff ... Prev by Date: ...
    (comp.lang.prolog)
  • Q: Table within a table
    ... has other tables as entries? ... Does anybody have an idea of how to do this sort of thing? ... Geoff ... Prev by Date: ...
    (microsoft.public.vb.database.ado)
  • Re: Conditional expression problem
    ... a great place to save time trying to sort out problems. ... JL - RMP Days are NOT always on weekends - hence the issue. ... Geoff ... Prev by Date: ...
    (microsoft.public.mac.office.excel)
  • Re: sailing blogs
    ... > Having a ready source of blogs of this sort at sailblogs.com is a good ... Are there other sites for this sort of thing? ... Prev by Date: ...
    (rec.boats.cruising)
  • Re: Gary Taubes interview at Seths Blog
    ... sort of signal that I even thank my subconscious for providing. ... considerable period of time. ... Hope you don't mind me drawing your attention to these matters. ... He educates his reader to the difference ...
    (alt.support.diabetes)