Gamemaster
General
Game
Playing
jointbuttonsandlights
Description
Rulesheet
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% jointbuttonsandlights %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% metadata %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% role(robot) base(p(X)) :- index(X) base(q(X)) :- index(X) base(r(X)) :- index(X) base(stopped) base(step(X,1)) :- index(X) base(step(X,2)) :- index(X) base(step(X,3)) :- index(X) base(step(X,4)) :- index(X) base(step(X,5)) :- index(X) base(step(X,6)) :- index(X) base(step(X,7)) :- index(X) action(a(X)) :- index(X) action(b(X)) :- index(X) action(c(X)) :- index(X) action(stop) index(1) index(2) index(3) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% init %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% init(step(1,1)) init(step(2,1)) init(step(3,1)) init(control(robot)) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% legal %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% legal(a(X)) :- index(X) & ~step(X,7) legal(b(X)) :- index(X) & ~step(X,7) legal(c(X)) :- index(X) & ~step(X,7) legal(stop) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% operations %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% a(X) :: ~p(X) ==> p(X) a(X) :: p(X) ==> ~p(X) a(X) :: step(X,M) & successor(M,N) ==> ~step(X,M) & step(X,N) b(X) :: q(X) ==> p(X) b(X) :: ~q(X) ==> ~p(X) b(X) :: p(X) ==> q(X) b(X) :: ~p(X) ==> ~q(X) b(X) :: step(X,M) & successor(M,N) ==> ~step(X,M) & step(X,N) c(X) :: q(X) ==> r(X) c(X) :: ~q(X) ==> ~r(X) c(X) :: r(X) ==> q(X) c(X) :: ~r(X) ==> ~q(X) c(X) :: step(X,M) & successor(M,N) ==> ~step(X,M) & step(X,N) stop :: stopped %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% goal %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% goal(robot,100) :- done(1) & done(2) & done(3) done(X) :- p(X) & q(X) & r(X) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% terminal %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% terminal :- stopped %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% data %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% successor(1,2) successor(2,3) successor(3,4) successor(4,5) successor(5,6) successor(6,7) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Stylesheet
//------------------------------------------------------------------------------ // multiplebuttonsandlights //------------------------------------------------------------------------------ function renderstate (state) {var table = document.createElement('table'); table.setAttribute('cellspacing','0'); table.setAttribute('border','0'); var row = table.insertRow(0); var cell = row.insertCell(0); cell.appendChild(maketable('1',state)); cell = row.insertCell(1); cell.appendChild(maketable('2',state)); cell = row.insertCell(2); cell.appendChild(maketable('3',state)); return table} function maketable (component,state) {var table = document.createElement('table'); table.setAttribute('cellspacing','0'); table.setAttribute('bgcolor','white'); table.setAttribute('border','4'); makerow(table,0,component,state); return table} function makerow (table,rownum,component,state) {var row =table.insertRow(rownum); makecell(row,seq('p',component),state); makecell(row,seq('q',component),state); makecell(row,seq('r',component),state); return row} function makecell (row,light,state) {var cell = row.insertCell(row.cells.length); cell.setAttribute('width','40'); cell.setAttribute('height','40'); cell.setAttribute('align','center'); cell.setAttribute('valign','center'); if (compfindp(light,state,seq())) {cell.innerHTML = '
'} else {cell.innerHTML = '
'}; return cell} //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ //------------------------------------------------------------------------------
Ownership