All pastes #382916 Raw Edit

Stuff

public text v1 · immutable
·published 2007-03-06 00:21 UTC
rendered paste body
widget(W,D) :- member(D,[3,4,5,6,7,8,9]).
worker(DaysWorked,[],DaysWorked).
worker(DaysWorked, [W,C,D |WidgetL],  Total) :-
                 widget(W,D),
                 DaysSpentOnW is C * D,
                 T1 is Total + DaysSpentOnW,
                 worker(DaysWorked,WidgetL,T1).

factory([]).
factory([ [DW|WL] | WidgetL]) :- worker(DW,WL,0), factory(WidgetL).