annotate code/README @ 85:f420fabd0e44 default tip

One last README change
author Michael Pavone <pavone@retrodev.com>
date Mon, 28 Jul 2014 04:42:24 -0700
parents ea6a0709373f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
36
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
1 Team: Rhope Burn
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
2 Language: Quiche
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
3 Members: Michael Pavone, William Morgan
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
4
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
5 HOW TO BUILD:
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
6
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
7 To build our Lambda-man AI, you first need to build the lmc compiler. lmc is
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
8 written in a WIP language called Quiche. The steps to get a Quiche toolchain
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
9 setup are as follows:
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
10
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
11 1) Make a local clone of hg repo: http://rhope.retrodev.com/repos/tabletprog
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
12 2) Make sure the d8 Javascript shell (built from Chrome's v8) is in your path
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
13 -- see this page for instructions on how to build d8:
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
14 https://developers.google.com/v8/build
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
15 3) Install the Boehm GC development package (libgc-dev on Debian derivatives)
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
16 3) Install gcc if it is not already present
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
17
82
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
18 Please note that there have been some fixes to the standard Quiche libraries
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
19 during the contest. If you cloned the repo before the end of the contest (say
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
20 for our lightning round entry), please do a fress pull to make sure you have
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
21 an up to date copy.
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
22
36
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
23 Once you have the toolchain in place, navigate to the Quiche repo clone in a
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
24 terminal and execute the following command.
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
25
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
26 ./compile PATH/TO/lmc.tp
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
27
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
28 If all goes well an executable named lmc will be produced at PATH/TO/lmc. This
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
29 program takes a .lm file as an argument and produces "GCC" assembly code on
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
30 stdout.
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
31
82
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
32 To build our Ghost AIs, you need to build the gqc compiler. gqc is also written
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
33 in Quiche. The process for building gqc is similar to building lmc. Once again,
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
34 navigate to the Quiche repo clone in a terminal. Then execute the following:
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
35
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
36 ./compile PATH/TO/gqc.tp
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
37
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
38 This should produce an executable named gqc in the same directory as qgc.tp.
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
39 This program takes a .gq file and produces GHC assembly on stdout.
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
40
36
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
41 ABOUTE QUICHE:
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
42
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
43 Quiche (previously called TP) is a language I (Michael Pavone) work on in my
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
44 spare time. It draws rather heavily from Smalltalk with a smattering of
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
45 influence from other languages. In theory, it's reason for existence is to be
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
46 a good target for a structured editor on mobile devices. In practice, I'd
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
47 probably be better served targeting an existing language, but that's not nearly
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
48 as much fun.
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
49
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
50 The current implementation is a quick and dirty bootstrap compiler written in
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
51 Javascript that produces C code. A self-hosted compiler is in progress.
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
52
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
53 A Quiche program is made up of one or more modules. At runtime, a module is
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
54 just a plain object. Only one module is allowed per source file. The top level
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
55 of a Quiche source file is required to either be an object literal or a lambda
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
56 that returns an object. After all modules used are initialized, execution
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
57 starts in the main method of the main module. Currently, the names of all
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
58 available modules occupy the top level of the symbol table; however, this will
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
59 change in the self-hosted compiler.
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
60
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
61 QUICHE SYNTAX:
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
62
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
63 To make reading lmc's code a bit easier, here is a quick primer on Quiche's
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
64 syntax.
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
65
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
66 line comment: //
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
67 block comment: /* */
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
68 assignment: foo <- bar
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
69 list literal: [1 2 3 4]
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
70 array literal: #[1 2 3 4]
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
71 string literal "foo bar"
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
72 lambda: :arg {
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
73 arg + 1
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
74 }
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
75 object literal: #{
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
76 foo <- "blah blah"
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
77 bar <- :val {
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
78 foo <- val . " blah"
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
79 }
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
80 }
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
81 method invokation/function application:
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
82 someval someFunOrMeth
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
83 someFunOrMeth: someval
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
84 some: val1 Fun: val2 OrMeth: val3
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
85 some:Fun:OrMeth: val1 val2 val3
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
86 operators:
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
87 +,-,/,* -- basic arithmetic
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
88 =,!=,>=,<= -- comparison
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
89 and,or,xor -- bitwise
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
90 % -- modulus
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
91 . -- concatenation
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
92 | -- cons
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
93
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
94 ABOUT LMC:
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
95
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
96 lmc implements a subset of Quiche for the LamCo General Compute Coprocessor. It
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
97 uses the parser, ast and symbols modules from the work in progress self-hosted
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
98 compiler. Object literals are not supported apart from the top-level object
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
99 that represents the module. That object is used to populate the global
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
100 environment. Closures are properly supported; however, some elements that are
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
101 implemented using closures in the normal Quiche compiler (namely if:else and
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
102 while:do) are instead implemented as special forms that do not introduce a new
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
103 scope. Array literals are used for producing tuples as the GCC does not really
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
104 support the former and Quiche does not currently support the latter.
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
105
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
106 Tail call optimization is notcurrently implemented; however, while:do is
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
107 implemented using TSEL so we were able to do without.
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
108
82
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
109 ABOUT GQC:
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
110
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
111 gqc implements a sort-of subset of Quiche for the GHC. The subset that is
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
112 supported is quite restrictive. All values are 8-bit integers, recursion is not
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
113 supported and control structures only support a single comparison in the
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
114 condition argument. It also adds some non-standard features to allow it to be
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
115 used as a high level assemlber. All processor registers are mapped to symbols,
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
116 instructions are mapped as pseudo-functions and bare names can be used as
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
117 labels. Additionally, there are pseudo-functions for all the defined interupt
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
118 routines with "magic" variables to deal with multiple return values.
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
119
36
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
120 LIGHTNING ROUND SOLUTION:
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
121
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
122 Our lightning round solution is relatively simple. Each step, we do a breadth
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
123 first search for something desirable (pellet, power pellet, fruit or fright
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
124 mode ghost). Cells occupied by normal mode ghosts and their immediate neighbors
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
125 are marked as walls to provide simple avoidance behavior.
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
126
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
127 We translate the grid to a tree format to provide more efficient lookup. An
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
128 identically dimensioned tree is used for keeping track of visited nodes for our
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
129 search.
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
130
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
131 This seems to work surprisingly well given how simple it is. I'm a bit
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
132 concerned about our cycle usage when the nearest "good" thing is far away,
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
133 hopefully that will not be an issue.
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
134
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
135 We noticed that the "undefined" input to main appears to be the ghost code, but
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
136 we did not have time to take advantage of it for the lightning round.
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
137
82
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
138 MAIN ROUND LAMBDAMAN AI:
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
139
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
140 Our plan for the main round was to run a simulation of the full game rules and
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
141 the individual ghosts so we could use that information for planning our moves.
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
142 Substantial progress was made to that end. We wrote a complete interpreter for
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
143 the GHC CPU in LM-Quiche and got quite far along in writing a game rule
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
144 simulator. Unfortunately, as the end of the contest drew near it became clear
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
145 that even if we finished the simulator in time, we would not be able to
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
146 integrate it into our AI before the contest ended.
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
147
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
148 So we ended up making some last minute tweaks to our lightning round AI. In
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
149 fright mode, it now ignores power pellets and chases ghosts exclusively if it
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
150 thinks it can catch them. Similarly, it will pursue fruit above pellets and
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
151 power pellets if it thinks it can reach the fruit in time.
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
152
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
153 Our Lambda Man AI remains in dotScanner.lm
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
154 The unused GHC interpeter is in ghc.lm
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
155 The unused gameState simulator is in gameState.lm
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
156
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
157 GHOST AI:
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
158
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
159 We wrote two ghost AI programs in Ghost-Quiche. They are inspired by the
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
160 classic Pac Man ghost AI. The first tries to move towards Lambda Man unless
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
161 it is in fright mode. The second is similar except that it targets a position
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
162 two tiles in front of Lambda Man, much like "Pinky" in Pac Man. Neither ghost
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
163 implements a scatter mode and they try to actively flee Pac Man in fright mode
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
164 rather than picking a pseudo-random direction.
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
165
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
166 Together, they perform better than the ghosts on the score server for the
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
167 classic map when pitted against our lightning round AI, but worse compared to
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
168 our main round AI.
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
169
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
170 The code for these is located in ghost0.gq and ghost1.gq
36
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
171
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
172 OTHER FILES:
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
173
82
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
174 ll.lm - library functions for interacting with linked lists in LM-Quiche
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
175 tree.lm - library functions for interacting with a tree of CONS-cells that
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
176 provide reasonably efficient random access
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
177 grid.lm - library functions for interacting with a grid made up of the above
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
178 trees
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
179 gcc.tp - An interpeter for GCC assembly written in regular Quiche. The plan was
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
180 to create an entire game simulator based on this interpreter and our
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
181 LM Quiche GHC and game state code. It did provide faster feedback for
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
182 runtime errors in the gameState simulator, but in retrospect the time
ea6a0709373f Updated README
Michael Pavone <pavone@retrodev.com>
parents: 36
diff changeset
183 would have been better spent elsewhere.
85
f420fabd0e44 One last README change
Michael Pavone <pavone@retrodev.com>
parents: 82
diff changeset
184 ghost2.gq - An attempt at writing a 3rd ghost AI. It seemed to worsen the
f420fabd0e44 One last README change
Michael Pavone <pavone@retrodev.com>
parents: 82
diff changeset
185 performance of our ghost team so it was abandoned.
36
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
186 test.lm - random collection of syntax for exercising parts of the compiler
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
187 simple.lm - picks each direction in order every 4 turns
c0b3922646d8 Fill in readme
Michael Pavone <pavone@retrodev.com>
parents: 0
diff changeset
188 mike00.lm - test program for developing library functions