changeset 30:3287eb6c25fe

Sort of working in the game simulator!!!!!
author William Morgan <billjunk@mrgn.org>
date Sat, 26 Jul 2014 00:23:19 -0700
parents 5d1ac440b9db
children 3812bf35168d
files code/dotScanner.lm
diffstat 1 files changed, 3 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/code/dotScanner.lm	Sat Jul 26 00:18:58 2014 -0700
+++ b/code/dotScanner.lm	Sat Jul 26 00:23:19 2014 -0700
@@ -173,7 +173,6 @@
 	}
 
 	grid:get <- :grid :pos {
-		print: #[15 pos]
 		x <- pos value
 		y <- pos tail
 		get: x fromTree: (get: y fromTree: grid)
@@ -202,28 +201,21 @@
 	visited <- 0
 
 	advancer <- :continuations {
-		print: 5
 		notdone <- 1
 		while: { notdone } do: {
 			if: (continuations isInteger?) {
 				notdone <- 0
 			} else: {
-				print: #[6 continuations]
 				continuations <- fold: continuations [] with: :acc el{
-					print: 7
 					ret <- acc
 					if: notdone {
-						print: 25
 						ret <- el:
 						if: (ret isInteger?) {
 						} else: {
-							print: #[26 ret]
 							if: (ret value) {
-								print: 27
 								notdone <- 0
 								ret <- (ret tail)
 							} else: {
-								print: 28
 								ret <- (ret tail) | acc
 							}
 						}
@@ -262,57 +254,44 @@
 			ret <- []
 			move <- 0
 			atpos <- 0
-			print: 9
 			if: (grid: grid inBounds?: myLoc) {
-				print: 10
 				if: (grid: visited get: myLoc) {
 				} else: {
-					print: 11
 					atpos <- grid: grid get: myLoc
 					if: (atpos = 2) + (atpos = 3) + (atpos = 4) {
-						print: 12
 						ret <- #[1 (reverse: path)]
 					} else: {
-						print: 13
 						visited <- grid: visited set: myLoc to: 1
 						if: atpos {
-							print: 14
 							move <- 0
 							while: { move < 4 } do: {
 								ret <- (makeContClos: grid (calcPos: move myLoc) move | path) | ret
 								move <- move + 1
 							}
 							ret <- #[0 ret]
-							print: 21
 						} else: {}
 					}
 				}
 			} else: {
-				print: 42
 			}
 			ret
 		}
 	}
 
 	step <- :myState world {
-		print: -1
 		grid <- makeTree: (map: (world value) :row { makeTree: row })
-		print: 0
 		lmState <- (world tail) value
-		print: 1
 		myLoc <- (lmState tail) value
 		
-		print: 2
 		visited <- treeMap: grid :row {
 			treeMap: row :el { 0 }
 		}
-		print: 3
 		path <- advancer: [(makeContClos: grid myLoc [])]
-		print: #[4 path]
 		#[0 (path value)]
 	}
 	
-	main <- {
+	main <- :initWorld ghostCode {
+		/*
 		print: (step: 0 #[
 			[
 				[0 0 0 0]
@@ -323,7 +302,7 @@
 			#[0 #[1 2] 2 3 0]
 			[]
 			0
-		])
+		]) */
 		#[0 step]
 	}
 }