<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -8,11 +8,10 @@ class ScalaChessProject(info: ProjectInfo) extends DefaultWebProject(info) {
   val geronimoServlet = &quot;org.apache.geronimo.specs&quot; % &quot;geronimo-servlet_2.5_spec&quot; % &quot;1.2&quot; % &quot;compile-&gt;default&quot;
   val gae = &quot;com.google.appengine&quot; % &quot;appengine-api-1.0-sdk&quot; % &quot;1.2.1&quot; % &quot;compile-&gt;default&quot;
 
-  val specs = &quot;org.scala-tools.testing&quot; % &quot;specs&quot; % &quot;1.4.4&quot; % &quot;test-&gt;default&quot;
+  val specs = &quot;org.scala-tools.testing&quot; % &quot;specs&quot; % &quot;1.5.0&quot; % &quot;test-&gt;default&quot;
   val scalacheck = &quot;org.scala-tools.testing&quot; % &quot;scalacheck&quot; % &quot;1.5&quot; % &quot;test-&gt;default&quot;
   val mockito = &quot;org.mockito&quot; % &quot;mockito-core&quot; % &quot;1.7&quot; % &quot;test-&gt;default&quot;
   val junit = &quot;junit&quot; % &quot;junit&quot; % &quot;4.4&quot; % &quot;test-&gt;default&quot;
   val jetty = &quot;org.mortbay.jetty&quot; % &quot;jetty&quot; % &quot;6.1.14&quot; % &quot;test-&gt;default&quot;
-//  val jspapi = &quot;org.mortbay.jetty&quot; % &quot;jsp-api-2.1&quot; % &quot;7.0.0pre2&quot; % &quot;test-&gt;default&quot;
   val jasper = &quot;org.apache.tomcat&quot; % &quot;jasper&quot; % &quot;6.0.18&quot; % &quot;test-&gt;default&quot;
 }</diff>
      <filename>project/build/src/ScalaChessProject.scala</filename>
    </modified>
    <modified>
      <diff>@@ -24,28 +24,90 @@
             &lt;attribute name=&quot;method&quot; value=&quot;1&quot; /&gt;
             &lt;attribute name=&quot;URI&quot; value=&quot;/WEB-INF/classes&quot; /&gt;
           &lt;/containerElement&gt;
-        &lt;/packaging&gt;
-      &lt;/configuration&gt;
-    &lt;/facet&gt;
-    &lt;facet type=&quot;web&quot; name=&quot;Web2&quot;&gt;
-      &lt;configuration&gt;
-        &lt;descriptors&gt;
-          &lt;deploymentDescriptor name=&quot;web.xml&quot; url=&quot;file://$MODULE_DIR$/target/webapp/WEB-INF/web.xml&quot; optional=&quot;false&quot; version=&quot;2.5&quot; /&gt;
-        &lt;/descriptors&gt;
-        &lt;webroots&gt;
-          &lt;root url=&quot;file://$MODULE_DIR$/target/webapp&quot; relative=&quot;/&quot; /&gt;
-        &lt;/webroots&gt;
-        &lt;building&gt;
-          &lt;setting name=&quot;EXPLODED_URL&quot; value=&quot;file://&quot; /&gt;
-          &lt;setting name=&quot;EXPLODED_ENABLED&quot; value=&quot;false&quot; /&gt;
-          &lt;setting name=&quot;JAR_URL&quot; value=&quot;file://&quot; /&gt;
-          &lt;setting name=&quot;JAR_ENABLED&quot; value=&quot;false&quot; /&gt;
-          &lt;setting name=&quot;EXCLUDE_EXPLODED_DIRECTORY&quot; value=&quot;true&quot; /&gt;
-        &lt;/building&gt;
-        &lt;packaging&gt;
-          &lt;containerElement type=&quot;module&quot; name=&quot;scala-chess&quot;&gt;
+          &lt;containerElement type=&quot;library&quot; level=&quot;module&quot;&gt;
             &lt;attribute name=&quot;method&quot; value=&quot;1&quot; /&gt;
