-
Notifications
You must be signed in to change notification settings - Fork 2
/
intro.html.m4
147 lines (128 loc) · 4.65 KB
/
intro.html.m4
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<!DOCTYPE html>
<html>
<head>
<title>Tanks Introduction</title>
<meta charset="utf-8">
<link rel="stylesheet" href="style.css" type="text/css">
<script type="application/javascript" src="tanks.js"></script>
<script type="application/javascript" src="figures.js"></script>
</head>
<body>
<h1>Tanks Introduction</h1>
<table class="figure">
<caption>"ChashTank" dominates this short round.</caption>
<tr>
<td>
<canvas id="shortround"></canvas>
<script type="text/javascript">
start("shortround", shortround);
</script>
</td>
</tr>
</table>
<p>
Tanks is a game in which you pit your coding abilities against
other hackers. You write a program for your tank, set it out on
the battlefield, and watch how it fares against other tanks while
running your program.
</p>
<p>
Each tank has a turret-mounted laser, two treads, up to ten
sensors, and a diagnostic LED. Sensors are used to detect when
other tanks are inside a given arc. In the examples on this page,
"triggered" sensors turn black. Most tanks will take some action
if a sensor is triggered, such as changing speed of the treads,
turning the turret, or firing.
</p>
<p>
Tanks are programmed in Forf, a stack-based language similar to
PostScript. Please read the <a href="forf.html">Forf manual</a>
to learn more about forf, and the <a href="procs.html">Tanks
procedure reference</a> for a description of Tanks extensions.
</p>
<h2>Quick Start for the Impatient</h2>
<table class="figure left">
<caption>"Crashmaster" pwns the lame default tank provided in this
section.</caption>
<tr>
<td>
<canvas id="default"></canvas>
<script type="text/javascript">
start("default", default_);
</script>
</td>
</tr>
</table>
<p>
To get started, head over to the <a href="debugger.html">Tank
Debugger</a> and enter the following example tank. This tank will
move around, turn the turret, and fire if there's something in
front of it.
</p>
<pre style="clear: both;">
Sensor 0: 50 0 7 ☑
Sensor 1: 30 0 90 ☐
get-turret 12 + set-turret! ( Rotate turret )
37 40 set-speed! ( Go in circles )
0 sensor? { fire! } if ( Fire if turret sensor triggered )
1 sensor? { -50 50 set-speed! } if ( Turn if collision sensor triggered )
</pre>
<p>
Obviously, this tank could be improved. Studying the examples on
this page should give you ideas about how to make a better tank.
Don't forget the <a href="forf.html">Forf manual</a> and the
<a href="procs.html">Tank procedure reference</a>.
</p>
<h2>Tank Specifications</h2>
<table class="figure">
<caption>"Ant Lion" nails "Rabbit With Gun".</caption>
<tr>
<td>
<canvas id="antlion"></canvas>
<script type="text/javascript">
start("antlion", antlion);
</script>
</td>
</tr>
</table>
<p>
Your PF-255 autonomous tank is built to the exacting
specifications sent to our factory in New Khavistan. All
distances are in meters, angles in degrees.
</p>
<dl style="clear: both;">
<dt>Tank size</dt>
<dd>
The targettable area of the tank—the part which can be hit by a
cannon—is a circle about 7½ meters in radius.
</dd>
<dt>Speed</dt>
<dd>
Each tread can have a speed between -100 and 100. This is in
percentage of total speed for that tread, where total speed is
roughly 7 meters per turn.
</dd>
<dt>Sensors</dt>
<dd>
Each sensor has a maximum range of 100 meters. Of course, you
don't have to use the full range. Sensors may be attached to
the turret (they turn along with the turret), or left fixed to
the tank.
</dd>
<dt>Turret</dt>
<dd>
Turret angle can be set between -359° and 359°, with 0° directly
in front of the tank. Be aware that it takes time for the
turret to swing around: the turret can swing about 45° per turn.
</dd>
<dt>Cannon range and recharging</dt>
<dd>
When the cannon is fired, it obliterates everything for 50
meters in front of it. It takes around 20 turns for your cannon
to recharge after it's been fired, so only shoot when you feel
like you're going to hit something.
</dd>
</dl>
Good luck blowing everybody up!
include(nav.html.inc)
</html>