You are not logged in. login register
Game farmingquandries
name farmingquandries
creator stephan
number of roles 2
stylesheet generic/generic.xsl
GDL v1
enabled
matches show matches
statistics show game statistics
description The board begins as an empty, unclaimed 4x4 grid. Players' actions influence columns and rows of the board. A player claims unclaimed tiles by using the "plow" action. Players can use the "sow" action to sow plowed tiles that belong to them. The "water" action will convert sown tiles to ripe tiles. Finally, if a player uses the "harvest" action on a row or column that contains three or more ripe tiles that belong to him, he gets 10 points. Each of the standard actions can only be performed in a certain season (winter, spring, summer, fall respectively). In addition, every two years, players obtain a "burn" action which clears an entire row or column. Ripe tiles revert to unclaimed tiles in winter, but other tile states persist. by: Peter Pham

Game Description


( role red )
( role blue )

( init ( control red ) )
( init ( season winter ) )
( init ( year_first_player red ) )
( init ( year_second_player blue ) )
( init ( score red 0 ) )
( init ( score blue 0 ) )
( init ( step 0 ) )

( index 1 )
( index 2 )
( index 3 )
( index 4 )

( game_end 80 )
( get_arson 16 )
( get_arson 32 )
( get_arson 48 )
( get_arson 64 )
( get_arson 70 )

( season_list summer )
( season_list fall )
( season_list winter )
( season_list spring )

( <= ( base ( control ?p ) ) ( role ?p ) )
( <= ( base ( season ?s ) ) ( season_list ?s ) )
( <= ( base ( year_first_player ?p ) ) ( role ?p ) )
( <= ( base ( year_second_player ?p ) ) ( role ?p ) )
( <= ( base ( plowed ?p ?i ?j ) ) ( index ?j ) ( index ?i ) ( role ?p ) )
( <= ( base ( sown ?p ?i ?j ) ) ( index ?j ) ( index ?i ) ( role ?p ) )
( <= ( base ( ripe ?p ?i ?j ) ) ( index ?j ) ( index ?i ) ( role ?p ) )

( <= ( base ( has_arson ?p ) ) ( role ?p ) )
( <= ( base ( score ?p ?s ) ) ( role ?p ) ( point_succ_two ?o ?s ) )
( <= ( base ( score ?p ?s ) ) ( role ?p ) ( point_succ_two ?s ?o ) )

( <= ( base ( step ?s ) ) ( succ ?o ?s ) )
( <= ( base ( step ?s ) ) ( succ ?s ?o ) )

( <= ( input ?p ( plow_row ?i ) ) ( index ?i ) ( role ?p ) )
( <= ( input ?p ( plow_col ?j ) ) ( index ?j ) ( role ?p ) )
( <= ( input ?p ( sow_row ?i ) ) ( index ?i ) ( role ?p ) )
( <= ( input ?p ( sow_col ?j ) ) ( index ?j ) ( role ?p ) )
( <= ( input ?p ( water_row ?i ) ) ( index ?i ) ( role ?p ) )
( <= ( input ?p ( water_col ?j ) ) ( index ?j ) ( role ?p ) )
( <= ( input ?p ( harvest_row ?i ) ) ( index ?i ) ( role ?p ) )
( <= ( input ?p ( harvest_col ?j ) ) ( index ?j ) ( role ?p ) )
( <= ( input ?p ( arson_row ?i ) ) ( index ?i ) ( role ?p ) )
( <= ( input ?p ( arson_col ?j ) ) ( index ?j ) ( role ?p ) )
( <= ( input ?p noop ) ( role ?p ) )

( <= ( next ( control blue ) ) ( true ( control red ) ) ( not ( year_transition ) ) )
( <= ( next ( control red ) ) ( true ( control blue ) ) ( not ( year_transition ) ) )
( <= ( next ( control ?p ) ) ( true ( control ?p ) ) ( year_transition ) )

( <= ( legal ?p ( plow_row ?i ) ) ( index ?i ) ( true ( season winter ) ) ( true ( control ?p ) ) )
( <= ( legal ?p ( plow_col ?j ) ) ( index ?j ) ( true ( season winter ) ) ( true ( control ?p ) ) )
( <= ( legal ?p ( sow_row ?i ) ) ( index ?i ) ( true ( season spring ) ) ( true ( control ?p ) ) )
( <= ( legal ?p ( sow_col ?j ) ) ( index ?j ) ( true ( season spring ) ) ( true ( control ?p ) ) )
( <= ( legal ?p ( water_row ?i ) ) ( index ?i ) ( true ( season summer ) ) ( true ( control ?p ) ) )
( <= ( legal ?p ( water_col ?j ) ) ( index ?j ) ( true ( season summer ) ) ( true ( control ?p ) ) )
( <= ( legal ?p ( harvest_row ?i ) ) ( index ?i ) ( true ( season fall ) ) ( true ( control ?p ) ) )
( <= ( legal ?p ( harvest_col ?j ) ) ( index ?j ) ( true ( season fall ) ) ( true ( control ?p ) ) )
( <= ( legal ?p ( arson_row ?i ) ) ( index ?i ) ( true ( has_arson ?p ) ) ( not ( true ( control ?p ) ) ) )
( <= ( legal ?p ( arson_col ?j ) ) ( index ?j ) ( true ( has_arson ?p ) ) ( not ( true ( control ?p ) ) ) )
( <= ( legal ?p noop ) ( role ?p ) ( not ( true ( control ?p ) ) ) )