-            &lt;attribute name=&quot;URI&quot; value=&quot;/WEB-INF/classes&quot; /&gt;
+            &lt;attribute name=&quot;URI&quot; value=&quot;/WEB-INF/lib&quot; /&gt;
+            &lt;url&gt;jar://$MODULE_DIR$/lib_managed/compile/appengine-api-1.0-sdk-1.2.1.jar!/&lt;/url&gt;
+          &lt;/containerElement&gt;
+          &lt;containerElement type=&quot;library&quot; level=&quot;module&quot;&gt;
+            &lt;attribute name=&quot;method&quot; value=&quot;1&quot; /&gt;
+            &lt;attribute name=&quot;URI&quot; value=&quot;/WEB-INF/lib&quot; /&gt;
+            &lt;url&gt;jar://$MODULE_DIR$/lib/commons-1.0.jar!/&lt;/url&gt;
+          &lt;/containerElement&gt;
+          &lt;containerElement type=&quot;library&quot; level=&quot;module&quot;&gt;
+            &lt;attribute name=&quot;method&quot; value=&quot;1&quot; /&gt;
+            &lt;attribute name=&quot;URI&quot; value=&quot;/WEB-INF/lib&quot; /&gt;
+            &lt;url&gt;jar://$MODULE_DIR$/lib_managed/test/specs-1.4.4.jar!/&lt;/url&gt;
+          &lt;/containerElement&gt;
+          &lt;containerElement type=&quot;library&quot; level=&quot;module&quot;&gt;
+            &lt;attribute name=&quot;method&quot; value=&quot;1&quot; /&gt;
+            &lt;attribute name=&quot;URI&quot; value=&quot;/WEB-INF/lib&quot; /&gt;
+            &lt;url&gt;jar://$MODULE_DIR$/lib_managed/test/junit-4.4.jar!/&lt;/url&gt;
+          &lt;/containerElement&gt;
+          &lt;containerElement type=&quot;library&quot; level=&quot;module&quot;&gt;
+            &lt;attribute name=&quot;method&quot; value=&quot;1&quot; /&gt;
+            &lt;attribute name=&quot;URI&quot; value=&quot;/WEB-INF/lib&quot; /&gt;
+            &lt;url&gt;jar://$MODULE_DIR$/lib_managed/test/jetty-util-6.1.14.jar!/&lt;/url&gt;
+          &lt;/containerElement&gt;
+          &lt;containerElement type=&quot;library&quot; level=&quot;module&quot;&gt;
+            &lt;attribute name=&quot;method&quot; value=&quot;1&quot; /&gt;
+            &lt;attribute name=&quot;URI&quot; value=&quot;/WEB-INF/lib&quot; /&gt;
+            &lt;url&gt;jar://$MODULE_DIR$/lib_managed/test/mockito-core-1.7.jar!/&lt;/url&gt;
+          &lt;/containerElement&gt;
+          &lt;containerElement type=&quot;library&quot; level=&quot;module&quot;&gt;
+            &lt;attribute name=&quot;method&quot; value=&quot;1&quot; /&gt;
+            &lt;attribute name=&quot;URI&quot; value=&quot;/WEB-INF/lib&quot; /&gt;
+            &lt;url&gt;jar://$MODULE_DIR$/lib_managed/test/juli-6.0.18.jar!/&lt;/url&gt;
+          &lt;/containerElement&gt;
+          &lt;containerElement type=&quot;library&quot; level=&quot;module&quot;&gt;
+            &lt;attribute name=&quot;method&quot; value=&quot;1&quot; /&gt;
+            &lt;attribute name=&quot;URI&quot; value=&quot;/WEB-INF/lib&quot; /&gt;
+            &lt;url&gt;jar://$MODULE_DIR$/lib_managed/test/hamcrest-core-1.1.jar!/&lt;/url&gt;
+          &lt;/containerElement&gt;
+          &lt;containerElement type=&quot;library&quot; level=&quot;module&quot;&gt;
+            &lt;attribute name=&quot;method&quot; value=&quot;1&quot; /&gt;
+            &lt;attribute name=&quot;URI&quot; value=&quot;/WEB-INF/lib&quot; /&gt;
+            &lt;url&gt;jar://$MODULE_DIR$/lib_managed/test/jetty-6.1.14.jar!/&lt;/url&gt;
+          &lt;/containerElement&gt;
+          &lt;containerElement type=&quot;library&quot; level=&quot;module&quot;&gt;
+            &lt;attribute name=&quot;method&quot; value=&quot;1&quot; /&gt;
+            &lt;attribute name=&quot;URI&quot; value=&quot;/WEB-INF/lib&quot; /&gt;
+            &lt;url&gt;jar://$MODULE_DIR$/lib_managed/test/jasper-6.0.18.jar!/&lt;/url&gt;
+          &lt;/containerElement&gt;
+          &lt;containerElement type=&quot;library&quot; level=&quot;module&quot;&gt;
+            &lt;attribute name=&quot;method&quot; value=&quot;1&quot; /&gt;
+            &lt;attribute name=&quot;URI&quot; value=&quot;/WEB-INF/lib&quot; /&gt;
+            &lt;url&gt;jar://$MODULE_DIR$/lib_managed/test/catalina-6.0.18.jar!/&lt;/url&gt;
+          &lt;/containerElement&gt;
+          &lt;containerElement type=&quot;library&quot; level=&quot;module&quot;&gt;
+            &lt;attribute name=&quot;method&quot; value=&quot;1&quot; /&gt;
+            &lt;attribute name=&quot;URI&quot; value=&quot;/WEB-INF/lib&quot; /&gt;
+            &lt;url&gt;jar://$MODULE_DIR$/lib_managed/test/jasper-jdt-6.0.18.jar!/&lt;/url&gt;
+          &lt;/containerElement&gt;
+          &lt;containerElement type=&quot;library&quot; level=&quot;module&quot;&gt;
+            &lt;attribute name=&quot;method&quot; value=&quot;1&quot; /&gt;
+            &lt;attribute name=&quot;URI&quot; value=&quot;/WEB-INF/lib&quot; /&gt;
+            &lt;url&gt;jar://$MODULE_DIR$/lib_managed/test/objenesis-1.0.jar!/&lt;/url&gt;
+          &lt;/containerElement&gt;
+          &lt;containerElement type=&quot;library&quot; level=&quot;module&quot;&gt;
+            &lt;attribute name=&quot;method&quot; value=&quot;1&quot; /&gt;
+            &lt;attribute name=&quot;URI&quot; value=&quot;/WEB-INF/lib&quot; /&gt;
+            &lt;url&gt;jar://$MODULE_DIR$/lib_managed/test/annotations-api-6.0.18.jar!/&lt;/url&gt;
+          &lt;/containerElement&gt;
+          &lt;containerElement type=&quot;library&quot; level=&quot;module&quot;&gt;
+            &lt;attribute name=&quot;method&quot; value=&quot;1&quot; /&gt;
+            &lt;attribute name=&quot;URI&quot; value=&quot;/WEB-INF/lib&quot; /&gt;
+            &lt;url&gt;jar://$MODULE_DIR$/lib_managed/test/el-api-6.0.18.jar!/&lt;/url&gt;
+          &lt;/containerElement&gt;
+          &lt;containerElement type=&quot;library&quot; level=&quot;module&quot;&gt;
+            &lt;attribute name=&quot;method&quot; value=&quot;1&quot; /&gt;
+            &lt;attribute name=&quot;URI&quot; value=&quot;/WEB-INF/lib&quot; /&gt;
+            &lt;url&gt;jar://$MODULE_DIR$/lib_managed/test/jasper-el-6.0.18.jar!/&lt;/url&gt;
+          &lt;/containerElement&gt;
+          &lt;containerElement type=&quot;library&quot; level=&quot;module&quot;&gt;
+            &lt;attribute name=&quot;method&quot; value=&quot;1&quot; /&gt;
+            &lt;attribute name=&quot;URI&quot; value=&quot;/WEB-INF/lib&quot; /&gt;
+            &lt;url&gt;jar://$MODULE_DIR$/lib_managed/test/scalacheck-1.5.jar!/&lt;/url&gt;
           &lt;/containerElement&gt;
         &lt;/packaging&gt;
       &lt;/configuration&gt;
@@ -81,7 +143,7 @@
     &lt;orderEntry type=&quot;module-library&quot;&gt;
       &lt;library&gt;
         &lt;CLASSES&gt;
-          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/default/servlet-api-2.5-6.1.14.jar!/&quot; /&gt;
+          &lt;root url=&quot;jar://$APPLICATION_HOME_DIR$/lib/javaee.jar!/&quot; /&gt;
         &lt;/CLASSES&gt;
         &lt;JAVADOC /&gt;
         &lt;SOURCES /&gt;
@@ -90,7 +152,7 @@
     &lt;orderEntry type=&quot;module-library&quot;&gt;
       &lt;library&gt;
         &lt;CLASSES&gt;
-          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/default/catalina-6.0.18.jar!/&quot; /&gt;
+          &lt;root url=&quot;jar://$MODULE_DIR$/project/boot/scala-2.7.4/sbt-0.4.5/ivy-2.0.0.jar!/&quot; /&gt;
         &lt;/CLASSES&gt;
         &lt;JAVADOC /&gt;
         &lt;SOURCES /&gt;
@@ -99,7 +161,7 @@
     &lt;orderEntry type=&quot;module-library&quot;&gt;
       &lt;library&gt;
         &lt;CLASSES&gt;
-          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/default/juli-6.0.18.jar!/&quot; /&gt;
+          &lt;root url=&quot;jar://$MODULE_DIR$/project/boot/scala-2.7.4/sbt-0.4.5/sbt_2.7.4-0.4.5.jar!/&quot; /&gt;
         &lt;/CLASSES&gt;
         &lt;JAVADOC /&gt;
         &lt;SOURCES /&gt;
@@ -108,7 +170,7 @@
     &lt;orderEntry type=&quot;module-library&quot;&gt;
       &lt;library&gt;
         &lt;CLASSES&gt;
-          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/default/jsp-api-6.0.18.jar!/&quot; /&gt;
+          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/compile/appengine-api-1.0-sdk-1.2.1.jar!/&quot; /&gt;
         &lt;/CLASSES&gt;
         &lt;JAVADOC /&gt;
         &lt;SOURCES /&gt;
@@ -117,7 +179,7 @@
     &lt;orderEntry type=&quot;module-library&quot;&gt;
       &lt;library&gt;
         &lt;CLASSES&gt;
