<commit_before><html lang="en">
<head>
    <?php include 'includes/header.php'; ?>

    <title>IO Spec</title>

    <link href="lib/bootstrap.min.css" rel="stylesheet">
    <link href="style/general.css" rel="stylesheet">
    <link href="style/learn.css" rel="stylesheet">
</head>
<body>
    <div class="container">
        <?php include 'includes/navbar.php'; ?>
        <div class="row">
        	<?php include 'includes/learn_sidebar.php'; ?>
            <div class="col-sm-9">
                <h1>IO Specification</h1>

                <h3>Overview</h3>

                <p>To make the interaction of bots with the Halite environment as simple as possible, bots communicate via stdin and stdout, sending strings of space-separated integers ended with a newline. Bots are expected to communicate using the format found below; any deviation from it will likely result in the bot being ejected from the game.</p>

                <p>Over the course of a game, every bot is given fifteen thousand milliseconds plus one-third of a millisecond per tile of the map per turn the game could go on. So, for example, on a 35x35 map (which can have at most 350 turns), bots have 15000 + (35 * 35 * 350 / 3) = 157916 milliseconds to send their responses. The clock starts ticking as soon as the environment finishes sending its data to the pipe and stops ticking when a newline character is received from a bot; if the clock hits 0, the bot will be ejected from the game and deemed to have lost (against all live players which are alive at that time).</p>

                <p>There are two separate formats of information that are sent between the environment and bots.
                    <ul>
                        <li>Initialization</li>
                        <li>Frame</li>
                    </ul>
                </p>

                <p>Bots are initialized only once at the start of the game, before the first frame. Following initialization, bots follow the frame format until the end of the game, when the environment will automatically terminate them.</p>


                <h3>Initialization Format</h3>

                <p>Every bot is sent the following, with each item newline-terminated:
                    <ul>
                        <li>A single integer representing their own tag within the game.</li>
                        <li>Two integers respresenting the <code>WIDTH</code> and <code>HEIGHT</code> of the map.</li>
                        <li>The production map.</li>
                        <li>The initial game map.</li>
                    </ul>
                </p>

                <p>Every bot is expected to respond with a string representing their name (newline-terminated) within three seconds.</p>

                <h3>Frame Format</h3>

                <p>Every bot is sent the the present game map (newline-terminated).

                    <p>Every bot is expected to respond with a set of moves (newline-terminated) within one second.

                        <h3>Format Specifics</h3>

                        <h4>Input Game Map Format</h4>

                        <p>The state of the map (including owner and strength values, but excluding production values) is sent in the following way:
                            <ul>
                                <li>One integer, <code>COUNTER</code>, representing the number of tiles with the same owner consecutively.</li>
                                <li>One integer, <code>OWNER</code>, representing the owner of the tiles <code>COUNTER</code> encodes.</li>
                            </ul>
                            The above repeats until the <code>COUNTER</code> total is equal to the area of the map. It fills in the map from row 1 to row <code>HEIGHT</code> and within a row from column 1 to column <code>WIDTH</code>.<br>
                            This is then followed by <code>WIDTH</code> * <code>HEIGHT</code> integers, representing the strength values of the tiles in the map. It fills in the map in the same way owner values fill in the map.
                        </p>

                        <p>Consider the following 3x3 map as an example (where <code>[O=x,S=y]</code> represents a tile owned by player x with strength y):<br>
                            <pre><code>[O=0,S=122] [O=1,S=25] [O=1,S=18]
[O=0, S=13] [O=0,S=45] [O=1,S=22]
[O=2,S=255] [O=2,S=85] [O=0, S=0]</code></pre><commit_msg>Added piece about coordinate system<commit_after><html lang="en">
<head>
    <?php include 'includes/header.php'; ?>

    <title>IO Spec</title>

    <link href="lib/bootstrap.min.css" rel="stylesheet">
    <link href="style/general.css" rel="stylesheet">
    <link href="style/learn.css" rel="stylesheet">
</head>
<body>
    <div class="container">
        <?php include 'includes/navbar.php'; ?>
        <div class="row">
        	<?php include 'includes/learn_sidebar.php'; ?>
            <div class="col-sm-9">
                <h1>IO Specification</h1>

                <h3>Overview</h3>

                <p>To make the interaction of bots with the Halite environment as simple as possible, bots communicate via stdin and stdout, sending strings of space-separated integers ended with a newline. Bots are expected to communicate using the format found below; any deviation from it will likely result in the bot being ejected from the game.</p>

                <p>Over the course of a game, every bot is given fifteen thousand milliseconds plus one-third of a millisecond per tile of the map per turn the game could go on. So, for example, on a 35x35 map (which can have at most 350 turns), bots have 15000 + (35 * 35 * 350 / 3) = 157916 milliseconds to send their responses. The clock starts ticking as soon as the environment finishes sending its data to the pipe and stops ticking when a newline character is received from a bot; if the clock hits 0, the bot will be ejected from the game and deemed to have lost (against all live players which are alive at that time).</p>

                <p>There are two separate formats of information that are sent between the environment and bots.
                    <ul>
                        <li>Initialization</li>
                        <li>Frame</li>
                    </ul>
                </p>

                <p>Bots are initialized only once at the start of the game, before the first frame. Following initialization, bots follow the frame format until the end of the game, when the environment will automatically terminate them.</p>


                <h3>Initialization Format</h3>

                <p>Every bot is sent the following, with each item newline-terminated:
                    <ul>
                        <li>A single integer representing their own tag within the game.</li>
                        <li>Two integers respresenting the <code>WIDTH</code> and <code>HEIGHT</code> of the map.</li>
                        <li>The production map.</li>
                        <li>The initial game map.</li>
                    </ul>
                </p>

                <p>Every bot is expected to respond with a string representing their name (newline-terminated) within three seconds.</p>

                <h3>Frame Format</h3>

                <p>Every bot is sent the the present game map (newline-terminated).

                    <p>Every bot is expected to respond with a set of moves (newline-terminated) within one second.

                        <h3>Format Specifics</h3>

                        <h4>Input Game Map Format</h4>

                        <p>The state of the map (including owner and strength values, but excluding production values) is sent in the following way:
                            <ul>
                                <li>One integer, <code>COUNTER</code>, representing the number of tiles with the same owner consecutively.</li>
                                <li>One integer, <code>OWNER</code>, representing the owner of the tiles <code>COUNTER</code> encodes.</li>
                            </ul>
                            The above repeats until the <code>COUNTER</code> total is equal to the area of the map. It fills in the map from row 1 to row <code>HEIGHT</code> and within a row from column 1 to column <code>WIDTH</code>. <b>Please be aware that the top row is the first row, as Halite uses screen-type coordinates.</b><br>
                            This is then followed by <code>WIDTH</code> * <code>HEIGHT</code> integers, representing the strength values of the tiles in the map. It fills in the map in the same way owner values fill in the map.
                        </p>

                        <p>Consider the following 3x3 map as an example (where <code>[O=x,S=y]</code> represents a tile owned by player x with strength y):<br>
                            <pre><code>[O=0,S=122] [O=1,S=25] [O=1,S=18]
[O=0, S=13] [O=0,S=45] [O=1,S=22]
[O=2,S=255] [O=2,S=85] [O=0, S=0]</code></pre>
{'fraction_non_alphanumeric': 0.09300761990138952, 'fraction_numerical': 0.016136261766024205, 'mean_word_length': 2.0754651964162645, 'pattern_counts': {'":': 0, '<': 193, '<?xml version=': 0, '>': 193, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '469197', 'n_tokens_mistral': 2489, 'n_tokens_neox': 2270, 'n_words': 1007}