<commit_before>---
layout: post
title:  "Fantastic Bits"
date:   2016-11-26
excerpt: "My failed late attempt at an online AI contest"
tag:
- Machine Learning
- contest
- Codingame
comments: false
---

<iframe width="560" height="315" src="//www.youtube.com/watch?v=xhgEOLJlbjw" frameborder="0"> </iframe>

--------------------------------------------------------------------------------

**[Fantastic Bits](https://www.codingame.com/leaderboards/challenge/fantastic-bits/country/de)** was an AI competition on Codingame where the goal was write a game AI which was going to compete in a 2D version of Quidditch. The entire contest lasted 10 days, but I only found out 3 days before the deadline. The plan was to write a game state simulator for heuristic tree search. (like how chess AIs work) Though I had just started getting to know C++ in depth, thanks to [this useful blog post](http://files.magusgeek.com/csb/csb_en.html) from someone who had competed in a similar previous competition I almost had my simulation finished and was going to train a Neural Network to learn the tree search heuristic using the [NEAT](https://en.wikipedia.org/wiki/Neuroevolution_of_augmenting_topologies) algorithm by making the species compete against each other. Had I finished the simulation with only an hour to spare the heuristic would have probably been a simple score evaluation, so essentially a random [Monte Carlo](https://en.wikipedia.org/wiki/Monte_Carlo_method) search copout.

The code containing my simulation of the game can be found **[here](https://github.com/TheDiscoMole/Fantastic-Bits-Simulation)**. Note that this code is full of bugs due to rushed coding and understanding of game mechanics, but can be used a sim template for future challenges.<commit_msg>Update 2016-11-26-fantastic-bits.md<commit_after>---
layout: post
title:  "Fantastic Bits"
date:   2016-11-26
excerpt: "My failed late attempt at an online AI contest"
tag:
- Machine Learning
- contest
- Codingame
comments: false
---

<iframe width="560" height="315" src="//www.youtube.com/watch?v=xhgEOLJlbjw" frameborder="0"> </iframe>

**[Fantastic Bits](https://www.codingame.com/leaderboards/challenge/fantastic-bits/country/de)** was an AI competition on Codingame where the goal was write a game AI which was going to compete in a 2D version of Quidditch. The entire contest lasted 10 days, but I only found out 3 days before the deadline. The plan was to write a game state simulator for heuristic tree search. (like how chess AIs work) Though I had just started getting to know C++ in depth, thanks to [this useful blog post](http://files.magusgeek.com/csb/csb_en.html) from someone who had competed in a similar previous competition I almost had my simulation finished and was going to train a Neural Network to learn the tree search heuristic using the [NEAT](https://en.wikipedia.org/wiki/Neuroevolution_of_augmenting_topologies) algorithm by making the species compete against each other. Had I finished the simulation with only an hour to spare the heuristic would have probably been a simple score evaluation, so essentially a random [Monte Carlo](https://en.wikipedia.org/wiki/Monte_Carlo_method) search copout.

The code containing my simulation of the game can be found **[here](https://github.com/TheDiscoMole/Fantastic-Bits-Simulation)**. Note that this code is full of bugs due to rushed coding and understanding of game mechanics, but can be used a sim template for future challenges.
{'fraction_non_alphanumeric': 0.10046056419113414, 'fraction_numerical': 0.013241220495106506, 'mean_word_length': 4.225563909774436, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 8, 'lorem ipsum': 0, 'www.': 4, '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': '229309', 'n_tokens_mistral': 980, 'n_tokens_neox': 906, 'n_words': 438}