( <= ( filled ?i ?j ) ( true ( plowed ?p ?i ?j ) ) )
( <= ( filled ?i ?j ) ( true ( sown ?p ?i ?j ) ) )
( <= ( filled ?i ?j ) ( true ( ripe ?p ?i ?j ) ) )

( <= ( using_arson ?p ) ( does ?p ( arson_row ?i ) ) )
( <= ( using_arson ?p ) ( does ?p ( arson_col ?j ) ) )

( <= ( burning_row ?i ) ( does ?p ( arson_row ?i ) ) )
( <= ( burning_col ?j ) ( does ?p ( arson_col ?j ) ) )

( <= ( sowing ?p ?i ?j ) ( true ( plowed ?p ?i ?j ) ) ( does ?q ( sow_row ?i ) ) )
( <= ( sowing ?p ?i ?j ) ( true ( plowed ?p ?i ?j ) ) ( does ?q ( sow_col ?j ) ) )

( <= ( watering ?p ?i ?j ) ( true ( sown ?p ?i ?j ) ) ( does ?q ( water_row ?i ) ) )
( <= ( watering ?p ?i ?j ) ( true ( sown ?p ?i ?j ) ) ( does ?q ( water_col ?j ) ) )

( <= ( season_transition ) ( true ( control ?p ) ) ( true ( year_second_player ?p ) ) )
( <= ( next ( season summer ) ) ( true ( season spring ) ) ( season_transition ) )
( <= ( next ( season fall ) ) ( true ( season summer ) ) ( season_transition ) ) 
( <= ( next ( season winter ) ) ( true ( season fall ) ) ( season_transition ) )
( <= ( next ( season spring ) ) ( true ( season winter ) ) ( season_transition ) )
( <= ( next ( season ?s ) ) ( true ( season ?s ) ) ( not ( season_transition ) ) )

( <= ( year_transition ) ( true ( season fall ) ) ( true ( control ?p ) ) ( true ( year_second_player ?p ) ) )

( <= ( next ( year_first_player red ) ) ( true ( year_first_player blue ) ) ( year_transition ) )
( <= ( next ( year_first_player blue ) ) ( true ( year_first_player red ) ) ( year_transition ) )
( <= ( next ( year_second_player red ) ) ( true ( year_second_player blue ) ) ( year_transition ) )
( <= ( next ( year_second_player blue ) ) ( true ( year_second_player red ) ) ( year_transition ) )
( <= ( next ( year_first_player ?p ) ) ( true ( year_first_player ?p ) ) ( not ( year_transition ) ) )
( <= ( next ( year_second_player ?p ) ) ( true ( year_second_player ?p ) ) ( not ( year_transition ) ) )

( <= ( next ( plowed ?p ?i ?j ) ) ( index ?j ) ( does ?p ( plow_row ?i ) ) ( not ( filled ?i ?j ) ) )
( <= ( next ( plowed ?p ?i ?j ) ) ( index ?i ) ( does ?p ( plow_col ?j ) ) ( not ( filled ?i ?j ) ) )
( <= ( next ( plowed ?p ?i ?j ) ) ( true ( plowed ?p ?i ?j ) ) ( not ( burning_row ?i ) ) ( not ( burning_col ?j ) ) ( not ( sowing ?p ?i ?j ) ) )
( <= ( next ( sown ?p ?i ?j ) ) ( sowing ?p ?i ?j ) )
( <= ( next ( sown ?p ?i ?j ) ) ( true ( sown ?p ?i ?j ) ) ( not ( burning_row ?i ) ) ( not ( burning_col ?j ) ) ( not ( watering ?p ?i ?j ) ) )
( <= ( next ( ripe ?p ?i ?j ) ) ( watering ?p ?i ?j ) )
( <= ( next ( ripe ?p ?i ?j ) ) ( true ( ripe ?p ?i ?j ) ) ( not ( burning_row ?i ) ) ( not ( burning_col ?j ) ) ( not ( true ( season winter ) ) ) )

( <= ( use_arson ?p ) ( does ?p ( arson_row ?i ) ) )
( <= ( use_arson ?p ) ( does ?p ( arson_col ?j ) ) )

( <= ( next ( has_arson ?p ) ) ( true ( has_arson ?p ) ) ( not ( use_arson ?p ) ) )
( <= ( next ( has_arson ?p ) ) ( role ?p ) ( true ( step ?s ) ) ( get_arson ?s ) )