-          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/default/el-api-6.0.18.jar!/&quot; /&gt;
+          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/compile/geronimo-servlet_2.5_spec-1.2.jar!/&quot; /&gt;
         &lt;/CLASSES&gt;
         &lt;JAVADOC /&gt;
         &lt;SOURCES /&gt;
@@ -126,7 +188,7 @@
     &lt;orderEntry type=&quot;module-library&quot;&gt;
       &lt;library&gt;
         &lt;CLASSES&gt;
-          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/default/junit-4.4.jar!/&quot; /&gt;
+          &lt;root url=&quot;jar://$MODULE_DIR$/lib/commons-1.0.jar!/&quot; /&gt;
         &lt;/CLASSES&gt;
         &lt;JAVADOC /&gt;
         &lt;SOURCES /&gt;
@@ -135,7 +197,7 @@
     &lt;orderEntry type=&quot;module-library&quot;&gt;
       &lt;library&gt;
         &lt;CLASSES&gt;
-          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/default/objenesis-1.0.jar!/&quot; /&gt;
+          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/test/specs-1.4.4.jar!/&quot; /&gt;
         &lt;/CLASSES&gt;
         &lt;JAVADOC /&gt;
         &lt;SOURCES /&gt;
@@ -144,7 +206,7 @@
     &lt;orderEntry type=&quot;module-library&quot;&gt;
       &lt;library&gt;
         &lt;CLASSES&gt;
-          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/default/jasper-el-6.0.18.jar!/&quot; /&gt;
+          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/test/junit-4.4.jar!/&quot; /&gt;
         &lt;/CLASSES&gt;
         &lt;JAVADOC /&gt;
         &lt;SOURCES /&gt;
@@ -153,7 +215,7 @@
     &lt;orderEntry type=&quot;module-library&quot;&gt;
       &lt;library&gt;
         &lt;CLASSES&gt;
-          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/default/geronimo-servlet_2.5_spec-1.2.jar!/&quot; /&gt;
+          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/test/jetty-util-6.1.14.jar!/&quot; /&gt;
         &lt;/CLASSES&gt;
         &lt;JAVADOC /&gt;
         &lt;SOURCES /&gt;
@@ -162,7 +224,7 @@
     &lt;orderEntry type=&quot;module-library&quot;&gt;
       &lt;library&gt;
         &lt;CLASSES&gt;
-          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/default/hamcrest-core-1.1.jar!/&quot; /&gt;
+          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/test/mockito-core-1.7.jar!/&quot; /&gt;
         &lt;/CLASSES&gt;
         &lt;JAVADOC /&gt;
         &lt;SOURCES /&gt;
@@ -171,7 +233,7 @@
     &lt;orderEntry type=&quot;module-library&quot;&gt;
       &lt;library&gt;
         &lt;CLASSES&gt;
-          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/default/jasper-6.0.18.jar!/&quot; /&gt;
+          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/test/juli-6.0.18.jar!/&quot; /&gt;
         &lt;/CLASSES&gt;
         &lt;JAVADOC /&gt;
         &lt;SOURCES /&gt;
@@ -180,7 +242,7 @@
     &lt;orderEntry type=&quot;module-library&quot;&gt;
       &lt;library&gt;
         &lt;CLASSES&gt;
-          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/default/jasper-jdt-6.0.18.jar!/&quot; /&gt;
+          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/test/hamcrest-core-1.1.jar!/&quot; /&gt;
         &lt;/CLASSES&gt;
         &lt;JAVADOC /&gt;
         &lt;SOURCES /&gt;
@@ -189,7 +251,7 @@
     &lt;orderEntry type=&quot;module-library&quot;&gt;
       &lt;library&gt;
         &lt;CLASSES&gt;
-          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/default/specs-1.4.4.jar!/&quot; /&gt;
+          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/test/jetty-6.1.14.jar!/&quot; /&gt;
         &lt;/CLASSES&gt;
         &lt;JAVADOC /&gt;
         &lt;SOURCES /&gt;
@@ -198,7 +260,7 @@
     &lt;orderEntry type=&quot;module-library&quot;&gt;
       &lt;library&gt;
         &lt;CLASSES&gt;
-          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/default/mockito-core-1.7.jar!/&quot; /&gt;
+          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/test/jasper-6.0.18.jar!/&quot; /&gt;
         &lt;/CLASSES&gt;
         &lt;JAVADOC /&gt;
         &lt;SOURCES /&gt;
@@ -207,7 +269,7 @@
     &lt;orderEntry type=&quot;module-library&quot;&gt;
       &lt;library&gt;
         &lt;CLASSES&gt;
-          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/default/jetty-6.1.14.jar!/&quot; /&gt;
+          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/test/catalina-6.0.18.jar!/&quot; /&gt;
         &lt;/CLASSES&gt;
         &lt;JAVADOC /&gt;
         &lt;SOURCES /&gt;
@@ -216,7 +278,7 @@
     &lt;orderEntry type=&quot;module-library&quot;&gt;
       &lt;library&gt;
         &lt;CLASSES&gt;
-          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/default/annotations-api-6.0.18.jar!/&quot; /&gt;
+          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/test/jasper-jdt-6.0.18.jar!/&quot; /&gt;
         &lt;/CLASSES&gt;
         &lt;JAVADOC /&gt;
         &lt;SOURCES /&gt;
@@ -225,7 +287,7 @@
     &lt;orderEntry type=&quot;module-library&quot;&gt;
       &lt;library&gt;
         &lt;CLASSES&gt;
-          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/default/scalacheck-1.5.jar!/&quot; /&gt;
+          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/test/servlet-api-2.5-6.1.14.jar!/&quot; /&gt;
         &lt;/CLASSES&gt;
         &lt;JAVADOC /&gt;
         &lt;SOURCES /&gt;
@@ -234,7 +296,7 @@
     &lt;orderEntry type=&quot;module-library&quot;&gt;
       &lt;library&gt;
         &lt;CLASSES&gt;
-          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/default/appengine-api-1.0-sdk-1.2.0.jar!/&quot; /&gt;
+          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/test/servlet-api-6.0.18.jar!/&quot; /&gt;
         &lt;/CLASSES&gt;
         &lt;JAVADOC /&gt;
         &lt;SOURCES /&gt;
@@ -243,7 +305,7 @@
     &lt;orderEntry type=&quot;module-library&quot;&gt;
       &lt;library&gt;
         &lt;CLASSES&gt;
-          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/default/servlet-api-6.0.18.jar!/&quot; /&gt;
+          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/test/objenesis-1.0.jar!/&quot; /&gt;
         &lt;/CLASSES&gt;
         &lt;JAVADOC /&gt;
         &lt;SOURCES /&gt;
@@ -252,7 +314,7 @@
     &lt;orderEntry type=&quot;module-library&quot;&gt;
       &lt;library&gt;
         &lt;CLASSES&gt;
-          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/default/jetty-util-6.1.14.jar!/&quot; /&gt;
+          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/test/annotations-api-6.0.18.jar!/&quot; /&gt;
         &lt;/CLASSES&gt;
         &lt;JAVADOC /&gt;
         &lt;SOURCES /&gt;
@@ -261,7 +323,7 @@
     &lt;orderEntry type=&quot;module-library&quot;&gt;
       &lt;library&gt;
         &lt;CLASSES&gt;
-          &lt;root url=&quot;jar://$APPLICATION_HOME_DIR$/lib/javaee.jar!/&quot; /&gt;
+          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/test/jsp-api-6.0.18.jar!/&quot; /&gt;
         &lt;/CLASSES&gt;
         &lt;JAVADOC /&gt;
         &lt;SOURCES /&gt;
