-
435 |
- You have harvested at least half of the total crystal on the map before your opponent. 436 |
- You have more crystal than your opponent after
100 turns, or more ants if tied. 437 |
438 |
├── .gitignore ├── README.md ├── config ├── Boss.py ├── config.ini ├── level1 │ └── Boss.py ├── level2 │ ├── Boss.py │ ├── Tuto_Oeuf.jpg │ ├── welcome_en.html │ └── welcome_fr.html ├── level3 │ ├── Tuto_Fight.jpg │ ├── welcome_en.html │ └── welcome_fr.html ├── level4 │ ├── Boss.py │ ├── stub.txt │ ├── welcome_en.html │ └── welcome_fr.html ├── statement_en.html.tpl ├── statement_fr.html.tpl └── stub.txt ├── full_rules.pdf ├── full_rules_fr.pdf ├── pom.xml ├── src ├── main │ ├── java │ │ └── com │ │ │ └── codingame │ │ │ ├── event │ │ │ ├── Animation.java │ │ │ ├── AnimationData.java │ │ │ └── EventData.java │ │ │ ├── game │ │ │ ├── AntConsumption.java │ │ │ ├── Board.java │ │ │ ├── BoardGenerator.java │ │ │ ├── Cell.java │ │ │ ├── CellType.java │ │ │ ├── CommandManager.java │ │ │ ├── Config.java │ │ │ ├── CubeCoord.java │ │ │ ├── Game.java │ │ │ ├── GameSummaryManager.java │ │ │ ├── Player.java │ │ │ ├── Referee.java │ │ │ ├── action │ │ │ │ ├── Action.java │ │ │ │ ├── ActionException.java │ │ │ │ ├── ActionType.java │ │ │ │ └── actions │ │ │ │ │ ├── BeaconAction.java │ │ │ │ │ ├── LineAction.java │ │ │ │ │ ├── MessageAction.java │ │ │ │ │ └── WaitAction.java │ │ │ ├── exception │ │ │ │ ├── GameException.java │ │ │ │ └── InvalidInputException.java │ │ │ └── move │ │ │ │ ├── AntAllocater.java │ │ │ │ ├── AntAllocation.java │ │ │ │ ├── AntDecision.java │ │ │ │ └── AntMove.java │ │ │ └── view │ │ │ ├── CellData.java │ │ │ ├── FrameViewData.java │ │ │ ├── GameDataProvider.java │ │ │ ├── GlobalViewData.java │ │ │ ├── Serializer.java │ │ │ └── ViewModule.java │ └── resources │ │ └── view │ │ ├── .eslintrc.js │ │ ├── assets │ │ ├── Background.jpg │ │ ├── logo.png │ │ ├── particle.png │ │ ├── spritesheet.json │ │ └── spritesheet.png │ │ ├── config.js │ │ ├── demo.js │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── ts │ │ ├── Deserializer.ts │ │ ├── TooltipManager.ts │ │ ├── ViewModule.ts │ │ ├── assetConstants.ts │ │ ├── events.ts │ │ ├── gameConstants.ts │ │ ├── global │ │ │ ├── core.d.ts │ │ │ └── global.d.ts │ │ ├── hex.ts │ │ ├── pathSegments.ts │ │ ├── types.ts │ │ └── utils.ts │ │ └── tsconfig.json └── test │ ├── java │ └── Spring2023Main.java │ └── resources │ └── log4j2.properties ├── starterAIs ├── README.md ├── Starter.cpp ├── Starter.cs ├── Starter.fs ├── Starter.java ├── Starter.js ├── Starter.php ├── Starter.py ├── Starter.rb └── Starter.ts └── typescript ├── polyfill.js ├── readline.js └── readline └── index.d.ts /.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | /.project 3 | /.classpath 4 | /bin/ 5 | .factorypath 6 | /.settings/ 7 | .pydevproject 8 | src/main/resources/view/node_modules/ 9 | src/main/resources/view/graphics/ 10 | statement_en.html 11 | statement_fr.html 12 | /generated-boards/ 13 | node_modules/ 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SpringChallenge2023 2 | 3 | Source code for CodinGame's Spring Challenge 2023 event. 4 | 5 | https://www.codingame.com/contests/spring-challenge-2023 6 | 7 | Community starter AIs are located here: 8 | 9 | https://github.com/CodinGame/SpringChallenge2023/tree/main/starterAIs 10 | -------------------------------------------------------------------------------- /config/Boss.py: -------------------------------------------------------------------------------- 1 | while True: 2 | print('WAIT') 3 | -------------------------------------------------------------------------------- /config/config.ini: -------------------------------------------------------------------------------- 1 | min_players=2 2 | max_players=2 3 | type=multi -------------------------------------------------------------------------------- /config/level1/Boss.py: -------------------------------------------------------------------------------- 1 | redacted 2 | -------------------------------------------------------------------------------- /config/level2/Boss.py: -------------------------------------------------------------------------------- 1 | redacted 2 | -------------------------------------------------------------------------------- /config/level2/Tuto_Oeuf.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodinGame/SpringChallenge2023/dd151f9f8ce725f6012e312f188f11db70dd7616/config/level2/Tuto_Oeuf.jpg -------------------------------------------------------------------------------- /config/level2/welcome_en.html: -------------------------------------------------------------------------------- 1 |
17 | This is a league based challenge. 18 |
19 |The game takes place in a lab, in which two scientists in charge of robot ants are competing to 43 | find the most efficient way of gathering crystals.
44 | However, the ants cannot be controlled directly. The ants will respond to the presence of beacons. 45 | 46 |On each run, the map is generated randomly and is made up of hexagonal cells.
68 | Each cell has an index and up to six neighbors. Each direction is labelledThe amount of resources contained in each cell is also given, and is subject to change 114 | during the game as the ants harvest cells.
115 | 116 | A cell may also have a base on it. The players’ ants will start the game on these bases. 117 | 118 |Both players start with several ants placed on their 145 | 146 | base. 147 | 148 | 149 | bases. 150 | 151 | 152 | The players cannot move the ants 153 | directly but can place beacons to affect their movement. 154 |
155 | 156 |Players can place any number of beacons per turn but can only place one each per cell. 157 |
158 | 159 |When placing a beacon, players must give that beacon a strength. These beacon strengths 160 | act as weights, determining the proportion of ants that will be dispatched to each 161 | one.
162 | 163 |In other words, the higher the beacon strength, the greater the percentage 164 | of your ants that will be sent to that beacon.
165 | 166 |In the following example, there are three beacons of strength
174 |
The ants will do their best to take the shortest paths to their designated beacons, moving at 203 | a speed of one cell per turn.
204 | 205 | 209 | 210 |In between turns, the existing beacons are powered down and removed from play.
211 | 212 |213 | Use beacons to place your ants in such a way to create harvesting chains between your 214 | 215 | 216 | base 217 | 218 | 219 | bases 220 | 221 | 222 | and a resource. 223 |
224 | 225 |In order to harvest crystal and score points, there must be an uninterrupted chain of 233 | cells containing your ants between the resource and your 234 | 235 | base. 236 | 237 | 238 | bases. 239 | 240 |
241 | 242 |The amount of crystal harvested per turn is equal to the weakest link in the chain. In other 243 | words, it is the smallest amount of ants from the cells that make up the chain.
244 | 245 |In games with multiple bases per player, the game will choose the best chain to either one of your 259 | bases.
260 | 261 | 262 | 263 |264 | 265 | 266 |
267 |
268 |
269 | The harvesting chains work the same way for the egg resource.
270 |
Harvesting an egg cell will spawn as many ants as resources havested. The ants will spawn on the
271 | player’s base on the start of next turn.
272 |
273 |
274 |
275 |
Harvesting is calculated separately for each resource, and for each one the game will 294 | automatically choose the best chain from its cell to your base.
295 | 296 | 297 | 298 | 299 | 300 |A player’s harvest chains may be broken by their opponent’s attack chains.
312 | 313 |When computing harvest chains, some cells may have ants from both players. For each of these cells, the 314 | attack chain of both players is computed, and if one of the player has a lower value, this cell 315 | cannot be counted in the harvest chain. 316 |
317 | 318 | The attack chain value for a given cell is the weakest link in a chain from that cell to one of 319 | the player’s bases. 320 | 321 |361 | On each turn players can do any amount of valid actions, which include: 362 |
363 |17 | Ce challenge est basé sur un système de leagues. 18 |
19 |Le jeu se déroule dans un laboratoire, dans lequel 2 scientifiques en charge de fourmis robots 44 | s'affrontent pour trouver le moyen le plus efficace pour récupérer des cristaux.
45 | Cependant, les fourmis ne peuvent pas être contrôlées directement. Elles répondent uniquement à la présence 46 | de balises. 47 | 48 |Pour chaque partie, la carte est générée aléatoirement et est composée de cellules hexagonales. 71 |
72 | Chaque cellule a un indice et jusqu'à 6 voisines. Chaque direction est numérotée deLa quantité de ressources contenues dans chaque cellule est également donnée, et peut changer au 118 | cours de la partie lorsque les fourmis récoltent les cellules.
119 | 120 | Une cellule peut également contenir une base. Les fourmis des deux joueurs commenceront la partie sur ces 121 | bases. 122 | 123 |Chaque joueur commence avec plusieurs fourmis sur 150 | 151 | leurs base. 152 | 153 | 154 | leurs bases. 155 | 156 | 157 | Les joueurs ne peuvent pas contrôler les fourmis directement, mais peuvent placer des balises pour les 158 | attirer. 159 |
160 | 161 |Les joueurs peuvent placer autant de balises par tour qu'ils le souhaitent, mais ne peuvent en placer 162 | qu'une seule par cellule. 163 |
164 | 165 |Quand ils placent une balise, les joueurs doivent leur donner une puissance. Ces puissances se 166 | comportent comme des poids qui déterminent la proportion de fourmis qui seront réparties sur 167 | chaque balise.
168 | 169 |Autrement dit, plus la balise sera puissante, plus le pourcentage 170 | de vos fourmis allant sur cette balise sera élevé.
171 | 172 |Dans l'exemple suivant, il y a 3 balises de puissance
180 |
Les fourmis feront de leur mieux pour utiliser le plus court chemin vers leur balise, en se déplaçant à 207 | une vitesse d'une cellule par tour.
208 | 209 | 213 | 214 |Entre chaque tour, les balises existantes sont désactivées et retirées du jeu.
215 | 216 |217 | Utilisez les balises pour placer vos fourmis de manière à créer une chaîne de récolte entre 218 | 219 | 220 | votre base 221 | 222 | 223 | vos bases 224 | 225 | 226 | et une ressource. 227 |
228 | 229 |Afin de récolter des cristaux et marquer des points, il doit y avoir une chaîne ininterrompue 237 | de 238 | cellules contenant vos fourmis entre une ressources et 239 | 240 | votre base. 241 | 242 | 243 | vos bases. 244 | 245 |
246 | 247 |La quantité de cristaux récoltés par tour est égale au maillon le plus faible de la chaîne. Autrement 248 | dit, c'est la plus petite quantité de fourmis parmi les cellules qui composent la chaîne.
249 | 250 |Dans les jeux avec plusieurs bases par joueur, le jeu choisira la meilleure chaîne vers l'une ou l'autre de 264 | vos bases.
265 | 266 | 267 | 268 |269 | 270 | 271 |
272 |
273 |
274 | Les chaîne de récolte fonctionne de la même façon pour les oeufs.
275 |
Récolter des oeufs créera autant de fourmis que de ressources récoltées. Les fourmis apparaîtront dans
276 | la base du joueur au début du tour suivant.
277 |
278 |
279 |
280 |
La récolte est calculée indépendamment pour chaque ressource, et à chaque fois le jeu choisira 299 | automatiquement la meilleure chaîne de la cellule contenant la ressource jusqu'à la base.
300 | 301 | 302 | 303 | 304 | 305 |Les chaînes de récolte d'un joueur peut être interrompue par les chaînes d'attaque du joueur 317 | adverse.
318 | 319 |Au moment du calul des chaînes de récolte, certaines cellules peuvent avoir des fourmis de chaque joueur. 320 | Pour chacune de ces cellules, la chaîne d'attaque de chaque joueur est calculée, et si l'un des 321 | joueur a une valeur plus faible, cette cellule ne sera pas prise en compte dans la chaîne de récolte.
322 | 323 | La valeur de la chaîne de récolte pour une cellule donnée est le maillon le plus faible dans la 324 | chaîne entre cette cellule et l'une des bases du joueur. 325 | 326 |366 | A chaque tour les joueurs peuvent faire autant d'actions valides qu'ils le souhaitent parmi: 367 |
368 |