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 dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by jdf442

  1. jdf442

    Converting string to integers or chars to integers

    Cheers Joel!!!
  2. jdf442

    Template class problems with declaring type

    Or what if i make the Container class a friend of the Numbers and Letters class?
  3. jdf442

    Template class problems with declaring type

    Hey, Thanks for the reply. Is there anyway of doing typecasting without having to create a base class??
  4. jdf442

    Trouble with Template class and Types

    hey guys, I have created my own templated container class called Container to hold other class objects in my program. My program has two classes: 1. Numbers 2. Letters When the program runs the user enters a filename with the firstline being the class type (being a 1 for class type Numbers...
  5. jdf442

    Template class problems with declaring type

    hey guys, I have created my own templated container class called Container to hold other class objects in my program. My program has two classes: 1. Numbers 2. Letters When the program runs the user enters a filename with the firstline being the class type (being a 1 for class type Numbers...
  6. jdf442

    Changing elements of a list

    Thankyou Kahleen!!! you help is much appreciated :)
  7. jdf442

    Changing elements of a list

    thanks for the reply, so i figue the relation ship between X Y and Z is X = 0 -> Z = Y; Z = X; ?? a([X|L1],[Y|L2],[Z|L3]) :- X = 0 -> Z = Y; Z = X; a(L1,L2,L3). when i use this it returns X = (1,_h173). Im really sorry for bothering you, and i know i must be frustrating you because i cant...
  8. jdf442

    Changing elements of a list

    ok, i now understand that you can only add things to the head of a list. I am confused in your example of why you would send just the tail (LZ) of the third list (Z) back to the function and not the whole list? here is what i understand: 1. work_a_list([X|Lx],[Y|Ly],Z) :- 2. X = 0, 3...
  9. jdf442

    Changing elements of a list

    ok, thanks for the tips. i have been trying to do it for a single list like you suggested and this is what i have come up with. work_a_list([],[],[]). work_a_list([X|L1],[Y|L2],Z) :- X = 0 -> work_a_list(L1,L2,[Z|X]); work_a_list(L1,L2,[Z|Y]). where the first argument is the list [1,0,5] and...
  10. jdf442

    Changing elements of a list

    Hey, i am new to this forum so hope i am asking this question in the right spot, sorry if im not! I just started prolog and am trying to understand lists. say i have two lists of lists eg: L1 = [[_,_,_],[_,_,_],[_,_,_]. L2 = [[1,0,5],[8,2,0],[0,0,9]]. how do i compare the two lists of lists...

Part and Inventory Search

Back
Top