Mercurial > repos > icfp2012
annotate simulate @ 43:1f583d85c8ed
rocks slide correctly now. rock movement is complete.
author | William Morgan <bill@mrgn.org> |
---|---|
date | Sun, 15 Jul 2012 16:45:42 -0700 |
parents | d21c31c6b5ef |
children | ff8d7b4499f5 |
rev | line source |
---|---|
2
d21c31c6b5ef
Add dummy files for bin and build. Add simulate script for hooking up simulator and bot.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1 #!/bin/sh |
d21c31c6b5ef
Add dummy files for bin and build. Add simulate script for hooking up simulator and bot.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
2 |
d21c31c6b5ef
Add dummy files for bin and build. Add simulate script for hooking up simulator and bot.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
3 killafter () { |
d21c31c6b5ef
Add dummy files for bin and build. Add simulate script for hooking up simulator and bot.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
4 sleep $1; |
d21c31c6b5ef
Add dummy files for bin and build. Add simulate script for hooking up simulator and bot.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
5 /bin/kill -SIGINT $!; |
d21c31c6b5ef
Add dummy files for bin and build. Add simulate script for hooking up simulator and bot.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
6 } |
d21c31c6b5ef
Add dummy files for bin and build. Add simulate script for hooking up simulator and bot.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
7 |
d21c31c6b5ef
Add dummy files for bin and build. Add simulate script for hooking up simulator and bot.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
8 mkfifo .simpipe |
d21c31c6b5ef
Add dummy files for bin and build. Add simulate script for hooking up simulator and bot.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
9 if [ $# -gt 1 ]; then |
d21c31c6b5ef
Add dummy files for bin and build. Add simulate script for hooking up simulator and bot.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
10 bin/sim $1 < .simpipe | bin/lifter > .simpipe & killafter $2 |
d21c31c6b5ef
Add dummy files for bin and build. Add simulate script for hooking up simulator and bot.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
11 else |
d21c31c6b5ef
Add dummy files for bin and build. Add simulate script for hooking up simulator and bot.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
12 bin/sim $1 < .simpipe | bin/lifter > .simpipe |
d21c31c6b5ef
Add dummy files for bin and build. Add simulate script for hooking up simulator and bot.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
13 fi |
d21c31c6b5ef
Add dummy files for bin and build. Add simulate script for hooking up simulator and bot.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
14 rm .simpipe |
d21c31c6b5ef
Add dummy files for bin and build. Add simulate script for hooking up simulator and bot.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
15 |