@@ -270,7 +332,7 @@
     &lt;orderEntry type=&quot;module-library&quot;&gt;
       &lt;library&gt;
         &lt;CLASSES&gt;
-          &lt;root url=&quot;jar://$MODULE_DIR$/project/boot/scala-2.7.4/sbt-0.4.5/ivy-2.0.0.jar!/&quot; /&gt;
+          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/test/el-api-6.0.18.jar!/&quot; /&gt;
         &lt;/CLASSES&gt;
         &lt;JAVADOC /&gt;
         &lt;SOURCES /&gt;
@@ -279,7 +341,16 @@
     &lt;orderEntry type=&quot;module-library&quot;&gt;
       &lt;library&gt;
         &lt;CLASSES&gt;
-          &lt;root url=&quot;jar://$MODULE_DIR$/project/boot/scala-2.7.4/sbt-0.4.5/sbt_2.7.4-0.4.5.jar!/&quot; /&gt;
+          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/test/jasper-el-6.0.18.jar!/&quot; /&gt;
+        &lt;/CLASSES&gt;
+        &lt;JAVADOC /&gt;
+        &lt;SOURCES /&gt;
+      &lt;/library&gt;
+    &lt;/orderEntry&gt;
+    &lt;orderEntry type=&quot;module-library&quot;&gt;
+      &lt;library&gt;
+        &lt;CLASSES&gt;
+          &lt;root url=&quot;jar://$MODULE_DIR$/lib_managed/test/scalacheck-1.5.jar!/&quot; /&gt;
         &lt;/CLASSES&gt;
         &lt;JAVADOC /&gt;
         &lt;SOURCES /&gt;</diff>
      <filename>scala-chess.iml</filename>
    </modified>
    <modified>
      <diff>@@ -44,6 +44,19 @@
     &lt;option name=&quot;MAXIMUM_HEAP_SIZE&quot; value=&quot;128&quot; /&gt;
   &lt;/component&gt;
   &lt;component name=&quot;Encoding&quot; useUTFGuessing=&quot;true&quot; native2AsciiForPropertiesFiles=&quot;false&quot; /&gt;
+  &lt;component name=&quot;FacetAutodetectingManager&quot;&gt;
+    &lt;autodetection-disabled&gt;
+      &lt;facet-type id=&quot;web&quot;&gt;
+        &lt;modules&gt;
+          &lt;module name=&quot;scala-chess&quot;&gt;
+            &lt;files&gt;
+              &lt;file url=&quot;file://$PROJECT_DIR$/target/webapp/WEB-INF/web.xml&quot; /&gt;
+            &lt;/files&gt;
+          &lt;/module&gt;
+        &lt;/modules&gt;
+      &lt;/facet-type&gt;
+    &lt;/autodetection-disabled&gt;
+  &lt;/component&gt;
   &lt;component name=&quot;IdProvider&quot; IDEtalkID=&quot;10181603A04ECEAF537878239FF83C85&quot; /&gt;
   &lt;component name=&quot;InspectionProjectProfileManager&quot;&gt;
     &lt;option name=&quot;PROJECT_PROFILE&quot; value=&quot;Project Default&quot; /&gt;</diff>
      <filename>scala-chess.ipr</filename>
    </modified>
    <modified>
      <diff>@@ -2,20 +2,159 @@ package au.com.loftinspace.scalachess
 
 import _root_.com.google.appengine.api.users._
 import game.Board
