[Toss-devel-svn] SF.net SVN: toss:[1391] trunk/Toss
Status: Beta
Brought to you by:
lukaszkaiser
|
From: <luk...@us...> - 2011-03-25 17:06:26
|
Revision: 1391
http://toss.svn.sourceforge.net/toss/?rev=1391&view=rev
Author: lukaszkaiser
Date: 2011-03-25 17:06:20 +0000 (Fri, 25 Mar 2011)
Log Message:
-----------
Correcting manual breakthrough translation.
Modified Paths:
--------------
trunk/Toss/GGP/GDL.ml
trunk/Toss/Server/Server.ml
Added Paths:
-----------
trunk/Toss/GGP/examples/breakthrough_orig.gdl
Modified: trunk/Toss/GGP/GDL.ml
===================================================================
--- trunk/Toss/GGP/GDL.ml 2011-03-25 02:06:51 UTC (rev 1390)
+++ trunk/Toss/GGP/GDL.ml 2011-03-25 17:06:20 UTC (rev 1391)
@@ -3884,7 +3884,7 @@
match actions with
| [Func ("MOVE", [Const x1; Const y1; Const x2; Const y2]);
Const "NOOP"] when x1 = x2 ->
- "WhiteMove",
+ "WhiteStraight",
["a1", Structure.board_coords_name (s2i x1, s2i y1);
"a2", Structure.board_coords_name (s2i x2, s2i y2)]
| [Func ("MOVE", [Const x1; Const y1; Const x2; Const y2]);
@@ -3895,7 +3895,7 @@
| [Const "NOOP";
Func ("MOVE", [Const x1; Const y1; Const x2; Const y2])]
when x1 = x2 ->
- "BlackMove",
+ "BlackStraight",
["a2", Structure.board_coords_name (s2i x1, s2i y1);
"a1", Structure.board_coords_name (s2i x2, s2i y2)]
| [Const "NOOP";
@@ -4007,7 +4007,7 @@
let struc = (snd new_state).Arena.struc in
match emb with
| [(_,a); (_,b)] ->
- let a, b = if rule = "BlackMove" then a, b else b, a in
+ let a, b = if rule = "BlackStraight" then a, b else b, a in
let x1, y1 =
Structure.board_elem_coords (Structure.elem_str struc a)
and x2, y2 =
Added: trunk/Toss/GGP/examples/breakthrough_orig.gdl
===================================================================
--- trunk/Toss/GGP/examples/breakthrough_orig.gdl (rev 0)
+++ trunk/Toss/GGP/examples/breakthrough_orig.gdl 2011-03-25 17:06:20 UTC (rev 1391)
@@ -0,0 +1,153 @@
+; breakthrough
+;
+; a player wins if he reaches the opposite side of the board
+; or if the opponent has no pieces left
+;
+; the game ends if one player wins (there is no draw)
+
+(role white)
+(role black)
+(init (cellholds 1 1 white))
+(init (cellholds 2 1 white))
+(init (cellholds 3 1 white))
+(init (cellholds 4 1 white))
+(init (cellholds 5 1 white))
+(init (cellholds 6 1 white))
+(init (cellholds 7 1 white))
+(init (cellholds 8 1 white))
+(init (cellholds 1 2 white))
+(init (cellholds 2 2 white))
+(init (cellholds 3 2 white))
+(init (cellholds 4 2 white))
+(init (cellholds 5 2 white))
+(init (cellholds 6 2 white))
+(init (cellholds 7 2 white))
+(init (cellholds 8 2 white))
+(init (cellholds 1 7 black))
+(init (cellholds 2 7 black))
+(init (cellholds 3 7 black))
+(init (cellholds 4 7 black))
+(init (cellholds 5 7 black))
+(init (cellholds 6 7 black))
+(init (cellholds 7 7 black))
+(init (cellholds 8 7 black))
+(init (cellholds 1 8 black))
+(init (cellholds 2 8 black))
+(init (cellholds 3 8 black))
+(init (cellholds 4 8 black))
+(init (cellholds 5 8 black))
+(init (cellholds 6 8 black))
+(init (cellholds 7 8 black))
+(init (cellholds 8 8 black))
+(init (control white))
+(<= (legal white (move ?x ?y1 ?x ?y2))
+ (true (control white))
+ (true (cellholds ?x ?y1 white))
+ (++ ?y1 ?y2)
+ (cellempty ?x ?y2))
+(<= (legal white (move ?x1 ?y1 ?x2 ?y2))
+ (true (control white))
+ (true (cellholds ?x1 ?y1 white))
+ (++ ?y1 ?y2)
+ (++ ?x1 ?x2)
+ (not (true (cellholds ?x2 ?y2 white))))
+(<= (legal white (move ?x1 ?y1 ?x2 ?y2))
+ (true (control white))
+ (true (cellholds ?x1 ?y1 white))
+ (++ ?y1 ?y2)
+ (++ ?x2 ?x1)
+ (not (true (cellholds ?x2 ?y2 white))))
+(<= (legal black (move ?x ?y1 ?x ?y2))
+ (true (control black))
+ (true (cellholds ?x ?y1 black))
+ (++ ?y2 ?y1)
+ (cellempty ?x ?y2))
+(<= (legal black (move ?x1 ?y1 ?x2 ?y2))
+ (true (control black))
+ (true (cellholds ?x1 ?y1 black))
+ (++ ?y2 ?y1)
+ (++ ?x1 ?x2)
+ (not (true (cellholds ?x2 ?y2 black))))
+(<= (legal black (move ?x1 ?y1 ?x2 ?y2))
+ (true (control black))
+ (true (cellholds ?x1 ?y1 black))
+ (++ ?y2 ?y1)
+ (++ ?x2 ?x1)
+ (not (true (cellholds ?x2 ?y2 black))))
+(<= (legal white noop)
+ (true (control black)))
+(<= (legal black noop)
+ (true (control white)))
+(<= (next (cellholds ?x2 ?y2 ?player))
+ (role ?player)
+ (does ?player (move ?x1 ?y1 ?x2 ?y2)))
+(<= (next (cellholds ?x3 ?y3 ?state))
+ (true (cellholds ?x3 ?y3 ?state))
+ (role ?player)
+ (does ?player (move ?x1 ?y1 ?x2 ?y2))
+ (distinctcell ?x1 ?y1 ?x3 ?y3)
+ (distinctcell ?x2 ?y2 ?x3 ?y3))
+(<= (next (control white))
+ (true (control black)))
+(<= (next (control black))
+ (true (control white)))
+(<= terminal
+ whitewin)
+(<= terminal
+ blackwin)
+(<= (goal white 100)
+ whitewin)
+(<= (goal white 0)
+ (not whitewin))
+(<= (goal black 100)
+ blackwin)
+(<= (goal black 0)
+ (not blackwin))
+(<= (cell ?x ?y)
+ (index ?x)
+ (index ?y))
+(<= (cellempty ?x ?y)
+ (cell ?x ?y)
+ (not (true (cellholds ?x ?y white)))
+ (not (true (cellholds ?x ?y black))))
+(<= (distinctcell ?x1 ?y1 ?x2 ?y2)
+ (cell ?x1 ?y1)
+ (cell ?x2 ?y2)
+ (distinct ?x1 ?x2))
+(<= (distinctcell ?x1 ?y1 ?x2 ?y2)
+ (cell ?x1 ?y1)
+ (cell ?x2 ?y2)
+ (distinct ?y1 ?y2))
+(<= whitewin
+ (index ?x)
+ (true (cellholds ?x 8 white)))
+(<= whitewin
+ (not blackcell))
+(<= blackwin
+ (index ?x)
+ (true (cellholds ?x 1 black)))
+(<= blackwin
+ (not whitecell))
+(<= whitecell
+ (cell ?x ?y)
+ (true (cellholds ?x ?y white)))
+(<= blackcell
+ (cell ?x ?y)
+ (true (cellholds ?x ?y black)))
+(index 1)
+(index 2)
+(index 3)
+(index 4)
+(index 5)
+(index 6)
+(index 7)
+(index 8)
+(++ 1 2)
+(++ 2 3)
+(++ 3 4)
+(++ 4 5)
+(++ 5 6)
+(++ 6 7)
+(++ 7 8)
+
+
Modified: trunk/Toss/Server/Server.ml
===================================================================
--- trunk/Toss/Server/Server.ml 2011-03-25 02:06:51 UTC (rev 1390)
+++ trunk/Toss/Server/Server.ml 2011-03-25 17:06:20 UTC (rev 1391)
@@ -622,7 +622,7 @@
parse_game_descr (String.uppercase gdl) in
if !load_gdl then (
GDL.tictactoe_descr := Some (load_rules "tictactoe.gdl");
- GDL.breakthrough_descr := Some (load_rules "breakthrough.gdl");
+ GDL.breakthrough_descr := Some (load_rules "breakthrough_orig.gdl");
GDL.connect5_descr := Some (load_rules "connect5.gdl");
GDL.connect4_descr := Some (load_rules "connect4.gdl");
GDL.pawn_whopping_descr := Some (load_rules "pawn_whopping.gdl");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|