Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: fxtdr79
  • Content: Threads
  • Order by date
  1. fxtdr79

    Random List Generation

    Trying to write something like generate(L, N) that will generate a list L of size N where each element is either a 0 or a 1. This is what I have but it doesn't work, any suggestions? generate(L, 0) :- !. generate(L, N) :- A is N - 1, B is random(2), generate([B|L], A). I also tried something...
  2. fxtdr79

    Determining list depth using difference lists.

    I'm trying to solve a problem using difference lists (which I don't really understand well and 2 weeks worth of reading on the net hasn't changed that). Basically I want to determine the depth of the elements in a list, ie, if I were to ask depth([a,b,[c,[],[d,e]],f], L) Prolog would answer L...

Part and Inventory Search

Back
Top