more elaborate game rules
This commit is contained in:
parent
8cda16d1c9
commit
c43839f471
1 changed files with 72 additions and 27 deletions
|
@ -1,10 +1,17 @@
|
||||||
|
<div class="container">
|
||||||
<div class="game-rules">
|
<div class="game-rules">
|
||||||
<p>
|
<h3>Welcome to planetwars!</h3>
|
||||||
Every turn, your bot will receive a json-encoded line on stdin, representing the current game
|
|
||||||
state.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
Example game state:
|
<p>
|
||||||
|
Planetwars is a game of galactic conquest for busy people. Your goal is to program a bot that
|
||||||
|
will conquer the galaxy for you, while you take care of more important stuff.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
In every game turn, your bot will receive a json-encoded line on stdin, describing the current
|
||||||
|
state of the game. Each state will hold a set of planets, and a set of spaceship fleets
|
||||||
|
traveling between the planets (<em>expeditions</em>).
|
||||||
|
</p>
|
||||||
|
<p>Example game state:</p>
|
||||||
<pre>{`
|
<pre>{`
|
||||||
{
|
{
|
||||||
"planets": [
|
"planets": [
|
||||||
|
@ -22,6 +29,13 @@
|
||||||
"owner": 2,
|
"owner": 2,
|
||||||
"name": "enemy planet"
|
"name": "enemy planet"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"ship_count": 2,
|
||||||
|
"x": 0.0,
|
||||||
|
"y": 2.0,
|
||||||
|
"owner": null,
|
||||||
|
"name": "neutral planet"
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"expeditions": [
|
"expeditions": [
|
||||||
{
|
{
|
||||||
|
@ -37,11 +51,18 @@
|
||||||
`}</pre>
|
`}</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Every turn, you may send out expeditions to conquer other planets. You can do this by writing a
|
The <code>owner</code> field holds a player number when the planet is held by a player, and is
|
||||||
json-encoded line to stdout:
|
<code>null</code> otherwise. Your bot is always referred to as player 1.<br />
|
||||||
|
Each turn, every player-owned planet will gain one additional ship. <br />
|
||||||
|
Planets will never move during the game.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
Example command:
|
<p>
|
||||||
|
Every turn, you may send out expeditions to conquer other planets. You can do this by writing
|
||||||
|
a json-encoded line to stdout:
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>Example command:</p>
|
||||||
<pre>{`
|
<pre>{`
|
||||||
{
|
{
|
||||||
"moves": [
|
"moves": [
|
||||||
|
@ -54,16 +75,40 @@
|
||||||
}
|
}
|
||||||
`}
|
`}
|
||||||
</pre>
|
</pre>
|
||||||
|
<p>
|
||||||
|
All players send out their commands simultaneously, so there is no turn order. You may send as
|
||||||
|
many commands as you please.
|
||||||
|
</p>
|
||||||
|
|
||||||
The amount of turns an expedition will travel is equal to the ceiled euclidean distance between
|
<p>
|
||||||
its origin and target planet.
|
The amount of turns an expedition will travel is equal to the ceiled euclidean distance
|
||||||
|
between its origin and target planet.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Ships will only battle on planets. Combat resolution is simple: every ship destroys one enemy
|
||||||
|
ship, last man standing gets to keep the planet.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Head over to the editor view to get started - a working example is provided. <br />
|
||||||
|
Feel free to just hit the play button to see how it works!
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.game-rules {
|
.container {
|
||||||
padding: 15px;
|
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
.game-rules {
|
||||||
|
padding: 15px 30px;
|
||||||
|
max-width: 800px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.game-rules p {
|
||||||
|
padding-top: 1.5em;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in a new issue