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

Write a predicate 'addbubba' which will place 'bubba' after each atom

Status
Not open for further replies.

rukman

Programmer
Nov 4, 2011
7
US
e.g. ?-addbubba([a,b,c],X).
X=[a,bubba,b,bubba,c,bubba]



I tried like this..


addbubba([],[]).


addbubba([X|Y],[A|B]):- not(integer(X)), isList(Y),A = X,addbubba(Y,B),append(B,'bubba',K).

pls help its urgent...

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top