diff src/lifter.tp @ 20:50a456168c25

Split readFd out of readFile for use in lifter. Add code to read map from stdin to lifter using code in sim
author Mike Pavone <pavone@retrodev.com>
date Sat, 14 Jul 2012 12:33:01 -0700
parents bb29dcd46cbf
children 7a274d6026c8
line wrap: on
line diff
--- a/src/lifter.tp	Sat Jul 14 12:09:06 2012 -0700
+++ b/src/lifter.tp	Sat Jul 14 12:33:01 2012 -0700
@@ -1,5 +1,21 @@
 #{
+	true <- #{
+	  if:else <- :self trueblock :elseblock {
+		trueblock:
+	  }
+	}
+
+	false <- #{
+	  if:else <- :self trueblock :elseblock {
+		elseblock:
+	  }
+	}
+	
 	main <- {
-		0
+		text <- sim readFd: 0
+		playfield <- (sim state) fromStr: text
+		os write: 2 text
+		os write: 2 "width: " . (string: (playfield width)) . "\n"
+		os write: 2 "height: " . (string: (playfield height)) . "\n"
 	}
 }