Note: The survey for community favorite will be released soon
In this KoTH, the aim is to be the last bot alive. Coins will be placed in random areas, and your bot must get the coins first. If a bot runs into another bot, the bot with more coins wins, and the other bot dies. More details below.
Coin types
There will be 2 types of coins: gold and silver. Gold adds 5 coins to the bot's strength, and silver adds 2. Once a coin is collected, another coin is placed at another spot on the board. At any given time, there is one gold coin and four silver coins in the arena.
Bot collisions
In the event of two bots trying to occupy the same space, the one with more coins will stay, and the one with less will...not. The winning bot will gain 85% of opponents coins (Rounded up). If they are tied, both die. If three or more try to occupy the same space, the most powerful wins, and gets 85% of all the other bot's coins. In the event that the most powerful bot is a tie, all of the bots die who tried to enter the space.
Arena
The arena's side length is calculated with 4 + botCount
. When placing bots in the beginning of the game, random places are chosen. The system ensures that no bots start in the same space, or next to each other. Coins generate randomly, excluding a 3 by 3 square centered on each bot. If a bot is found outside of the arena, it dies instantly. The arena starts at (0,0), or Northwest, in the upper left corner, and the location of a bot is always an integer.
Your bot
Your bot should be a function, in any object oriented language that has arrays, integers, strings, and functions. Note that all submissions will be converted to Javascript, to make things simple. To store information between moves, use botNotes.storeData(key, value)
and botNotes.getData(key, value)
. You may not store or access data any way, other than that which is provided through the parameters and botNotes
. You should create a function that, when called, returns a string north
, east
, south
, west
, or none
. There will be 3 arguments for the function:
An object with four integers (
locationX
,locationY
,coins
,arenaLength
), your current location, your coins, and the length of the arenaA multidimensional array with the X and Y coordinates of other bots, and their coin count, ex-
[[0,5,4],[4,7,1],[7,4,12]]
An array with the coin locations listed (Gold is always first)
This is a king of the hill challenge, Standard Loopholes prohibited. Your function will be run several thousand times, each time allowed one "Move". Note that if the game exceeds 20,000 moves, the bot with the most coins wins. This will be done 8,000 times, to remove randomness.
Chatroom: https://chat.stackexchange.com/rooms/81347/gold-collectors-koth
Prizes:
First Place: 100-point bounty
Community Favorite: 15-point accepted answer
Winners:
First Place: TBTPTGCBCBA
Second Place: Big King Little Hill
Third Place: Potentially Victorious
Fourth Place: Polite Near-Sighted Drunk Bot
Fifth Place: Safety Coin