-
 class LoginSnippet(getUserService: UserService) {
+  def this() = this {
+    UserServiceFactory.getUserService
+  }
 
-    def this() = this {
-        UserServiceFactory.getUserService
-    }
+  def render(request: _root_.javax.servlet.http.HttpServletRequest) = {
+    val userService = getUserService
+    val user = userService.getCurrentUser
+    user match {
+      case null =&gt; &lt;html&gt;&lt;head&gt;&lt;title&gt;Just tooling around for now...&lt;/title&gt;&lt;/head&gt;
+              &lt;body&gt;&lt;h1&gt;Just a test&lt;/h1&gt;&lt;p&gt;Hello!&lt;a href={userService.createLoginURL(request.getRequestURI())}&gt;Sign in&lt;/a&gt;just for kicks.&lt;/p&gt; &lt;/body&gt;&lt;/html&gt;
+      case _ =&gt; &lt;html&gt;&lt;head&gt;
+    &lt;title&gt;scratch&lt;/title&gt;
+    &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;screen&quot; href=&quot;style.css&quot;/&gt;
+    &lt;script type=&quot;text/javascript&quot; src=&quot;mootools-1.2.3-core.js&quot;&gt;&lt;/script&gt;
+    &lt;script type=&quot;text/javascript&quot; src=&quot;mootools-1.2.3.1-more.js&quot;&gt;&lt;/script&gt;
+    &lt;script type=&quot;text/javascript&quot; src=&quot;demo.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;a href={userService.createLogoutURL(request.getRequestURI)}&gt;sign out&lt;/a&gt;
+&lt;div id=&quot;board&quot;&gt;
+    &lt;div class=&quot;row&quot;&gt;
+        &lt;div class=&quot;dark square&quot; id=&quot;a8&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;light square&quot; id=&quot;b8&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;dark square&quot; id=&quot;c8&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;light square&quot; id=&quot;d8&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;dark square&quot; id=&quot;e8&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;light square&quot; id=&quot;f8&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;dark square&quot; id=&quot;g8&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;light square&quot; id=&quot;h8&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;end&quot;/&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;row&quot;&gt;
+        &lt;div class=&quot;light square&quot; id=&quot;a7&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;dark square&quot; id=&quot;b7&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;light square&quot; id=&quot;c7&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;dark square&quot; id=&quot;d7&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;light square&quot; id=&quot;e7&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;dark square&quot; id=&quot;f7&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;light square&quot; id=&quot;g7&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;dark square&quot; id=&quot;h7&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;end&quot;/&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;row&quot;&gt;
+        &lt;div class=&quot;dark square&quot; id=&quot;a6&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;light square&quot; id=&quot;b6&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;dark square&quot; id=&quot;c6&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;light square&quot; id=&quot;d6&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;dark square&quot; id=&quot;e6&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;light square&quot; id=&quot;f6&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;dark square&quot; id=&quot;g6&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;light square&quot; id=&quot;h6&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;end&quot;/&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;row&quot;&gt;
+        &lt;div class=&quot;light square&quot; id=&quot;a5&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;dark square&quot; id=&quot;b5&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;light square&quot; id=&quot;c5&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;dark square&quot; id=&quot;d5&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;light square&quot; id=&quot;e5&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;dark square&quot; id=&quot;f5&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;light square&quot; id=&quot;g5&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;dark square&quot; id=&quot;h5&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;end&quot;/&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;row&quot;&gt;
+        &lt;div class=&quot;dark square&quot; id=&quot;a4&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;light square&quot; id=&quot;b4&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;dark square&quot; id=&quot;c4&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;light square&quot; id=&quot;d4&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;dark square&quot; id=&quot;e4&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;light square&quot; id=&quot;f4&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;dark square&quot; id=&quot;g4&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;light square&quot; id=&quot;h4&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;end&quot;/&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;row&quot;&gt;
+        &lt;div class=&quot;light square&quot; id=&quot;a3&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;dark square&quot; id=&quot;b3&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;light square&quot; id=&quot;c3&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;dark square&quot; id=&quot;d3&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;light square&quot; id=&quot;e3&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;dark square&quot; id=&quot;f3&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;light square&quot; id=&quot;g3&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;dark square&quot; id=&quot;h3&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;end&quot;/&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;row&quot;&gt;
+        &lt;div class=&quot;dark square&quot; id=&quot;a2&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;light square&quot; id=&quot;b2&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;dark square&quot; id=&quot;c2&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;light square&quot; id=&quot;d2&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;dark square&quot; id=&quot;e2&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;light square&quot; id=&quot;f2&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;dark square&quot; id=&quot;g2&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;light square&quot; id=&quot;h2&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;end&quot;/&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;row&quot;&gt;
+        &lt;div class=&quot;light square&quot; id=&quot;a1&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;dark square&quot; id=&quot;b1&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;light square&quot; id=&quot;c1&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;dark square&quot; id=&quot;d1&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;light square&quot; id=&quot;e1&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;dark square&quot; id=&quot;f1&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;light square&quot; id=&quot;g1&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;dark square&quot; id=&quot;h1&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;end&quot;/&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
+&lt;div id=&quot;pieces&quot;&gt;
+    &lt;div class=&quot;piece&quot; id=&quot;black_knight_1&quot;&gt;&lt;img src=&quot;img/img_fantasy_shad/bn.png&quot; alt=&quot;black pawn&quot; height=&quot;60&quot;/&gt;&lt;/div&gt;
+    &lt;div class=&quot;piece&quot; id=&quot;black_knight_2&quot;&gt;&lt;img src=&quot;img/img_fantasy_shad/bn.png&quot; alt=&quot;black pawn&quot; height=&quot;60&quot;/&gt;&lt;/div&gt;
+    &lt;div class=&quot;piece&quot; id=&quot;black_queen_1&quot;&gt;&lt;img src=&quot;img/img_fantasy_shad/bq.png&quot; alt=&quot;black pawn&quot; height=&quot;60&quot;/&gt;&lt;/div&gt;
+    &lt;div class=&quot;piece&quot; id=&quot;black_king_1&quot;&gt;&lt;img src=&quot;img/img_fantasy_shad/bk.png&quot; alt=&quot;black pawn&quot; height=&quot;60&quot;/&gt;&lt;/div&gt;
+    &lt;div class=&quot;piece&quot; id=&quot;black_bishop_1&quot;&gt;&lt;img src=&quot;img/img_fantasy_shad/bb.png&quot; alt=&quot;black pawn&quot; height=&quot;60&quot;/&gt;&lt;/div&gt;
+    &lt;div class=&quot;piece&quot; id=&quot;black_bishop_2&quot;&gt;&lt;img src=&quot;img/img_fantasy_shad/bb.png&quot; alt=&quot;black pawn&quot; height=&quot;60&quot;/&gt;&lt;/div&gt;
+    &lt;div class=&quot;piece&quot; id=&quot;black_rook_1&quot;&gt;&lt;img src=&quot;img/img_fantasy_shad/br.png&quot; alt=&quot;black pawn&quot; height=&quot;60&quot;/&gt;&lt;/div&gt;
+    &lt;div class=&quot;piece&quot; id=&quot;black_rook_2&quot;&gt;&lt;img src=&quot;img/img_fantasy_shad/br.png&quot; alt=&quot;black pawn&quot; height=&quot;60&quot;/&gt;&lt;/div&gt;
+    &lt;div class=&quot;piece&quot; id=&quot;black_pawn_1&quot;&gt;&lt;img src=&quot;img/img_fantasy_shad/bp.png&quot; alt=&quot;black pawn&quot; height=&quot;60&quot;/&gt;&lt;/div&gt;
+    &lt;div class=&quot;piece&quot; id=&quot;black_pawn_2&quot;&gt;&lt;img src=&quot;img/img_fantasy_shad/bp.png&quot; alt=&quot;black pawn&quot; height=&quot;60&quot;/&gt;&lt;/div&gt;
+    &lt;div class=&quot;piece&quot; id=&quot;black_pawn_3&quot;&gt;&lt;img src=&quot;img/img_fantasy_shad/bp.png&quot; alt=&quot;black pawn&quot; height=&quot;60&quot;/&gt;&lt;/div&gt;
+    &lt;div class=&quot;piece&quot; id=&quot;black_pawn_4&quot;&gt;&lt;img src=&quot;img/img_fantasy_shad/bp.png&quot; alt=&quot;black pawn&quot; height=&quot;60&quot;/&gt;&lt;/div&gt;
+    &lt;div class=&quot;piece&quot; id=&quot;black_pawn_5&quot;&gt;&lt;img src=&quot;img/img_fantasy_shad/bp.png&quot; alt=&quot;black pawn&quot; height=&quot;60&quot;/&gt;&lt;/div&gt;
+    &lt;div class=&quot;piece&quot; id=&quot;black_pawn_6&quot;&gt;&lt;img src=&quot;img/img_fantasy_shad/bp.png&quot; alt=&quot;black pawn&quot; height=&quot;60&quot;/&gt;&lt;/div&gt;
+    &lt;div class=&quot;piece&quot; id=&quot;black_pawn_7&quot;&gt;&lt;img src=&quot;img/img_fantasy_shad/bp.png&quot; alt=&quot;black pawn&quot; height=&quot;60&quot;/&gt;&lt;/div&gt;
+    &lt;div class=&quot;piece&quot; id=&quot;black_pawn_8&quot;&gt;&lt;img src=&quot;img/img_fantasy_shad/bp.png&quot; alt=&quot;black pawn&quot; height=&quot;60&quot;/&gt;&lt;/div&gt;
+    &lt;div class=&quot;piece&quot; id=&quot;white_knight_1&quot;&gt;&lt;img src=&quot;img/img_fantasy_shad/wn.png&quot; alt=&quot;white pawn&quot; height=&quot;60&quot;/&gt;&lt;/div&gt;
+    &lt;div class=&quot;piece&quot; id=&quot;white_knight_2&quot;&gt;&lt;img src=&quot;img/img_fantasy_shad/wn.png&quot; alt=&quot;white pawn&quot; height=&quot;60&quot;/&gt;&lt;/div&gt;
+    &lt;div class=&quot;piece&quot; id=&quot;white_queen_1&quot;&gt;&lt;img src=&quot;img/img_fantasy_shad/wq.png&quot; alt=&quot;white pawn&quot; height=&quot;60&quot;/&gt;&lt;/div&gt;
+    &lt;div class=&quot;piece&quot; id=&quot;white_king_1&quot;&gt;&lt;img src=&quot;img/img_fantasy_shad/wk.png&quot; alt=&quot;white pawn&quot; height=&quot;60&quot;/&gt;&lt;/div&gt;
+    &lt;div class=&quot;piece&quot; id=&quot;white_bishop_1&quot;&gt;&lt;img src=&quot;img/img_fantasy_shad/wb.png&quot; alt=&quot;white pawn&quot; height=&quot;60&quot;/&gt;&lt;/div&gt;
+    &lt;div class=&quot;piece&quot; id=&quot;white_bishop_2&quot;&gt;&lt;img src=&quot;img/img_fantasy_shad/wb.png&quot; alt=&quot;white pawn&quot; height=&quot;60&quot;/&gt;&lt;/div&gt;
+    &lt;div class=&quot;piece&quot; id=&quot;white_pawn_1&quot;&gt;&lt;img src=&quot;img/img_fantasy_shad/wp.png&quot; alt=&quot;white pawn&quot; height=&quot;60&quot;/&gt;&lt;/div&gt;
+    &lt;div class=&quot;piece&quot; id=&quot;white_pawn_2&quot;&gt;&lt;img src=&quot;img/img_fantasy_shad/wp.png&quot; alt=&quot;white pawn&quot; height=&quot;60&quot;/&gt;&lt;/div&gt;
+    &lt;div class=&quot;piece&quot; id=&quot;white_pawn_3&quot;&gt;&lt;img src=&quot;img/img_fantasy_shad/wp.png&quot; alt=&quot;white pawn&quot; height=&quot;60&quot;/&gt;&lt;/div&gt;
+    &lt;div class=&quot;piece&quot; id=&quot;white_pawn_4&quot;&gt;&lt;img src=&quot;img/img_fantasy_shad/wp.png&quot; alt=&quot;white pawn&quot; height=&quot;60&quot;/&gt;&lt;/div&gt;
+    &lt;div class=&quot;piece&quot; id=&quot;white_pawn_5&quot;&gt;&lt;img src=&quot;img/img_fantasy_shad/wp.png&quot; alt=&quot;white pawn&quot; height=&quot;60&quot;/&gt;&lt;/div&gt;
+    &lt;div class=&quot;piece&quot; id=&quot;white_pawn_6&quot;&gt;&lt;img src=&quot;img/img_fantasy_shad/wp.png&quot; alt=&quot;white pawn&quot; height=&quot;60&quot;/&gt;&lt;/div&gt;
+    &lt;div class=&quot;piece&quot; id=&quot;white_pawn_7&quot;&gt;&lt;img src=&quot;img/img_fantasy_shad/wp.png&quot; alt=&quot;white pawn&quot; height=&quot;60&quot;/&gt;&lt;/div&gt;
+    &lt;div class=&quot;piece&quot; id=&quot;white_pawn_8&quot;&gt;&lt;img src=&quot;img/img_fantasy_shad/wp.png&quot; alt=&quot;white pawn&quot; height=&quot;60&quot;/&gt;&lt;/div&gt;
+    &lt;div class=&quot;piece&quot; id=&quot;white_rook_1&quot;&gt;&lt;img src=&quot;img/img_fantasy_shad/wr.png&quot; alt=&quot;black pawn&quot; height=&quot;60&quot;/&gt;&lt;/div&gt;
+    &lt;div class=&quot;piece&quot; id=&quot;white_rook_2&quot;&gt;&lt;img src=&quot;img/img_fantasy_shad/wr.png&quot; alt=&quot;black pawn&quot; height=&quot;60&quot;/&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
 
-    def render(request: _root_.javax.servlet.http.HttpServletRequest) = {
-        val userService = getUserService
-        val user = userService.getCurrentUser
-        user match {
-            case null =&gt; &lt;p&gt;Hello! &lt;a href={userService.createLoginURL(request.getRequestURI())}&gt;Sign in&lt;/a&gt; just for kicks.&lt;/p&gt;
-            case _ =&gt; &lt;p&gt;Hello, {user.getNickname}! Now you can &lt;a href={userService.createLogoutURL(request.getRequestURI)}&gt;sign out&lt;/a&gt; again.&lt;/p&gt;
-              &lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;New board is created with {new Board().reset.pieces.size} pieces&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
-        }
+    /*
+&lt;p&gt;Hello, {user.getNickname}! Now you can &lt;a href={userService.createLogoutURL(request.getRequestURI)}&gt;sign out&lt;/a&gt; again.&lt;/p&gt;
+       &lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;New board is created with {new Board().reset.pieces.size} pieces&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
+    */
     }
+  }
 }</diff>
      <filename>src/main/scala/au/com/loftinspace/scalachess/LoginSnippet.scala</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
 package au.com.loftinspace.scalachess.game
 
+import _root_.com.twitter.service.Json
 import Positioning._
 
 case class Board(pieces: Map[Position, Piece], taken: List[Piece]) {
@@ -151,4 +152,9 @@ case class Board(pieces: Map[Position, Piece], taken: List[Piece]) {
       case _ =&gt; new Board(pieces - history.move.from + {history.move.to -&gt; pieces(history.move.from)}, taken)
     }
   }
+
+  /**
+   * Provide a JSON representation of the current state
+   */
+  def toJson = Json.build(Map('pieces.name -&gt; pieces, 'taken.name -&gt; taken)).toString
 }
