47
14
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
6"Note that all submissions will be converted to Javascript, to make things simple." How is this supposed to work? Do you make the conversion? – Laikoni – 2018-08-08T14:20:37.470
21There's nothing wrong with a koth only allowing a single language, especially one as widely spread as JavaScript. Rather than ambiguously "converting" answers to JavaScript (presumably yourself and by hand) you should simply limit the challenge to JS only. We've had plenty of Java-only and Python-only koths in the past, after all. – Skidsdev – 2018-08-08T14:23:25.340
@Laikoni Well, most
object oriented languages that have arrays, integers, strings, and functions
are similar, just with slightly different syntax, so I will just convert it myself – Redwolf Programs – 2018-08-08T16:05:59.767@Mayube yes, but limiting people to one language isn't neccessary with this challenge – Redwolf Programs – 2018-08-08T16:07:49.663
1
You should add a rule about external libraries, I imagine that a bot using scikit (or whatever other lib) would be time consuming to translate, even if it's only a few ten lines.
– ბიმო – 2018-08-08T16:28:36.993Gold coin will always be first position in array? even when someone collects it? – Luis felipe De jesus Munoz – 2018-08-08T18:14:35.817
@LuisfelipeDejesusMunoz When a coin is collected, a new one is generated elsewhere – Redwolf Programs – 2018-08-08T18:15:08.430
2A version of this where you control acceleration instead of position would be pretty cool. – akozi – 2018-08-08T19:21:56.923
@RedwolfPrograms Please upload the link to the controller for some testing. Also I notice this challenge looks like the game agar.io – Luis felipe De jesus Munoz – 2018-08-08T19:38:28.540
@LuisfelipeDejesusMunoz Never heard of it. Also, how do I upload a link? Is there some sort of imgur for other files? – Redwolf Programs – 2018-08-08T19:43:14.580
@RedwolfPrograms For uploading, Github Gist (https://gist.github.com/) is a pretty standard place for code.
– sundar - Reinstate Monica – 2018-08-08T20:02:24.65312To everyone: There are waaaay too many comments already. Do not leave useless comments such as "+1, nice bot", and please delete your comments if it's redundant. We are not a typical Q&A site, but nobody likes reading hundreds of commands. – user202729 – 2018-08-09T05:16:29.900
Is this trying to get a bot to play hole.io? :) – beirtipol – 2018-08-09T13:39:40.643
@beirtipol What is hole.io? – Redwolf Programs – 2018-08-09T13:43:49.547
1Are bot moves sequential? Or turn based/all at once? In other words, does each bot, in turn, get the current game state, execute its move alone, and the updated game state is sent to the next bot? Or do you submit the same current game state to all bots, get all planned moves, then execute them all simultaneously? (This would matter, for example, if you and a slightly larger bot were on opposite sides of a gold coin: could you eat the gold coin and grow before the other bot moved?) – BradC – 2018-08-09T20:40:56.487
5(To my own question): According to N.P. in chat, it is the latter: all the bots move, then all the conflicts get resolved, then all the coin pickups occur, then all the new coins are placed. – BradC – 2018-08-09T20:59:18.077
@RedwolfPrograms hole.io is a game for Android - you control a hole that moves around a map swallowing up people/objects/cars and smaller holes/players: https://play.google.com/store/apps/details?id=io.voodoo.holeio&hl=en
– beirtipol – 2018-08-21T17:52:57.540