Mercurial > repos > icfp2012
comparison 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 |
comparison
equal
deleted
inserted
replaced
19:7f2aba75c449 | 20:50a456168c25 |
---|---|
1 #{ | 1 #{ |
2 true <- #{ | |
3 if:else <- :self trueblock :elseblock { | |
4 trueblock: | |
5 } | |
6 } | |
7 | |
8 false <- #{ | |
9 if:else <- :self trueblock :elseblock { | |
10 elseblock: | |
11 } | |
12 } | |
13 | |
2 main <- { | 14 main <- { |
3 0 | 15 text <- sim readFd: 0 |
16 playfield <- (sim state) fromStr: text | |
17 os write: 2 text | |
18 os write: 2 "width: " . (string: (playfield width)) . "\n" | |
19 os write: 2 "height: " . (string: (playfield height)) . "\n" | |
4 } | 20 } |
5 } | 21 } |