9cdd37548c6f

Reindent
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Tue, 07 Feb 2017 11:45:06 +0000
parents e36b35a1857f
children d930dc9c101a
branches/tags (none)
files gdl/tictactoe.gdl

Changes

--- a/gdl/tictactoe.gdl	Sun Jan 22 12:37:45 2017 +0000
+++ b/gdl/tictactoe.gdl	Tue Feb 07 11:45:06 2017 +0000
@@ -6,23 +6,23 @@
 ;; Roles
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-  (role xplayer)
-  (role oplayer)
+(role xplayer)
+(role oplayer)
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Initial State
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-  (init (cell 1 1 b))
-  (init (cell 1 2 b))
-  (init (cell 1 3 b))
-  (init (cell 2 1 b))
-  (init (cell 2 2 b))
-  (init (cell 2 3 b))
-  (init (cell 3 1 b))
-  (init (cell 3 2 b))
-  (init (cell 3 3 b))
-  (init (control xplayer))
+(init (cell 1 1 b))
+(init (cell 1 2 b))
+(init (cell 1 3 b))
+(init (cell 2 1 b))
+(init (cell 2 2 b))
+(init (cell 2 3 b))
+(init (cell 3 1 b))
+(init (cell 3 2 b))
+(init (cell 3 3 b))
+(init (control xplayer))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Dynamic Components
@@ -30,105 +30,105 @@
 
 ;; Cell
 
-  (<= (next (cell ?m ?n x))
-      (does xplayer (mark ?m ?n))
-      (true (cell ?m ?n b)))
+(<= (next (cell ?m ?n x))
+  (does xplayer (mark ?m ?n))
+  (true (cell ?m ?n b)))
 
-  (<= (next (cell ?m ?n o))
-      (does oplayer (mark ?m ?n))
-      (true (cell ?m ?n b)))
+(<= (next (cell ?m ?n o))
+  (does oplayer (mark ?m ?n))
+  (true (cell ?m ?n b)))
 
-  (<= (next (cell ?m ?n ?w))
-      (true (cell ?m ?n ?w))
-      (distinct ?w b))
+(<= (next (cell ?m ?n ?w))
+  (true (cell ?m ?n ?w))
+  (distinct ?w b))
 
-  (<= (next (cell ?m ?n b))
-      (does ?w (mark ?j ?k))
-      (true (cell ?m ?n b))
-      (or (distinct ?m ?j) (distinct ?n ?k)))
+(<= (next (cell ?m ?n b))
+  (does ?w (mark ?j ?k))
+  (true (cell ?m ?n b))
+  (or (distinct ?m ?j) (distinct ?n ?k)))
 
-  (<= (next (control xplayer))
-      (true (control oplayer)))
+(<= (next (control xplayer))
+  (true (control oplayer)))
 
-  (<= (next (control oplayer))
-      (true (control xplayer)))
+(<= (next (control oplayer))
+  (true (control xplayer)))
 
 
-  (<= (row ?m ?x)
-      (true (cell ?m 1 ?x))
-      (true (cell ?m 2 ?x))
-      (true (cell ?m 3 ?x)))
+(<= (row ?m ?x)
+  (true (cell ?m 1 ?x))
+  (true (cell ?m 2 ?x))
+  (true (cell ?m 3 ?x)))
 
-  (<= (column ?n ?x)
-      (true (cell 1 ?n ?x))
-      (true (cell 2 ?n ?x))
-      (true (cell 3 ?n ?x)))
+(<= (column ?n ?x)
+  (true (cell 1 ?n ?x))
+  (true (cell 2 ?n ?x))
+  (true (cell 3 ?n ?x)))
 
-  (<= (diagonal ?x)
-      (true (cell 1 1 ?x))
-      (true (cell 2 2 ?x))
-      (true (cell 3 3 ?x)))
+(<= (diagonal ?x)
+  (true (cell 1 1 ?x))
+  (true (cell 2 2 ?x))
+  (true (cell 3 3 ?x)))
 
-  (<= (diagonal ?x)
-      (true (cell 1 3 ?x))
-      (true (cell 2 2 ?x))
-      (true (cell 3 1 ?x)))
+(<= (diagonal ?x)
+  (true (cell 1 3 ?x))
+  (true (cell 2 2 ?x))
+  (true (cell 3 1 ?x)))
 
 
-  (<= (line ?x) (row ?m ?x))
-  (<= (line ?x) (column ?m ?x))
-  (<= (line ?x) (diagonal ?x))
+(<= (line ?x) (row ?m ?x))
+(<= (line ?x) (column ?m ?x))
+(<= (line ?x) (diagonal ?x))
 
 
-  (<= open
-      (true (cell ?m ?n b)))
+(<= open
+  (true (cell ?m ?n b)))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-  (<= (legal ?w (mark ?x ?y))
-      (true (cell ?x ?y b))
-      (true (control ?w)))
+(<= (legal ?w (mark ?x ?y))
+  (true (cell ?x ?y b))
+  (true (control ?w)))
 
-  (<= (legal xplayer noop)
-      (true (control oplayer)))
+(<= (legal xplayer noop)
+  (true (control oplayer)))
 
-  (<= (legal oplayer noop)
-      (true (control xplayer)))
+(<= (legal oplayer noop)
+  (true (control xplayer)))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-  (<= (goal xplayer 100)
-      (line x))
+(<= (goal xplayer 100)
+  (line x))
 
-  (<= (goal xplayer 50)
-      (not (line x))
-      (not (line o))
-      (not open))
+(<= (goal xplayer 50)
+  (not (line x))
+  (not (line o))
+  (not open))
 
-  (<= (goal xplayer 0)
-      (line o))
+(<= (goal xplayer 0)
+  (line o))
 
-  (<= (goal oplayer 100)
-      (line o))
+(<= (goal oplayer 100)
+  (line o))
 
-  (<= (goal oplayer 50)
-      (not (line x))
-      (not (line o))
-      (not open))
+(<= (goal oplayer 50)
+  (not (line x))
+  (not (line o))
+  (not open))
 
-  (<= (goal oplayer 0)
-      (line x))
+(<= (goal oplayer 0)
+  (line x))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-  (<= terminal
-      (line x))
+(<= terminal
+  (line x))
 
-  (<= terminal
-      (line o))
+(<= terminal
+  (line o))
 
-  (<= terminal
-      (not open))
+(<= terminal
+  (not open))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;