( <= ( three_in_row ?p ?i ) ( true ( ripe ?p ?i 1 ) ) ( true ( ripe ?p ?i 2 ) ) ( true ( ripe ?p ?i 3 ) ) )
( <= ( three_in_row ?p ?i ) ( true ( ripe ?p ?i 2 ) ) ( true ( ripe ?p ?i 3 ) ) ( true ( ripe ?p ?i 4 ) ) )
( <= ( three_in_row ?p ?i ) ( true ( ripe ?p ?i 1 ) ) ( true ( ripe ?p ?i 2 ) ) ( true ( ripe ?p ?i 4 ) ) )
( <= ( three_in_row ?p ?i ) ( true ( ripe ?p ?i 1 ) ) ( true ( ripe ?p ?i 3 ) ) ( true ( ripe ?p ?i 4 ) ) )
( <= ( three_in_col ?p ?j ) ( true ( ripe ?p 1 ?j ) ) ( true ( ripe ?p 2 ?j ) ) ( true ( ripe ?p 3 ?j ) ) )
( <= ( three_in_col ?p ?j ) ( true ( ripe ?p 2 ?j ) ) ( true ( ripe ?p 3 ?j ) ) ( true ( ripe ?p 4 ?j ) ) )
( <= ( three_in_col ?p ?j ) ( true ( ripe ?p 1 ?j ) ) ( true ( ripe ?p 3 ?j ) ) ( true ( ripe ?p 4 ?j ) ) )
( <= ( three_in_col ?p ?j ) ( true ( ripe ?p 1 ?j ) ) ( true ( ripe ?p 2 ?j ) ) ( true ( ripe ?p 4 ?j ) ) )

( <= ( score_two ?p ) ( three_in_row ?p ?i ) ( does ?p ( harvest_row ?i ) ) )
( <= ( score_two ?p ) ( three_in_col ?p ?j ) ( does ?p ( harvest_col ?j ) ) )

( <= ( next ( score ?p ?s ) ) ( true ( score ?p ?o ) ) ( point_succ_two ?o ?s ) ( score_two ?p ) )
( <= ( next ( score ?p ?s ) ) ( true ( score ?p ?s ) ) ( not ( score_two ?p ) ) )
( <= ( next ( score ?p 100 ) ) ( true ( score ?p 100 ) ) )

( <= ( next ( step ?s ) ) ( true ( step ?o ) ) ( succ ?o ?s ) )

( <= ( goal ?p ?s ) ( true ( score ?p ?s ) ) )

( <= terminal ( true ( step ?s ) ) ( game_end ?s ) )

( point_succ_two 0 10 )
( point_succ_two 10 20 )
( point_succ_two 20 30 )
( point_succ_two 30 40 )
( point_succ_two 40 50 )
( point_succ_two 50 60 )
( point_succ_two 60 70 )
( point_succ_two 70 80 )
( point_succ_two 80 90 )
( point_succ_two 90 100 )

( succ 0 1 )
( succ 1 2 )
( succ 2 3 )
( succ 3 4 )
( succ 4 5 )
( succ 5 6 )
( succ 6 7 )
( succ 7 8 )
( succ 8 9 )
( succ 9 10 )
( succ 10 11 )
( succ 11 12 )
( succ 12 13 )
( succ 13 14 )
( succ 14 15 )
( succ 15 16 )
( succ 16 17 )
( succ 17 18 )
( succ 18 19 )
( succ 19 20 )
( succ 20 21 )
( succ 21 22 )
( succ 22 23 )
( succ 23 24 )
( succ 24 25 )
( succ 25 26 )
( succ 26 27 )
( succ 27 28 )
( succ 28 29 )
( succ 29 30 )
( succ 30 31 )
( succ 31 32 )
( succ 32 33 )
( succ 33 34 )
( succ 34 35 )
( succ 35 36 )
( succ 36 37 )
( succ 37 38 )
( succ 38 39 )
( succ 39 40 )
( succ 40 41 )
( succ 41 42 )
( succ 42 43 )
( succ 43 44 )
( succ 44 45 )
( succ 45 46 )
( succ 46 47 )
( succ 47 48 )
( succ 48 49 )
( succ 49 50 )
( succ 50 51 )
( succ 51 52 )
( succ 52 53 )
( succ 53 54 )
( succ 54 55 )
( succ 55 56 )
( succ 56 57 )
( succ 57 58 )
( succ 58 59 )
( succ 59 60 )
( succ 60 61 )
( succ 61 62 )
( succ 62 63 )
( succ 63 64 )
( succ 64 65 )
( succ 65 66 )
( succ 66 67 )
( succ 67 68 )
( succ 68 69 )
( succ 69 70 )
( succ 70 71 )
( succ 71 72 )
( succ 72 73 )
( succ 73 74 )
( succ 74 75 )
( succ 75 76 )
( succ 76 77 )
( succ 77 78 )
( succ 78 79 )
( succ 79 80 )
( succ 80 81 )

sees_XML(...) rules

(<= (sees_xml random ?t) (true ?t))
(<= (sees_xml ?p ?t) (role ?p) (distinct ?p random) (true ?t))