The optimistic mode removes that constraint. The pessimistic mode assumes that nodes next to the heads of enemy snakes are not safe to travel.
There are two modes for evaluating the space size: pessimistic and optimistic. Each possible move is examined, and the one with the largest contiguous space is selected. If no path to a goal can be found, RUTHLESS falls back to a “largest space” algorithm. After all of the penalties and discounts have been applied, the result with the lowest cost is selected. For example, if the snake is hungry, paths that do not lead to food are penalized. Search results are collected and scored based on game conditions. Internally RUTHLESS uses the A* search algorithm to seek food, enemy heads, and its tail. However, during late spring 2017, high atop Trump Tower in NYC, The Battle Constrictor molted and RUTHLESS began to emerge. Contrary to what the name suggests, RUTHLESS is a tail-chasing “scaredy snake.” In a former life, RUTHLESS was known as “The Battle Constrictor,” a bounty snake from the empire of Workday.
#Battle snake springs series
Attacking logic (unless we really need to prioritize food).Do the following in order (skip a step if we determined we didn’t want to do it or found a move in a previous step).Determine which food (if any) we want to get.Determine if we have the opportunity to kill a snake (head to head and tunnel closing).Determine if we are ‘boxed in’ by judging immediate available space.Gather data then setup board by freeing up spaces and finding ‘bad_positions’ we don’t want to move in to (using floodfills and other logic).Seeing as we don’t do any look ahead, we didn’t need a large instance and we were responding within ~50ms on average.
Linting was also run periodically.įor the day of the competition, this was deployed to an instance in AWS (uwsgi and nginx). These helped a lot to ensure that future changes did not break the existing code. To help make sure this type of approach would work we created a set of static tests and dockerized several ‘test’ snakes. During development, we opted to use a variety of configuration variables so that we could easily modify it to face different bounty snakes. This snake is a ‘local search’ snake that considers a large number of situations (no predictions on what other snakes are going to do). Just like last year, each of our teams has offered to share some information about their strategy and design process: Unfortunately, we were unable to repeat last year’s success, with each of our snakes falling in the first round. Son of Robosnake, by Scott, Erika, and Tyler.Queen B, by Conrad, Mark, Stephen, and Jordan.
#Battle snake springs plus
We brought four snakes to the Expert division this year, plus a Bounty Snake: With three divisions (beginner, intermediate, and expert) and cash prizes for the top three winners of each division, the competition is fierce.Īs we were defending champions, the stakes were especially high for Redbrick’s teams this year. Your “snake” is placed on a board with other snakes, and the last snake slithering wins the round. The contest works like this: your objective is to write a program that plays the classic arcade game Snake. It was Redbrick’s third year sponsoring BattleSnake – an artificial intelligence programming competition held every year in our hometown of Victoria, BC, Canada and organized by our friends at Sendwithus.