<commit_before><html lang="en">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Basic Bot Tutorial</title>

	<link href="lib/bootstrap.min.css" rel="stylesheet">
	<link href="style/general.css" rel="stylesheet">
</head>
<body>
	<div class="container">
		<?php include 'includes/navbar.php'; ?>
		<div class="row">
			<div class="col-sm-12">
				<h1>Basic Bot Tutorial</h1>

				<p>The source code for the basic bot in many languages is located <a href="https://github.com/HaliteChallenge/Halite/tree/master/website/tutorials/basic">here</a>.</p>

				<h3>Prerequisites</h3>
				<p>It is highly recommended that you have followed the directions listed in our <a href="quickstart.php">quickstart tutorial</a> before following this tutorial.</p>

				<h3>Download the Tools</h3>
				<p>While working on your bot, you will want to run and visualize games locally. To do this, you will need the game environment, which runs games and outputs replay files, and the desktop visualizer, which visualizes the environment's replay files. These are located <a href="downloads.php">here</a>.</p>

				<h3>Running a Game</h3>
				<p>
					Once those are downloaded, unzip your starter package. If you are using a compiled language, such as Java or C++, please compile the <code>MyBot</code> file of the starter package. This may be done in Java like so: <code>javac MyBot.java</code> and in C++ like so: <code>g++ -std=c++11 MyBot -o MyBot</code>). We are going to run a game between two instances of the provided starter bot, which simply moves all of its pieces randomly. To do this, run the environment binary. It should prompt you for the game's dimensions (20 by 20 is perfectly reasonable) and your bot's start command. Examples of these commands include:
					<ul>
						<li>Java - <code>cd PATH_TO_BOT; java MyBot</code></li>
						<li>Python - <code>python3 PATH_TO_BOT/MyBot.py</code></li>
						<li>C++ - <code>PATH_TO_BOT/BOT_BINARY_NAME</code></li>
					</ul>
				</p>

				<p>
					In the future, it may be more convenient to pass in all of the game's arguments in one command instead of entering each argument when prompted. You may do this like so:</p>
				</p>

				<p>
					<code>./environment -d WIDTH HEIGHT "START_COMMAND_BOT_1" "START_COMMAND_BOT_2" ... "START_COMMAND_BOT_N"</code>
				</p>

				<p>
					Once you have started the environment and provided it with the map's dimensions and your bots' start commands, the environment should then execute your game, outputting the turn number intermittently and ending with a ranking of each participant. You should find the game's replay file, ending with the <code>hlt</code> extension and named a very large number (your system's timestamp at the end of the game), in the same directory as the environment. You can also create a Replays folder within the environment folder for organization, and the environment will store the replays there.
				</p>

				<h3>Visualizing a Game</h3>
				<p>
					To visualize the game that you just ran, drag the game's replay file onto <a href="game.php">the visualizer</a>. Soon, you should see a grid filled with a few of brightly colored squares. This is the map at the very start of the game.
				</p>

				<h3>Writing a Basic Bot (in Java)</h3>
				<p>
					As you can see, the included starter bot is pretty bad at playing Halite. It just moves each of its pieces randomly each turn. This logic is encoded in these lines of the starter bot.<commit_msg>Further update basic bot tutorial<commit_after><html lang="en">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Basic Bot Tutorial</title>

	<link href="lib/bootstrap.min.css" rel="stylesheet">
	<link href="style/general.css" rel="stylesheet">
</head>
<body>
	<div class="container">
		<?php include 'includes/navbar.php'; ?>
		<div class="row">
			<div class="col-sm-12">
				<h1>Basic Bot Tutorial</h1>

				<p>The source code for the basic bot in many languages is located <a href="https://github.com/HaliteChallenge/Halite/tree/master/website/tutorials/basic">here</a>.</p>

				<h3>Prerequisites</h3>
				<p>It is highly recommended that you have followed the directions listed in our <a href="quickstart.php">quickstart tutorial</a> before following this tutorial.</p>

				<p>While working on your bot, you will want to run and visualize games locally. To do this, you will need the <a href="downloads.php">game environment</a>, which runs games and outputs replay files. 

				</p>

				<h3>Running a Game</h3>
				<p>
					Once those are downloaded, unzip your starter package. If you are using a compiled language, such as Java or C++, please compile the <code>MyBot</code> file of the starter package. This may be done in Java like so: <code>javac MyBot.java</code> and in C++ like so: <code>g++ -std=c++11 MyBot -o MyBot</code>). We are going to run a game between two instances of the provided starter bot, which simply moves all of its pieces randomly. To do this, run the environment binary. It should prompt you for the game's dimensions (20 by 20 is perfectly reasonable) and your bot's start command. Examples of these commands include:
					<ul>
						<li>Java - <code>cd PATH_TO_BOT; java MyBot</code></li>
						<li>Python - <code>python3 PATH_TO_BOT/MyBot.py</code></li>
						<li>C++ - <code>PATH_TO_BOT/BOT_BINARY_NAME</code></li>
					</ul>
				</p>

				<p>
					In the future, it may be more convenient to pass in all of the game's arguments in one command instead of entering each argument when prompted. You may do this like so:</p>
				</p>

				<p>
					<code>./environment -d WIDTH HEIGHT "START_COMMAND_BOT_1" "START_COMMAND_BOT_2" ... "START_COMMAND_BOT_N"</code>
				</p>

				<p>
					Once you have started the environment and provided it with the map's dimensions and your bots' start commands, the environment should then execute your game, outputting the turn number intermittently and ending with a ranking of each participant. You should find the game's replay file, ending with the <code>hlt</code> extension and named a very large number (your system's timestamp at the end of the game), in the same directory as the environment. You can also create a Replays folder within the environment folder for organization, and the environment will store the replays there.
				</p>

				<h3>Visualizing a Game</h3>
				<p>
					To visualize the game that you just ran, drag the game's replay file onto <a href="game.php">the visualizer</a>. Soon, you should see a grid filled with a few of brightly colored squares. This is the map at the very start of the game.
				</p>

				<h3>Writing a Basic Bot (in Java)</h3>
				<p>
					As you can see, the included starter bot is pretty bad at playing Halite. It just moves each of its pieces randomly each turn. This logic is encoded in these lines of the starter bot.
{'fraction_non_alphanumeric': 0.1045221843003413, 'fraction_numerical': 0.006825938566552901, 'mean_word_length': 3.867128027681661, 'pattern_counts': {'":': 0, '<': 155, '<?xml version=': 0, '>': 155, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6509690', 'n_tokens_mistral': 2367, 'n_tokens_neox': 2041, 'n_words': 917}