mirror of https://github.com/dirtbags/tanks.git
Doc cleanup + working web site?
This commit is contained in:
parent
0a8d25cbe1
commit
5f8eac0746
|
@ -19,7 +19,9 @@
|
||||||
<nav>
|
<nav>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="{{ '/' | relative_url }}">Home</a></li>
|
<li><a href="{{ '/' | relative_url }}">Home</a></li>
|
||||||
<li><a href="{{ '/running' | relative_url }}">Running</a></li>
|
<li><a href="{{ '/intro' | relative_url }}">Introduction</a></li>
|
||||||
|
<li><a href="{{ '/forf' | relative_url }}">Forf</a></li>
|
||||||
|
<li><a href="{{ '/procs' | relative_url }}">Procedures</a></li>
|
||||||
<li><a href="{{ '/history' | relative_url }}">History</a></li>
|
<li><a href="{{ '/history' | relative_url }}">History</a></li>
|
||||||
<li><a href="{{ '/thanks' | relative_url }}">Thanks</a></li>
|
<li><a href="{{ '/thanks' | relative_url }}">Thanks</a></li>
|
||||||
<li><a href="https://github.com/dirtbags/tanks" title="Tanks on Github">Source</a></li>
|
<li><a href="https://github.com/dirtbags/tanks" title="Tanks on Github">Source</a></li>
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Forf Manual</title>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<link rel="stylesheet" href="style.css" type="text/css">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
syscmd(markdown forf.txt)
|
|
||||||
include(nav.html.inc)
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ and use the following example tank. This tank will
|
||||||
move around, turn the turret, and fire if there's something in
|
move around, turn the turret, and fire if there's something in
|
||||||
front of it.
|
front of it.
|
||||||
|
|
||||||
Sensor 0: 50 0 7 ☑
|
Sensor 0: 50 0 7 ☑
|
||||||
Sensor 1: 30 0 90 ☐
|
Sensor 1: 30 0 90 ☐
|
||||||
|
|
||||||
get-turret 12 + set-turret! ( Rotate turret )
|
get-turret 12 + set-turret! ( Rotate turret )
|
||||||
|
@ -54,10 +54,10 @@ front of it.
|
||||||
0 sensor? { fire! } if ( Fire if turret sensor triggered )
|
0 sensor? { fire! } if ( Fire if turret sensor triggered )
|
||||||
1 sensor? { -50 50 set-speed! } if ( Turn if collision sensor triggered )
|
1 sensor? { -50 50 set-speed! } if ( Turn if collision sensor triggered )
|
||||||
|
|
||||||
Obviously, this tank could be improved.
|
This tank can be improved!
|
||||||
Watch other tanks in your game to get ideas about how to improve yours.
|
Watch other tanks in your game to get ideas about how to improve yours.
|
||||||
Don't forget the [Forf manual](forf.md) and the
|
Don't forget the [Forf manual](forf.md) and the
|
||||||
[Tank procedure reference](procs.html).
|
[Tank procedure reference](procs.md).
|
||||||
|
|
||||||
## Tank Specifications
|
## Tank Specifications
|
||||||
|
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
<nav>
|
|
||||||
<h2>Resources</h2>
|
|
||||||
<ul>
|
|
||||||
<li><a href="summary.html">Summary</a></li>
|
|
||||||
<li><a href="intro.html">Introduction</a></li>
|
|
||||||
<li><a href="forf.html">Forf manual</a></li>
|
|
||||||
<li><a href="procs.html">Tanks procedures</a></li>
|
|
||||||
<li><a href="debugger.html">Tanks debugger</a></li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
|
@ -1,74 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Tanks Procedure Reference</title>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<link rel="stylesheet" href="style.css" type="text/css">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>Tanks Procedure Reference</h1>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Each tank's program is run once per turn. The data and command
|
|
||||||
stacks are reset at the beginning of each turn, but memory is not,
|
|
||||||
so you can carry data over in memory registers if you want. See
|
|
||||||
the <a href="forf.html">Forf manual</a> for more information about
|
|
||||||
the base language.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
For tank specifications (sensor range, maximum speeds, etc.), see
|
|
||||||
the <a href="intro.html">introduction</a>.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
|
|
||||||
<h2>Limits</h2>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Forf Tanks has a data stack size of 200, and a command stack size
|
|
||||||
of 500. This means your program cannot have more than 200 data
|
|
||||||
items, or 500 instructions, including 2 instructions for each
|
|
||||||
substack.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Forf Tanks provides 10 memory registers (0-9) which persist across
|
|
||||||
invocations of your tank's program.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
|
|
||||||
<h2>Additional Procedures</h2>
|
|
||||||
|
|
||||||
<dl>
|
|
||||||
<dt>fire-ready?</dt>
|
|
||||||
<dd>Returns 1 if the tank can fire, 0 if not.</dd>
|
|
||||||
|
|
||||||
<dt>fire!</dt>
|
|
||||||
<dd>Fires the cannon.</dd>
|
|
||||||
|
|
||||||
<dt>l r set-speed!</dt>
|
|
||||||
<dd>Sets the speed of the left and right treads (range: -100 to
|
|
||||||
100).</dd>
|
|
||||||
|
|
||||||
<dt>get-turret</dt>
|
|
||||||
<dd>Returns the current angle of the turret.</dd>
|
|
||||||
|
|
||||||
<dt>a set-turret!</dt>
|
|
||||||
<dd>Set the turret to a degrees.</dd>
|
|
||||||
|
|
||||||
<dt>n sensor?</dt>
|
|
||||||
<dd>Returns 1 if sensor n is triggered, 0 if not.</dd>
|
|
||||||
|
|
||||||
<dt>s set-led!</dt>
|
|
||||||
<dd>Turns off the LED if s is 0, on for any other value.</dd>
|
|
||||||
|
|
||||||
<dt>n random</dt>
|
|
||||||
<dd>Returns a random number in the range [0, n). That is, between
|
|
||||||
0 and n-1, inclusive.</dd>
|
|
||||||
</dl>
|
|
||||||
|
|
||||||
include(nav.html.inc)
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,47 @@
|
||||||
|
# Tanks Procedure Reference
|
||||||
|
|
||||||
|
Each tank's program is run once per turn. The data and command
|
||||||
|
stacks are reset at the beginning of each turn, but memory is not,
|
||||||
|
so you can carry data over in memory registers if you want. See
|
||||||
|
the [Forf manual](forf.md) for more information about
|
||||||
|
the base language.
|
||||||
|
|
||||||
|
For tank specifications (sensor range, maximum speeds, etc.), see
|
||||||
|
the [introduction](intro.html).
|
||||||
|
|
||||||
|
## Limits
|
||||||
|
|
||||||
|
Forf Tanks has a data stack size of 200, and a command stack size
|
||||||
|
of 500. This means your program cannot have more than 200 data
|
||||||
|
items, or 500 instructions, including 2 instructions for each
|
||||||
|
substack.
|
||||||
|
|
||||||
|
Forf Tanks provides 10 memory registers (0-9) which persist across
|
||||||
|
invocations of your tank's program.
|
||||||
|
|
||||||
|
|
||||||
|
## Additional Procedures
|
||||||
|
|
||||||
|
fire-ready?
|
||||||
|
: Returns 1 if the tank can fire, 0 if not.
|
||||||
|
|
||||||
|
fire!
|
||||||
|
: Fires the cannon.
|
||||||
|
|
||||||
|
l r set-speed!
|
||||||
|
: Sets the speed of the left and right treads (range: -100 to 100).
|
||||||
|
|
||||||
|
get-turret
|
||||||
|
: Returns the current angle of the turret, in degrees.
|
||||||
|
|
||||||
|
a set-turret!
|
||||||
|
: Begin moving the turret to a degrees.
|
||||||
|
|
||||||
|
n sensor?
|
||||||
|
: Returns 1 if sensor n is triggered, 0 if not.
|
||||||
|
|
||||||
|
s set-led!
|
||||||
|
: Turns off the LED if s is 0, on for any other value.
|
||||||
|
|
||||||
|
n random
|
||||||
|
: Returns a random number in the range [0, n). That is, between 0 and n-1, inclusive.
|
Loading…
Reference in New Issue