[Toss-devel-svn] SF.net SVN: toss:[1653] trunk/Toss
Status: Beta
Brought to you by:
lukaszkaiser
From: <luk...@us...> - 2012-01-24 00:49:12
|
Revision: 1653 http://toss.svn.sourceforge.net/toss/?rev=1653&view=rev Author: lukaszkaiser Date: 2012-01-24 00:49:05 +0000 (Tue, 24 Jan 2012) Log Message: ----------- Nicer webpage on game rule learning, cleanups. Modified Paths: -------------- trunk/Toss/Learn/Makefile trunk/Toss/www/xsl/common.xsl Added Paths: ----------- trunk/Toss/Learn/examples/Pawn-Whopping001.toss trunk/Toss/www/learn.xml Removed Paths: ------------- trunk/Toss/Learn/learn.html Modified: trunk/Toss/Learn/Makefile =================================================================== --- trunk/Toss/Learn/Makefile 2012-01-23 23:33:10 UTC (rev 1652) +++ trunk/Toss/Learn/Makefile 2012-01-24 00:49:05 UTC (rev 1653) @@ -34,7 +34,7 @@ make Breakthrough001.learn make Gomoku001.learn make Connect4001.learn - #make Pawn-Whopping001.learn + make Pawn-Whopping001.learn %.reco: @@ -48,7 +48,7 @@ diff res.play.log examples/$(basename $@) rm res.play.log -VIDEOS_TO_TEST = videos/T* +VIDEOS_TO_TEST = videos/* VIDEOS = $(notdir $(shell find $(VIDEOS_TO_TEST) -maxdepth 1 -name '*.3gp')) VIDEOS_BASE = $(basename $(VIDEOS)) VIDEOS_RECO = $(addsuffix .reco, $(VIDEOS_BASE)) @@ -56,6 +56,14 @@ recotests: reco $(VIDEOS_RECO) +%.webm: + ffmpeg -an -i videos/$(basename $@).3gp $@ + +VIDEOS_WEBM = $(addsuffix .webm, $(VIDEOS_BASE)) + +webms: $(VIDEOS_WEBM) + + .PHONY: clean clean: Added: trunk/Toss/Learn/examples/Pawn-Whopping001.toss =================================================================== --- trunk/Toss/Learn/examples/Pawn-Whopping001.toss (rev 0) +++ trunk/Toss/Learn/examples/Pawn-Whopping001.toss 2012-01-24 00:49:05 UTC (rev 1653) @@ -0,0 +1,71 @@ +PLAYERS 1, 2 +REL Win1() = ex x1 (W(x1) and all x0 not C(x1, x0)) +REL Win2() = ex x1 (B(x1) and all x0 not C(x0, x1)) + +RULE Mv1r0: +[e1, e2 | B:1 {}; C:2 {}; Da:2 {}; Db:2 {}; R:2 {}; W (e1) | ] -> [e1, e2 | B:1 {}; C:2 {}; Da:2 {}; Db:2 {}; R:2 {}; W (e2) | ] +emb W,R,Db,Da,C,B +pre (ex x1 + (W(x1) and ex x0 (C(x0, x1) and all x2 not C(x2, x0)) and + ex x0 (C(x1, x0) and ex x2 (C(x0, x2) and x2 = e2)))) and not Win2() +RULE Mv1r1: +[e1, e2 | B:1 {}; C (e1, e2); Da:2 {}; Db:2 {}; R:2 {}; W (e1) | ] -> [e1, e2 | B:1 {}; C (e1, e2); Da:2 {}; Db:2 {}; R:2 {}; W (e2) | ] +emb W,R,Db,Da,C,B +pre (true) and not Win2() +RULE Mv1r2: +[e1, e2 | B (e2); C:2 {}; Da:2 {}; Db (e1, e2); R:2 {}; W (e1) | ] -> [e1, e2 | B:1 {}; C:2 {}; Da:2 {}; Db (e1, e2); R:2 {}; W (e2) | ] +emb W,R,Db,Da,C,B +pre (true) and not Win2() +RULE Mv1r3: +[e1, e2 | B (e2); C:2 {}; Da (e1, e2); Db:2 {}; R:2 {}; W (e1) | ] -> [e1, e2 | B:1 {}; C:2 {}; Da (e1, e2); Db:2 {}; R:2 {}; W (e2) | ] +emb W,R,Db,Da,C,B +pre (true) and not Win2() + + +RULE Mv2r0: +[e1, e2 | B (e2); C:2 {}; Da:2 {}; Db:2 {}; R:2 {}; W:1 {} | ] -> [e1, e2 | B (e1); C:2 {}; Da:2 {}; Db:2 {}; R:2 {}; W:1 {} | ] +emb W,R,Db,Da,C,B +pre (ex x1 + (B(x1) and ex x0 (C(x1, x0) and all x2 not C(x0, x2)) and + ex x0 (C(x0, x1) and ex x2 (C(x2, x0) and x2 = e1)))) and not Win1() +RULE Mv2r1: +[e1, e2 | B (e2); C:2 {}; Da:2 {}; Db (e1, e2); R:2 {}; W (e1) | ] -> [e1, e2 | B (e1); C:2 {}; Da:2 {}; Db (e1, e2); R:2 {}; W:1 {} | ] +emb W,R,Db,Da,C,B +pre (true) and not Win1() +RULE Mv2r2: +[e1, e2 | B (e2); C:2 {}; Da (e1, e2); Db:2 {}; R:2 {}; W (e1) | ] -> [e1, e2 | B (e1); C:2 {}; Da (e1, e2); Db:2 {}; R:2 {}; W:1 {} | ] +emb W,R,Db,Da,C,B +pre (true) and not Win1() +RULE Mv2r3: +[e1, e2 | B (e2); C (e1, e2); Da:2 {}; Db:2 {}; R:2 {}; W:1 {} | ] -> [e1, e2 | B (e1); C (e1, e2); Da:2 {}; Db:2 {}; R:2 {}; W:1 {} | ] +emb W,R,Db,Da,C,B +pre (true) and not Win1() + +LOC 0 { + PLAYER 1 { PAYOFF : (Win1()) - :(Win2()) + MOVES [Mv1r0 -> 1]; [Mv1r1 -> 1]; [Mv1r2 -> 1]; [Mv1r3 -> 1]} + PLAYER 2 { PAYOFF : (Win2()) - :(Win1()) } +} +LOC 1 { + PLAYER 1 { PAYOFF :(Win1()) - :(Win2()) } + PLAYER 2 { PAYOFF :(Win2()) - :(Win1()) + MOVES [Mv2r0 -> 0]; [Mv2r1 -> 0]; [Mv2r2 -> 0]; [Mv2r3 -> 0]} +} +MODEL [a1, b1, c1, d1, e1, f1, g1, h1, a2, b2, c2, d2, e2, f2, g2, h2, a3, b3, c3, d3, e3, f3, g3, h3, a4, b4, c4, d4, e4, f4, g4, h4, a5, b5, c5, d5, e5, f5, g5, h5, a6, b6, c6, d6, e6, f6, g6, h6, a7, b7, c7, d7, e7, f7, g7, h7, a8, b8, c8, d8, e8, f8, g8, h8 | Da {(a1, b2); (b1, c2); (c1, d2); (d1, e2); (e1, f2); (f1, g2); (g1, h2); (a2, b3); (b2, c3); (c2, d3); (d2, e3); (e2, f3); (f2, g3); (g2, h3); (a3, b4); (b3, c4); (c3, d4); (d3, e4); (e3, f4); (f3, g4); (g3, h4); (a4, b5); (b4, c5); (c4, d5); (d4, e5); (e4, f5); (f4, g5); (g4, h5); (a5, b6); (b5, c6); (c5, d6); (d5, e6); (e5, f6); (f5, g6); (g5, h6); (a6, b7); (b6, c7); (c6, d7); (d6, e7); (e6, f7); (f6, g7); (g6, h7); (a7, b8); (b7, c8); (c7, d8); (d7, e8); (e7, f8); (f7, g8); (g7, h8)}; Db {(b1, a2); (c1, b2); (d1, c2); (e1, d2); (f1, e2); (g1, f2); (h1, g2); (b2, a3); (c2, b3); (d2, c3); (e2, d3); (f2, e3); (g2, f3); (h2, g3); (b3, a4); (c3, b4); (d3, c4); (e3, d4); (f3, e4); (g3, f4); (h3, g4); (b4, a5); (c4, b5); (d4, c5); (e4, d5); (f4, e5); (g4, f5); (h4, g5); (b5, a6); (c5, b6); (d5, c6); (e5, d6); (f5, e6); (g5, f6); (h5, g6); (b6, a7); (c6, b7); (d6, c7); (e6, d7); (f6, e7); (g6, f7); (h6, g7); (b7, a8); (c7, b8); (d7, c8); (e7, d8); (f7, e8); (g7, f8); (h7, g8)} | ] " + ... ... ... ... + ... ... ... ... + ... ... ... ... + B..B B..B B..B B..B + ... ... ... ... + ... ... ... ... + ... ... ... ... + ... ... ... ... + ... ... ... ... + ... ... ... ... + ... ... ... ... + ... ... ... ... + ... ... ... ... + W W..W W..W W..W W.. + ... ... ... ... + ... ... ... ... +" Deleted: trunk/Toss/Learn/learn.html =================================================================== --- trunk/Toss/Learn/learn.html 2012-01-23 23:33:10 UTC (rev 1652) +++ trunk/Toss/Learn/learn.html 2012-01-24 00:49:05 UTC (rev 1653) @@ -1,160 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:bibtex="http://bibtexml.sf.net/" xml:lang="en" lang="en"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="./styles/common.css" media="all" /> - <link rel="stylesheet" type="text/css" href="./styles/screen.css" media="screen" /> - <link rel="stylesheet" type="text/css" href="./styles/print.css" media="print" /> - <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Ubuntu:regular,bold" /> - <link rel="shortcut icon" href="./img/favicon.ico" /> - <title>Learning Game Rules from Videos</title> - <script src="./scripts/nomap.js" type="text/javascript"></script> - <script src="./scripts/main.js" type="text/javascript"></script> - </head> - <body onload="gload()" onunload="gunload()"> - <div id="page"> - <div id="header"> - <div id="headerlogo"> - <a href="http://toss.sourceforge.net" id="logo"></a> - <div id="mgi-title"> - <h3></h3> - </div> - </div> - <a href="http://toss.sourceforge.net" id="left-logo">Toss</a> - <div id="parentnav"> - <ul> - <li> - <a href="index.html.de">Deutsch</a> - </li> - <li class="selected"> - <span>English</span> - </li> - <li> - <a href="index.html.fr">Français</a> - </li> - <li> - <a href="index.html.pol">Polski</a> - </li> - </ul> - </div> - </div> - <div id="container" class="with-sidebar"> - <div id="primary"> - <div id="content"> - <div> - -<div class="title"> - <h1 property="foaf:title">Learning Game Rules from Videos</h1> -</div> - -<h2>Breakthrough</h2> - -<p>Illustrating plays and positions not won by anyone</p> -<video width="352" height="288" controls="controls"> - <source src="videos/Breakthrough001_01.nwn.3gp" type="video/3gpp" /> - <source src="videos/Breakthrough001_01.nwn.webm" type="video/webm" /> - Your browser does not support the video tag. -</video> -<video width="352" height="288" controls="controls"> - <source src="videos/Breakthrough001_02.nwn.3gp" type="video/3gpp" /> - <source src="videos/Breakthrough001_02.nwn.webm" type="video/webm" /> - Your browser does not support the video tag. -</video> -<video width="352" height="288" controls="controls"> - <source src="videos/Breakthrough001_03.nwn.3gp" type="video/3gpp" /> - <source src="videos/Breakthrough001_03.nwn.webm" type="video/webm" /> - Your browser does not support the video tag. -</video> - - -<p>Winning for the first player</p> -<video width="352" height="288" controls="controls"> - <source src="videos/Breakthrough001_01.wn0.3gp" type="video/3gpp" /> - <source src="videos/Breakthrough001_01.wn0.webm" type="video/webm" /> - Your browser does not support the video tag. -</video> - -<p>Winning for the second player</p> -<video width="352" height="288" controls="controls"> - <source src="videos/Breakthrough001_01.wn1.3gp" type="video/3gpp" /> - <source src="videos/Breakthrough001_01.wn1.webm" type="video/webm" /> - Your browser does not support the video tag. -</video> - - - </div> - </div> - </div> - <div id="secondary"> - <div id="sidebar"> - <div class="childnav" id="menu"> - <div class="childnav-top"></div> - <ul> - <li class="selected"> - <a href="./index.html.en" class="menu-top">Home</a> - </li> - <li class=""> - <a href="http://tplay.org" class="menu-top">Play Online</a> - </li> - <li class=""> - <a href="http://sourceforge.net/project/showfiles.php?group_id=115606" class="menu-top">Download Toss</a> - </li> - <li class=""> - <a href="./create.html.en" class="menu-title menu-top">Create Games</a> - <ul> - <li class=""> - <a href="http://vimeo.com/10110495" class="menu-sub">Video Tutorial</a> - </li> - <li class=""> - <a href="./examples.html.en" class="menu-sub">Examples</a> - </li> - <li class=""> - <a href="./gui_interface.html.en" class="menu-sub">GUI Interface Guide</a> - </li> - </ul> - </li> - <li class=""> - <a href="./play.html.en" class="menu-top">Watch Toss Play</a> - </li> - <li class=""> - <a href="./docs.html.en" class="menu-title menu-top">Documentation</a> - <ul> - <li class=""> - <a href="./reference/reference.pdf" class="menu-sub">Reference (pdf)</a> - </li> - <li class=""> - <a href="./reference/index.html.en" class="menu-sub">Reference (html)</a> - </li> - </ul> - </li> - <li class=""> - <a href="./Publications/index.html.en" class="menu-top">Papers and Talks</a> - </li> - <li class=""> - <a href="./develop.html.en" class="menu-title menu-top">Develop Toss</a> - <ul> - <li class=""> - <a href="./ocaml.html.en" class="menu-sub">Mini OCaml Tutorial</a> - </li> - <li class=""> - <a href="./codebasics.html.en" class="menu-sub">Toss Code Basics</a> - </li> - <li class=""> - <a href="./code_doc/index.html.en" class="menu-sub">Code Documentation</a> - </li> - </ul> - </li> - <li class=""> - <a href="./contact.html.en" class="menu-top">Contact and Links</a> - </li> - </ul> - </div> - </div> - </div> - </div> - </div> - <div id="footer"> - © 2012 Toss Team - </div> - </body> -</html> Added: trunk/Toss/www/learn.xml =================================================================== --- trunk/Toss/www/learn.xml (rev 0) +++ trunk/Toss/www/learn.xml 2012-01-24 00:49:05 UTC (rev 1653) @@ -0,0 +1,165 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE lecture SYSTEM "xsl/xhtml1-lat1.ent"> + +<?xml-stylesheet type="text/xsl" href="xsl/main.xsl" charset="UTF-8"?> + +<personal> + <title lang="en">Learning Game Rules from Videos</title> + <title lang="de">Spielregeln von Videos Lehrnen (auf Englisch)</title> + <title lang="pol">Indukcja reguł gier z filmów (po angielsku)</title> + <title lang="fr">Apprendre des règles de jeux (à anglais)</title> + <history> + <link id="learn" href="/learn.html">Learning Game Rules from Videos</link> + </history> + + <section title="Breakthrough"> + <subsection>Resulting game: </subsection> + <a href="videos/Breakthrough001.toss.txt">toss file</a> <br/> + + <subsection>Illustrating plays and positions not won by anyone</subsection> + <br/> + <playvideo name="Breakthrough001_01.nwn" /> + <playvideo name="Breakthrough001_02.nwn" /> + <playvideo name="Breakthrough001_03.nwn" /> + + <subsection>Winning for the first player</subsection> <br/> + <playvideo name="Breakthrough001_01.wn0" /> + + <subsection>Winning for the second player</subsection> <br/> + <playvideo name="Breakthrough001_01.wn1" /> + </section> + + <section title="Connect4"> + <subsection>Resulting game: </subsection> + <a href="videos/Connect4001.toss.txt">toss file</a> <br/> + + <subsection>Illustrating plays and positions not won by anyone</subsection> + <br/> + <playvideo name="Connect4001_01.nwn" /> + <playvideo name="Connect4001_02.nwn" /> + <playvideo name="Connect4001_03.nwn" /> + <playvideo name="Connect4001_04.nwn" /> + <playvideo name="Connect4001_05.nwn" /> + <playvideo name="Connect4001_06.nwn" /> + <playvideo name="Connect4001_07.nwn" /> + <playvideo name="Connect4001_08.nwn" /> + <playvideo name="Connect4001_09.nwn" /> + <playvideo name="Connect4001_10.nwn" /> + <playvideo name="Connect4001_11.nwn" /> + <playvideo name="Connect4001_12.nwn" /> + <playvideo name="Connect4001_13.nwn" /> + + <subsection>Winning for the first player</subsection> <br/> + <playvideo name="Connect4001_01.wn0" /> + <playvideo name="Connect4001_02.wn0" /> + <playvideo name="Connect4001_03.wn0" /> + <playvideo name="Connect4001_04.wn0" /> + + <subsection>Winning for the second player</subsection> <br/> + <playvideo name="Connect4001_01.wn1" /> + <playvideo name="Connect4001_02.wn1" /> + <playvideo name="Connect4001_03.wn1" /> + <playvideo name="Connect4001_04.wn1" /> + + <subsection>Illustrating illegal moves (last one)</subsection> <br/> + <playvideo name="Connect4001_01.wrg" /> + <playvideo name="Connect4001_02.wrg" /> + <playvideo name="Connect4001_03.wrg" /> + <playvideo name="Connect4001_04.wrg" /> + </section> + + + <section title="Pawn-Whopping"> + <subsection>Resulting game: </subsection> + <a href="videos/Pawn-Whopping001.toss.txt">toss file</a> <br/> + + <subsection>Illustrating plays and positions not won by anyone</subsection> + <br/> + <playvideo name="Pawn-Whopping001_01.nwn" /> + <playvideo name="Pawn-Whopping001_02.nwn" /> + <playvideo name="Pawn-Whopping001_03.nwn" /> + <playvideo name="Pawn-Whopping001_04.nwn" /> + + <subsection>Winning for the first player</subsection> <br/> + <playvideo name="Pawn-Whopping001_01.wn0" /> + + <subsection>Winning for the second player</subsection> <br/> + <playvideo name="Pawn-Whopping001_01.wn1" /> + + <subsection>Illustrating illegal moves (last one)</subsection> <br/> + <playvideo name="Pawn-Whopping001_01.wrg" /> + <playvideo name="Pawn-Whopping001_02.wrg" /> + <playvideo name="Pawn-Whopping001_03.wrg" /> + <playvideo name="Pawn-Whopping001_04.wrg" /> + <playvideo name="Pawn-Whopping001_05.wrg" /> + <playvideo name="Pawn-Whopping001_06.wrg" /> + </section> + + <section title="Tic-Tac-Toe"> + <subsection>Resulting game: </subsection> + <a href="videos/Tic-Tac-Toe001.toss.txt">toss file</a> <br/> + + <subsection>Illustrating plays and positions not won by anyone</subsection> + <br/> + <playvideo name="Tic-Tac-Toe001_01.nwn" /> + <playvideo name="Tic-Tac-Toe001_02.nwn" /> + <playvideo name="Tic-Tac-Toe001_03.nwn" /> + <playvideo name="Tic-Tac-Toe001_04.nwn" /> + <playvideo name="Tic-Tac-Toe001_05.nwn" /> + <playvideo name="Tic-Tac-Toe001_06.nwn" /> + <playvideo name="Tic-Tac-Toe001_07.nwn" /> + <playvideo name="Tic-Tac-Toe001_08.nwn" /> + <playvideo name="Tic-Tac-Toe001_09.nwn" /> + <playvideo name="Tic-Tac-Toe001_10.nwn" /> + <playvideo name="Tic-Tac-Toe001_11.nwn" /> + <playvideo name="Tic-Tac-Toe001_12.nwn" /> + <playvideo name="Tic-Tac-Toe001_13.nwn" /> + <playvideo name="Tic-Tac-Toe001_14.nwn" /> + <playvideo name="Tic-Tac-Toe001_15.nwn" /> + <playvideo name="Tic-Tac-Toe001_16.nwn" /> + <playvideo name="Tic-Tac-Toe001_17.nwn" /> + + <subsection>Winning for the first player</subsection> <br/> + <playvideo name="Tic-Tac-Toe001_01.wn0" /> + <playvideo name="Tic-Tac-Toe001_02.wn0" /> + <playvideo name="Tic-Tac-Toe001_03.wn0" /> + <playvideo name="Tic-Tac-Toe001_04.wn0" /> + + <subsection>Winning for the second player</subsection> <br/> + <playvideo name="Tic-Tac-Toe001_01.wn1" /> + <playvideo name="Tic-Tac-Toe001_02.wn1" /> + <playvideo name="Tic-Tac-Toe001_03.wn1" /> + <playvideo name="Tic-Tac-Toe001_04.wn1" /> + </section> + + <section title="Gomoku"> + <subsection>Resulting game: </subsection> + <a href="videos/Gomoku001.toss.txt">toss file</a> <br/> + + <subsection>Illustrating plays and positions not won by anyone</subsection> + <br/> + <playvideo name="Gomoku001_01.nwn" /> + <playvideo name="Gomoku001_02.nwn" /> + <playvideo name="Gomoku001_03.nwn" /> + <playvideo name="Gomoku001_04.nwn" /> + <playvideo name="Gomoku001_05.nwn" /> + <playvideo name="Gomoku001_06.nwn" /> + <playvideo name="Gomoku001_07.nwn" /> + <playvideo name="Gomoku001_08.nwn" /> + <playvideo name="Gomoku001_09.nwn" /> + + <subsection>Winning for the first player</subsection> <br/> + <playvideo name="Gomoku001_01.wn0" /> + <playvideo name="Gomoku001_02.wn0" /> + <playvideo name="Gomoku001_03.wn0" /> + <playvideo name="Gomoku001_04.wn0" /> + + <subsection>Winning for the second player</subsection> <br/> + <playvideo name="Gomoku001_01.wn1" /> + <playvideo name="Gomoku001_02.wn1" /> + <playvideo name="Gomoku001_03.wn1" /> + <playvideo name="Gomoku001_04.wn1" /> + </section> + + +</personal> Modified: trunk/Toss/www/xsl/common.xsl =================================================================== --- trunk/Toss/www/xsl/common.xsl 2012-01-23 23:33:10 UTC (rev 1652) +++ trunk/Toss/www/xsl/common.xsl 2012-01-24 00:49:05 UTC (rev 1653) @@ -110,13 +110,22 @@ </pre> </xsl:template> +<xsl:template match="playvideo"> + <video width="352" height="288" controls="controls"> + <source src="videos/{@name}.3gp" type="video/3gpp" /> + <source src="videos/{@name}.webm" type="video/webm" /> + Your browser does not support the video tag. + </video> + <a href="videos/{@name}.txt">Text</a> +</xsl:template> + + <xsl:template match="pre"> <pre class="code"> <xsl:apply-templates /> </pre> </xsl:template> - <xsl:template match="em"> <em><xsl:apply-templates /></em> </xsl:template> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |