Gamemaster
General
Game
Playing
family
Description
A family of 5 (a, b, c, d, e) want to cross a river by boat. The boat is capable of holding at most 2 people at a time. Travel time for person a takes 1 minute; person b takes 3 minutes; person c takes 6 minutes; person d takes 8 minutes; and person e takes 12 minutes. If two people row the boat at the same time, the boat goes at the slower person's pace. To win the game, a player must find a series of 7 crossings that gets all five people across the river in no more than 29 minutes.
Rulesheet
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% family %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% metadata %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% role(robot) base(location(X,left)) :- individual(X) base(location(X,right)) :- individual(X) base(boat(left)) base(boat(right)) base(current(M)) :- step(N) base(control(robot)) action(left(X)) :- person(X) action(right(X)) :- person(X) action(left(X,Y)) :- person(X) & person(Y) & symless(X,Y) action(right(X,Y)) :- person(X) & person(Y) & symless(X,Y) person(a) person(b) person(c) person(d) person(e) pace(a,1) pace(b,3) pace(c,6) pace(d,8) pace(e,12) step(1) step(2) step(3) step(4) step(5) step(6) step(7) step(8) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% init %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% init(location(a,left)) init(location(b,left)) init(location(c,left)) init(location(d,left)) init(location(e,left)) init(boat(left)) init(clock(0)) init(current(1)) init(control(robot)) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% legal %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% legal(left(X)) :- boat(right) & location(X,right) legal(right(X)) :- boat(left) & location(X,left) legal(left(X,Y)) :- boat(right) & location(X,right) & location(Y,right) & symless(X,Y) legal(right(X,Y)) :- boat(left) & location(X,left) & location(Y,left) & symless(X,Y) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% operations %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% left(X) :: ~boat(right) & ~location(X,right) & boat(left) & location(X,left) & kerchunk & tick(X) right(X) :: ~boat(left) & ~location(X,left) & boat(right) & location(X,right) & kerchunk & tick(X) left(X,Y) :: ~boat(right) & ~location(X,right) & ~location(Y,right) & boat(left) & location(X,left) & location(Y,left) & kerchunk & ticket(X,Y) right(X,Y) :: ~boat(left) & ~location(X,left) & ~location(Y,left) & boat(right) & location(X,right) & location(Y,right) & kerchunk & ticket(X,Y) kerchunk :: current(M) & succ(M,N) ==> ~current(M) & current(N) tick(X) :: clock(O) & pace(X,D) & evaluate(plus(O,D),N) ==> ~clock(O) & clock(N) ticket(X,Y) :: clock(O) & pace(X,C) & pace(Y,D) & evaluate(plus(O,max(C,D)),N) ==> ~clock(O) & clock(N) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% goal %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% goal(robot,100) :- countofall(X,location(X,right),5) & clock(C) & leq(C,29) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% terminal %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% terminal :- current(8) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% Views %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% Facts %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% succ(1,2) succ(2,3) succ(3,4) succ(4,5) succ(5,6) succ(6,7) succ(7,8) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Stylesheet
//------------------------------------------------------------------------------ // family //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ // stylesheet //------------------------------------------------------------------------------ function renderstate (state) {var step = compfindx('N',seq('current','N'),state,library); var clock = compfindx('N',seq('clock','N'),state,library); var table = document.createElement('table'); table.setAttribute('border','0'); var row = table.insertRow(0); var cell = row.insertCell(0); cell.setAttribute('align','center'); cell.setAttribute('style','font-size:20px'); cell.innerHTML = 'Step: ' + step + ' ' + 'Clock: ' + clock; row = table.insertRow(1); var cell = row.insertCell(0); var board = renderboard(state); cell.appendChild(board); return table} function renderboard (state) {var table = document.createElement('table'); table.setAttribute('cellspacing','0'); table.setAttribute('border','1'); var row =table.insertRow(0); var cell = row.insertCell(0); cell.setAttribute('width',50); cell.setAttribute('align','center'); cell.appendChild(makebank('left',state)); var cell = row.insertCell(1); cell.setAttribute('width',100); cell.setAttribute('bgcolor',"#eeeeee"); var cell = row.insertCell(2); cell.setAttribute('width',50); cell.setAttribute('align','center'); cell.appendChild(makebank('right',state)); return table} function makebank (side,state) {var table = document.createElement('table'); table.setAttribute('width','50'); table.setAttribute('cellspacing','0'); var row =table.insertRow(0); var cell = row.insertCell(0); cell.setAttribute('align','center'); if (compfindp(seq('location','a',side),state,[])) {cell.innerHTML = 'a'} else {cell.innerHTML = ' '}; var row =table.insertRow(1); var cell = row.insertCell(0); cell.setAttribute('align','center'); if (compfindp(seq('location','b',side),state,[])) {cell.innerHTML = 'b'} else {cell.innerHTML = ' '}; var row =table.insertRow(2); var cell = row.insertCell(0); cell.setAttribute('align','center'); if (compfindp(seq('location','c',side),state,[])) {cell.innerHTML = 'c'} else {cell.innerHTML = ' '}; var row =table.insertRow(3); var cell = row.insertCell(0); cell.setAttribute('align','center'); if (compfindp(seq('location','d',side),state,[])) {cell.innerHTML = 'd'} else {cell.innerHTML = ' '}; var row =table.insertRow(4); var cell = row.insertCell(0); cell.setAttribute('align','center'); if (compfindp(seq('location','e',side),state,[])) {cell.innerHTML = 'e'} else {cell.innerHTML = ' '}; var row =table.insertRow(5); var cell = row.insertCell(0); cell.setAttribute('align','center'); if (compfindp(seq('boat',side),state,[])) {cell.innerHTML = 'boat'} else {cell.innerHTML = ' '}; return table} //============================================================================== //============================================================================== //==============================================================================
Ownership