Pelican Hunters
0
0
0
Player: indy
Lambda
Library
legal(X,Y) :- file(X) & rank(Y) click(cell(M,N)) :: control(P) & location(cell(OM,ON),P) ==> ~location(cell(OM,ON),P) click(cell(M,N)) :: control(P) ==> location(cell(M,N),P) click(cell(M,N)) :: location(cell(M,N),P) ==> ~location(cell(M,N),P) click(cell(M,N)) :: control(P) & location(cell(M,N),gold) ==> has(P,gold) click(cell(M,N)) :: control(P) & location(cell(M,N),diamond) ==> has(P,diamond) click(cell(M,N)) :: control(indy) ==> ~control(indy) & control(lara) click(cell(M,N)) :: control(lara) ==> ~control(lara) & control(indy)
role(indy) role(lara) file(a) file(b) file(c) file(d) file(e) file(f) file(g) file(h) rank(1) rank(2) rank(3) rank(4) rank(5) rank(6) rank(7) rank(8) succ(1,2) succ(2,3) succ(3,4) succ(4,5) succ(5,6) succ(6,7) succ(7,8) succ(a,b) succ(b,c) succ(c,d) succ(d,e) succ(e,f) succ(f,g) succ(g,h) goal(Player,100) :- has(Player,gold) & has(Player,diamond) goal(Player,50) :- has(Player,gold) & ~has(Player,diamond) goal(Player,50) :- has(Player,diamond) & ~has(Player,gold) goal(Player,0) :- ~has(Player,gold) & ~has(Player,diamond) social(Score) :- goal(indy,Indy) & goal(lara,Lara) & evaluate(plus(Indy,Lara),Efficiency) & evaluate(minus(1,quotient(abs(minus(Indy,Lara)),200)),Equity) & times(Efficiency,Equity,Score) terminal :- ~playable terminal :- ~infested playable :- location(X,indy) & location(Y,lara) infested :- location(X,pelican) empty(M,N) :- file(M) & rank(N) & ~location(cell(M,N),indy) & ~location(cell(M,N),lara) & ~location(cell(M,N),pelican) & ~location(cell(M,N),gold) & ~location(cell(M,N),diamond) adjacent(cell(X1,Y),cell(X2,Y)) :- succ(X1,X2) & rank(Y) adjacent(cell(X1,Y),cell(X2,Y)) :- succ(X2,X1) & rank(Y) adjacent(cell(X,Y1),cell(X,Y2)) :- succ(Y1,Y2) & file(X) adjacent(cell(X,Y1),cell(X,Y2)) :- succ(Y2,Y1) & file(X) adjacent(cell(X1,Y1),cell(X2,Y2)) :- succ(X1,X2) & succ(Y1,Y2) adjacent(cell(X1,Y1),cell(X2,Y2)) :- succ(X2,X1) & succ(Y1,Y2) adjacent(cell(X1,Y1),cell(X2,Y2)) :- succ(X1,X2) & succ(Y2,Y1) adjacent(cell(X1,Y1),cell(X2,Y2)) :- succ(X2,X1) & succ(Y2,Y1) innerhtml(socialreward,N) :- social(N) innerhtml(cell(M,N),"
") :- location(cell(M,N),indy) innerhtml(cell(M,N),"
") :- location(cell(M,N),lara) innerhtml(cell(M,N),"
") :- location(cell(M,N),gold) innerhtml(cell(M,N),"
") :- location(cell(M,N),diamond) innerhtml(cell(M,N),"
") :- location(cell(M,N),pelican) innerhtml(cell(M,N)," ") :- empty(M,N) innerhtml(indyreward,N) :- goal(indy,N) innerhtml(indygold,"
") :- has(indy,gold) innerhtml(indygold," ") :- ~has(indy,gold) innerhtml(indydiamond,"
") :- has(indy,diamond) innerhtml(indydiamond," ") :- ~has(indy,diamond) innerhtml(larareward,N) :- goal(lara,N) innerhtml(laragold,"
") :- has(lara,gold) innerhtml(laragold," ") :- ~has(lara,gold) innerhtml(laradiamond,"
") :- has(lara,diamond) innerhtml(laradiamond," ") :- ~has(lara,diamond) innerhtml(control,CS) :- ~terminal & control(P) & stringappend("Player: ",P,CS) innerhtml(control,"Game Over") :- terminal style(cell(M,N),"cursor","pointer") :- ~terminal & legal(M,N) style(cell(M,N),"cursor","text") :- ~terminal & file(M) & rank(N) & ~legal(M,N) style(cell(M,N),"cursor","text") :- terminal & file(M) & rank(N) style(cell(M,N),"boxShadow","0px 0px 2px 2px rgba(54,239,72,0.8)") :- legal(M,N) style(cell(M,N),"boxShadow","none") :- file(M) & rank(N) & ~legal(M,N) attribute(cell(M,N),"onclick","modbutton(this)") :- ~terminal & legal(M,N) attribute(cell(M,N),"onclick","true") :- ~terminal & file(M) & rank(N) & ~legal(M,N) attribute(cell(M,N),"onclick","true") :- terminal & file(M) & rank(N)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% Lambda %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% location(cell(a,1),gold) location(cell(a,8),diamond) location(cell(d,1),indy) location(cell(e,8),lara) location(cell(c,3),pelican) location(cell(b,4),pelican) location(cell(b,5),pelican) location(cell(c,6),pelican) location(cell(f,3),pelican) location(cell(g,4),pelican) location(cell(g,5),pelican) location(cell(f,6),pelican) location(cell(h,1),diamond) location(cell(h,8),gold) control(indy) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% End of Rules %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%