-
Notifications
You must be signed in to change notification settings - Fork 2
/
README
46 lines (35 loc) · 1.65 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
This project aims to write a client/server CoreWar runner in 100% Javascript.
See http://www.corewar.info/
How to test on the server side:
- node tests/parser.js : test parsing on one warrior (edit file to change it)
- node tests/88all.js : run unitest comparing both versions in warriors/88/
- node tests/battle.js : run a battle between 2 imps (and soon more!)
How to run the backend/frontend:
- npm install express request test
- node backend/app.js => frontend should be up at http://localhost:40008
TODO / How to help:
- fix last few bugs in the parser
- fix literal replacement of EQUs
- use a proper JS loader and reduce the number of global variables when in browser mode.
- compare starting points in 88all
- document
- clean the code a bit
- create a nice browser GUI for showing battles (we already have pluggable viewers ! :-)
- create a hill
- create a ACE highlighter for redcode (https://github.com/ajaxorg/ace/tree/master/lib/ace/mode)
- profile and optimize!
Credits:
- Underscore.js
- Math Parser : http://silentmatt.com/javascript-expression-evaluator/
- Core/Warrior code forked from https://github.com/termie/corewarjs
- Frontend code forked from https://github.com/jeromeetienne/arenajs/tree/master/www/dashboard
License:
- GPLv2
How does the parser work:
This will be documented soon with some slides hopefully that I'll try to present maybe at NodeCamp.eu 2011
Basically, the parser does this :
- redcode.preparse(redcode) => javascript
- eval(javascript) => array of lines like [["MOV",I],["#",0],["$",42]]
- then the Core/Warrior combo executes them
If you add warriors:
- find warriors -name "*.red" > warriors/list.txt