\ No newline at end of file</diff>
      <filename>src/main/scala/au/com/loftinspace/scalachess/game/Board.scala</filename>
    </modified>
    <modified>
      <diff>@@ -1,126 +1,176 @@
 package au.com.loftinspace.scalachess.game
 
+import _root_.com.twitter.service.Json
+import reflect.BeanProperty
 import scala.collection.immutable._
 import scala.util.matching.Regex
 import Positioning._
 
-case class Game(board: Board, history: List[History], players: Map[Colour, String], nextMove: Colour) {
-  def this() = this(new Board().reset, Nil, Map.empty, White)
-
-  def moves: Map[Position, Set[Position]] = Map.empty
+case class Game(@BeanProperty board: Board, history: List[History], players: Map[Colour, String], nextMove: Colour) {
+  def this() = this (new Board().reset, Nil, Map.empty, White)
+
+  /**
+   * Find all possible moves on the board during the next turn of play
+   */
+  def moves: Map[Position, Set[Position]] = {
+    val default: Map[Position, Set[Position]] = Map.empty
+    board.pieces.foldLeft(default) { (moves, boardElement) =&gt;
+      val (position, piece) = boardElement
+      if (nextMove.equals(piece.colour)) {
+        val viableMoves = movesFrom(position)
+        if (viableMoves.isEmpty) {
+          moves
+        } else {
+          moves(position) = viableMoves
+        }
+      } else {
+        moves
+      }
+    }
+  }
 
-/*
-  {
-    for ((position, piece) &lt;- board.pieces; if (nextMove.equals(piece.colour))) yield (position, piece.movesFrom(position))
+  /**
+   * Find all possible moves on the board during the next turn of play - in JSON format
+   */
+  def movesAsJson = {
+    Json.build(moves).toString
   }
-*/
-
-  def movesFrom(p: Position): Set[Position] = Set()
-
-/*
-  private val CoordinatePattern = new Regex(&quot;^[a-h][1-8]$&quot;)
-  private val LineUp = Rook :: Knight :: Bishop :: Queen :: King :: Bishop :: Knight :: Rook :: Nil
-
-  private var pieces: Map[Position, Option[Piece]] = new HashMap[Position, Option[Piece]]
-  private var piecesCaptured: List[Piece] = Nil
-  private var movesMade: List[Move] = Nil
-
-  reset
-
-  def piecesMap = pieces
-  def capturedPieces = piecesCaptured
-  def moves = movesMade
-
-  def move(s: Symbol) = new Movement(pieceAt(s))
-  case class Movement(p: Option[Piece]) {
-    val piece = p.getOrElse(throw new IllegalMoveException(&quot;Cannot move a piece from an empty position&quot;))
-    def to(s: Symbol): Option[Piece] = {
-      Game.this check piece canMoveTo s
-      val from = piece.position.get
-      piece.hasMoved = true
-      var taken = Game.this place piece at s
-      if (taken.isEmpty &amp;&amp; (movesMade.lastOption.map(move =&gt; move.isPawnLaunch &amp;&amp; move.traversed(s))).getOrElse(false)) {
-        taken = Some(movesMade.last.piece)
-        taken.get.captured = true
-        piecesCaptured = taken.get :: piecesCaptured
+
+  /**
+   * Find all valid moves on the board from the given position for the next turn of play
+   */
+  def movesFrom(pos: Position): Set[Position] = {
+    type BoardQuery = (Board, Position, List[History]) =&gt; IterationControl
+
+    def follow(vector: List[Position], query: BoardQuery): Set[Position] = {
+      def next(positions: Set[Position], tail: List[Position]): Set[Position] = {
+        if (tail.isEmpty) return positions
+        query(board, tail(0), history) match {
+          case Continue =&gt; next(positions + tail(0), tail.tail)
+          case IncludeAndStop =&gt; positions + tail(0)
+          case Stop =&gt; positions
+        }
+      }
+      next(Set(), vector)
+    }
+    board.pieces.get(pos) match {
+      case None =&gt; Set()
+      case Some(piece) =&gt; if (piece.colour.equals(nextMove)) {
+        piece.movesFrom(pos).foldLeft(Set(): Set[Position]) {
+          (positions, vectorAndQuery) =&gt;
+                  val (vector, (query, implication)) = vectorAndQuery
+                  positions ++ follow(vector, query)
+        }
+      } else {
+        Set()
       }
-      movesMade = movesMade ::: List(Move(piece, from, position(s), taken))
-      taken
     }
   }
 
-  def check(p: Piece) = new PieceAssertion(p)
-  case class PieceAssertion(p: Piece) {
-    def canMoveTo(s: Symbol) = {
-      val target = position(s)
-      val validMoves = Game.this findMovesFor p
-      if (!validMoves.contains(target))
-      throw new IllegalMoveException(p + &quot; cannot move from &quot; + p.position + &quot; to &quot; + target)
+  /*
+    private val CoordinatePattern = new Regex(&quot;^[a-h][1-8]$&quot;)
+    private val LineUp = Rook :: Knight :: Bishop :: Queen :: King :: Bishop :: Knight :: Rook :: Nil
+
+    private var pieces: Map[Position, Option[Piece]] = new HashMap[Position, Option[Piece]]
+    private var piecesCaptured: List[Piece] = Nil
+    private var movesMade: List[Move] = Nil
+
+    reset
+
+    def piecesMap = pieces
+    def capturedPieces = piecesCaptured
+    def moves = movesMade
+
+    def move(s: Symbol) = new Movement(pieceAt(s))
+    case class Movement(p: Option[Piece]) {
+      val piece = p.getOrElse(throw new IllegalMoveException(&quot;Cannot move a piece from an empty position&quot;))
+      def to(s: Symbol): Option[Piece] = {
+        Game.this check piece canMoveTo s
+        val from = piece.position.get
+        piece.hasMoved = true
+        var taken = Game.this place piece at s
+        if (taken.isEmpty &amp;&amp; (movesMade.lastOption.map(move =&gt; move.isPawnLaunch &amp;&amp; move.traversed(s))).getOrElse(false)) {
+          taken = Some(movesMade.last.piece)
+          taken.get.captured = true
+          piecesCaptured = taken.get :: piecesCaptured
+        }
+        movesMade = movesMade ::: List(Move(piece, from, position(s), taken))
+        taken
+      }
     }
-  }
 
-  def place(p: Piece) = new Placement(p)
-  case class Placement(p: Piece) {
-    def at(s: Symbol): Option[Piece] = at(position(s))
-    def at(destination: Position): Option[Piece] = {
-      val captured: Option[Piece] = pieces(destination)
-      captured.foreach{(cap: Piece) =&gt; 
-        cap.captured = true
-        piecesCaptured = cap :: piecesCaptured
+    def check(p: Piece) = new PieceAssertion(p)
+    case class PieceAssertion(p: Piece) {
+      def canMoveTo(s: Symbol) = {
+        val target = position(s)
+        val validMoves = Game.this findMovesFor p
+        if (!validMoves.contains(target))
+        throw new IllegalMoveException(p + &quot; cannot move from &quot; + p.position + &quot; to &quot; + target)
       }
-      p.position.foreach{(origin: Position) =&gt; pieces = pieces.update(origin, None)}
-      p.position = Some(destination)
-      pieces = pieces.update(destination, Some(p))
-      captured
     }
-  }
 
-  def findMovesFor(p: Piece): Set[Position] = p.movesWithinContext(this, moves.lastOption)
-  def findMovesFor(s: Symbol): Set[Position] = pieceAt(s).map(findMovesFor(_)).getOrElse(Set())
-
-  def pieceAt(p: Position) = pieces(p)
-  def pieceAt(s: Symbol): Option[Piece] = pieceAt(position(s))
-  def pieceAt(rank: Int, file: Int): Option[Piece] = pieceAt(Position(rank, file))
-  def piecesAt(positions: List[Position]): List[Option[Piece]] = positions.map(pieceAt(_))
-
-  def presents(scenario: Map[Symbol, Option[Piece]]) =
-    scenario.foldLeft(true) { (res, entry) =&gt; res &amp;&amp; pieces(position(entry._1)).equals(entry._2) }
-
-  def positionsOf(p: Piece) = pieces.filter(_._2.equals(Some(p))).keySet.toSeq
-
-  def reset = {
-    for (file &lt;- 'a' to 'h'; rank &lt;- 1 to 8) {
-      val coord = position(Symbol(file.toString + rank))
-      pieces = pieces.update(coord, None)
-      rank match {
-        case 1 =&gt; place(Piece(White, LineUp(file - 'a'))) at coord
-        case 2 =&gt; place(Piece(White, Pawn)) at coord
-        case 7 =&gt; place(Piece(Black, Pawn)) at coord
-        case 8 =&gt; place(Piece(Black, LineUp(file - 'a'))) at coord
-        case _ =&gt;
+    def place(p: Piece) = new Placement(p)
+    case class Placement(p: Piece) {
+      def at(s: Symbol): Option[Piece] = at(position(s))
+      def at(destination: Position): Option[Piece] = {
+        val captured: Option[Piece] = pieces(destination)
+        captured.foreach{(cap: Piece) =&gt;
+          cap.captured = true
+          piecesCaptured = cap :: piecesCaptured
+        }
+        p.position.foreach{(origin: Position) =&gt; pieces = pieces.update(origin, None)}
+        p.position = Some(destination)
+        pieces = pieces.update(destination, Some(p))
+        captured
       }
     }
-  }
 
-  def arrange(layout: Map[Symbol, Piece]) = {
-    for (rank &lt;- 1 to 8; file &lt;- 'a' to 'h') {
-      val symbol = Symbol(file.toString + rank)
-      val pos = position(symbol)
-      val pieceOpt = layout.get(symbol)
-      pieces = pieces.update(pos, pieceOpt)
-      pieceOpt.foreach(_.position = Some(pos))
+    def findMovesFor(p: Piece): Set[Position] = p.movesWithinContext(this, moves.lastOption)
+    def findMovesFor(s: Symbol): Set[Position] = pieceAt(s).map(findMovesFor(_)).getOrElse(Set())
+
+    def pieceAt(p: Position) = pieces(p)
+    def pieceAt(s: Symbol): Option[Piece] = pieceAt(position(s))
+    def pieceAt(rank: Int, file: Int): Option[Piece] = pieceAt(Position(rank, file))
+    def piecesAt(positions: List[Position]): List[Option[Piece]] = positions.map(pieceAt(_))
+
+    def presents(scenario: Map[Symbol, Option[Piece]]) =
+      scenario.foldLeft(true) { (res, entry) =&gt; res &amp;&amp; pieces(position(entry._1)).equals(entry._2) }
+
+    def positionsOf(p: Piece) = pieces.filter(_._2.equals(Some(p))).keySet.toSeq
+
+    def reset = {
+      for (file &lt;- 'a' to 'h'; rank &lt;- 1 to 8) {
+        val coord = position(Symbol(file.toString + rank))
+        pieces = pieces.update(coord, None)
+        rank match {
+          case 1 =&gt; place(Piece(White, LineUp(file - 'a'))) at coord
+          case 2 =&gt; place(Piece(White, Pawn)) at coord
+          case 7 =&gt; place(Piece(Black, Pawn)) at coord
+          case 8 =&gt; place(Piece(Black, LineUp(file - 'a'))) at coord
+          case _ =&gt;
+        }
+      }
     }
-  }
 
-  def printout = {
-    for (rank &lt;- 8 to 1 by -1) {
-      for (file &lt;- 'a' to 'h') {
-        print(pieceAt(Symbol(file.toString + rank)))
-        print(' ')
+    def arrange(layout: Map[Symbol, Piece]) = {
+      for (rank &lt;- 1 to 8; file &lt;- 'a' to 'h') {
+        val symbol = Symbol(file.toString + rank)
+        val pos = position(symbol)
+        val pieceOpt = layout.get(symbol)
+        pieces = pieces.update(pos, pieceOpt)
+        pieceOpt.foreach(_.position = Some(pos))
       }
-      println
     }
-  }
-*/
+
+    def printout = {
+      for (rank &lt;- 8 to 1 by -1) {
+        for (file &lt;- 'a' to 'h') {
+          print(pieceAt(Symbol(file.toString + rank)))
+          print(' ')
+        }
+        println
+      }
+    }
+  */
 }
 </diff>
      <filename>src/main/scala/au/com/loftinspace/scalachess/game/Game.scala</filename>
    </modified>
    <modified>
      <diff>@@ -115,6 +115,8 @@ case class Piece(colour: Colour, role: Role) {
       case _ =&gt; resultSeed
     }
   }
+
+  override def toString = (colour + &quot;_&quot; + role).toLowerCase
 }
 
 trait IterationControl</diff>
      <filename>src/main/scala/au/com/loftinspace/scalachess/game/Piece.scala</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +1,4 @@
 &lt;%@ page contentType=&quot;text/html;charset=UTF-8&quot; language=&quot;java&quot; %&gt;
 &lt;%@ page import=&quot;au.com.loftinspace.scalachess.LoginSnippet&quot; %&gt;
 
-&lt;html&gt;
-    &lt;head&gt;
-        &lt;title&gt;Just tooling around for now ...&lt;/title&gt;
-    &lt;/head&gt;
-    &lt;body&gt;
-        &lt;h1&gt;Just a test&lt;/h1&gt;
-        &lt;%= new LoginSnippet().render(request) %&gt;
-    &lt;/body&gt;
-&lt;/html&gt;
+&lt;%= new LoginSnippet().render(request) %&gt;</diff>
      <filename>src/main/webapp/index.jsp</filename>
    </modified>
    <modified>
      <diff>@@ -4,13 +4,12 @@ import Positioning._
 import org.specs.Specification
 
 object BoardSpecs extends GameSpecification {
-
   val board = new Board
 
   &quot;a board&quot; should {
 
-    &quot;have no pieces by default&quot; in { board.pieces must beEmpty }
-    &quot;have nothing taken by default&quot; in { board.taken must beEmpty }
+    &quot;have no pieces by default&quot; in {board.pieces must beEmpty}
+    &quot;have nothing taken by default&quot; in {board.taken must beEmpty}
 
     &quot;allow a piece to be placed&quot; in {
       val updatedBoard = board place Piece(White, Rook) at 'e3
@@ -119,7 +118,7 @@ object BoardSpecs extends GameSpecification {
         position('f8) -&gt; Piece(Black, Bishop),
         position('g8) -&gt; Piece(Black, Knight),
         position('h8) -&gt; Piece(Black, Rook)
-      )
+        )
     }
 
     &quot;be able to be rewound to a prior state&quot; in {
@@ -308,4 +307,12 @@ object BoardSpecs extends GameSpecification {
     (newBoard threatsTo Black at 'b4) must beEmpty
   }
 
+  &quot;generate the correct JSON when empty&quot; in {
+    new Board().toJson must_== &quot;{\&quot;pieces\&quot;:{},\&quot;taken\&quot;:[]}&quot;
+  }
+
+  &quot;generate the correct JSON with one piece&quot; in {
+    new Board().place(Piece(Black, Queen)).at(Position(3, 5)).toJson must_== &quot;{\&quot;pieces\&quot;:{\&quot;e3\&quot;:\&quot;black_queen\&quot;},\&quot;taken\&quot;:[]}&quot;
+  }
+
 }
\ No newline at end of file</diff>
      <filename>src/test/scala/au/com/loftinspace/scalachess/game/BoardSpecs.scala</filename>
    </modified>
    <modified>
      <diff>@@ -27,7 +27,7 @@ object GameSpecs extends GameSpecification {
         position('g2) -&gt; Set(position('g3), position('g4)),
         position('h2) -&gt; Set(position('h3), position('h4)),
         position('b1) -&gt; Set(position('a3), position('c3)),
-        position('g2) -&gt; Set(position('f3), position('h3))
+        position('g1) -&gt; Set(position('f3), position('h3))
       )
     }
 
@@ -35,7 +35,6 @@ object GameSpecs extends GameSpecification {
       game.movesFrom(position('a2)) must_== Set(position('a3), position('a4))
     }
 
-
 /*
     &quot;report what piece is at any coordinate&quot;.withA(game) { game =&gt;
       val pawn = Piece(Black, Pawn)</diff>
      <filename>src/test/scala/au/com/loftinspace/scalachess/game/GameSpecs.scala</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>23c16b630bb65d224fa63e7865b79463f57d3f02</id>
    </parent>
  </parents>
  <author>
    <name>Jeremy Mawson</name>
    <email>jem.mawson@gmail.com</email>
  </author>
  <url>http://github.com/Synesso/scala-chess/commit/1cd19158b09b11c8701e70d85405e1d26d874936</url>
  <id>1cd19158b09b11c8701e70d85405e1d26d874936</id>
  <committed-date>2009-07-28T04:56:58-07:00</committed-date>
  <authored-date>2009-07-28T04:56:58-07:00</authored-date>
  <message>Server-side JSON creation</message>
  <tree>1daf0d670789ba643fb058d0d7a43036ab7e3391</tree>
  <committer>
    <name>Jeremy Mawson</name>
    <email>jem.mawson@gmail.com</email>
  </committer>
</commit>
