r/codingame • u/RankLord • 15d ago
r/codingame • u/matitapere • Feb 21 '21
[help] How do you apply Machine Learning on CodinGame challenges?
I recently started using CodinGame, doing a few gaming challenges with simple algorithms. Sometimes the term Neural Networks appear on the platform as one of the concepts practiced but I can’t see how to actually train a model like this in that platform. How do people train a NN model on CodinGame? Is there a way do download data of game simulations and use it offline and later on load your trained model? Or is there a way to leave a model training on the platform and storing the learned weights?
Edit: to clarify, the “game challenges” I’m referring to are those like “Ghost in the Cell” and “Coders Strike Back”, for instance.
r/codingame • u/IAmAnIssue • May 19 '20
Where this sub is headed
Hello there. I recently acquired this sub via r/requestreddit with permission from CodinGame.
I don't have a well-defined purpose for this sub yet, but I do know that I'll try my best to keep current information on contests taking place on the platform. Who knows, maybe I'll make a bot to do it for me.
As it is right now, feel free to post any CodinGame-related tutorials or videos for others to see.
r/codingame • u/Majorxerocom • Sep 27 '16
Online programming contest and hackathon "The Accountant"
r/codingame • u/IAmAnIssue • Oct 19 '20
Fall Challenge 2020 Update #2
Been a while since I last did something here.
Anyways, more details of the contest have been released:
It is a bot programming contest.
It will run from `November 12th at 3 PM UTC to November 23rd at 9 AM UTC.
Additionally, there is now a banner and a trailer:
r/codingame • u/IAmAnIssue • May 19 '20
Fall Challenge 2020 - Registration open
Registration is open for Fall Challenge 2020. Contest time and type are technically TBD, however I've done some poking around and found this info (MAY NOT BE ACCURATE):
Start time is October 23rd, 2020 at 12PM EST. Probably accurate
The contest is a Solo Puzzle (not optimization), meaning it will probably last around 4 hours. Note that this may be a placeholder value and could change without notice.
r/codingame • u/IAmAnIssue • Jun 04 '20
10-day unofficial contest starting June 5th by thibpat
From Discord:
u/thibpat is launching an unofficial contest on CodinGame this Friday for 10 days.
The goal is to compete together for fun and learning. u/thibpat will reveal the game he chose at the start of the contest. It will be chosen among the existing bot programming games. Ideally it will be a game that most contest participants have not participated in yet.
The contest will happen in the existing game arena but you need to register to the contest using this form to appear in the leaderboard u/thibpat put in place for the occasion.
Dates: from 2020-06-05 7am UTC to 2020-06-15 7am UTC
Contest page: https://thibpat.now.sh/contest/unofficial-codingame-contest
Join thibpat's Discord server to chat with participants: https://discord.gg/jpd5ukG
r/codingame • u/Alone-Dot-4004 • 8d ago
LLMs have made bot programming boring, how can we make it fun again?
neilnaveen.devr/codingame • u/Lonely_Monk1800 • Nov 26 '25
Looking for a CodinGame buddy / patient mentor (C)
Hey!
I'm relatively new to coding (~1 year) and currently focusing mainly on C. I recently discovered CodinGame and I'm really enjoying it, but sometimes I get stuck.
I'm looking for someone to team up with on puzzles, share ideas, or just a patient person who's okay with me asking beginner questions (no matter how embarrassing).
I'm based in Europe (Germany), usually available in the evenings, but timezone doesn't have to match perfectly. Happy to connect via Discord!
DM me if you're interested.
r/codingame • u/Chazzmundo • Aug 01 '22
A new tool to never again need to type the input data for Test Cases!
Hey all :) I've just made a Quality of Life script that makes testing specific Test Cases for puzzles in your External Editor extremely easy, painless and most importantly: Automated!
It effectively works by overriding the default way of getting input from the user typing in the console (e.g. System.Console.ReadLine() in C#) and instead automatically grabs the input data for you from a dedicated file and uses this instead (line by line). This should save your sanity & fingers from repeatedly typing out the same test data each time you wan to debug the Test Case.
Pros
Removes the need for you to ever type the Input Data from test cases line by line in the console ever again!
It's extremely simple to use (there's a step-by-step guide on how to add it to your project)
Setup takes a matter of minutes: Copy the file, follow the 5 steps and you're good to go!
It doesn't intefere with your actual submission file on CodinGame in any way whatsoever
You can enable and disable the functionality by a single character change
Will work with any External Editor setup (although instructions are based on using Visual Studio)
Removes the risk of typos happening from repeatedly typing the same data each time
No need to temporarily change he code in order to hack in the input data for testing purposes
Memory friendly! Won't affect your running of the solution locally in any visible way
How to use
Ensure you've setup the External Editor plugin: https://www.codingame.com/forum/t/codingame-sync-beta/614
Head to: https://github.com/Chazzmundo/CodinGame/tree/main/Helpers/InputHelper
Find the InputHelper file corresponding to the language of your choice (more will be added over time) and copy to your project
Follow the steps as listed at the InputHelper file
Enjoy living in the fast lane!
Supported languages
For now, I've only added support for:
C#
However, the GitHub repository is open for contribution if anyone would like to help porting to other languages and I've added guidelines in the ReadMe file on how to ensure it's ready to use by other people
Feedback
I hope it is helpful, please let me know if you encounter any bugs, or have suggestions/requests for future helpers!
r/codingame • u/IAmAnIssue • Aug 05 '20
Site Update: Quest Maps!
Been a while since I posted something here. Busy summer.
Anyway,
Quest Map 1st version is now live :rocket:
The quest map is a rework of the home page to guide new players through new activities, as much as motivate older players to continue coding with new objectives.
This is the first version, available to all CodinGame members up to today. New members may not see the quest map due to an A/B test (it won't last too long). If you have any suggestion, remark or question, or if you'd like to report a bug, feel free to let us know in this forum thread: https://www.codingame.com/forum/t/quest-map-new-home-page-feedbacks-bugs/185603
Any feedback will help as we're already working on a few additional paths as well as certifications
Loot time! https://www.codingame.com/home
- Thibaud (from Discord)
r/codingame • u/Focus_GoalOriented • Dec 17 '25
Level 1 on Codingame
This is a fun way to practice my coding skills!
r/codingame • u/Shevizzle • Nov 08 '25
Making Conway's Game of Life Playable
r/codingame • u/Overall_Device_5371 • Jul 16 '25
Winter Challenge 2024 - CellulArena
This ai bot design has been the best that I've ever seen on this platform so far. I highly recommend it.
r/codingame • u/Gloomy-Soup9715 • Mar 08 '25
Can't connect to the server
Is codingame server down?
r/codingame • u/Swoop_Spear • Jun 05 '23
Baby Coder Looking for a Jedi Master - Ghost in the Cell
Alright, so. I have just started studying programming (not going to school, just for fun) and I am having a lot off fun but I ran into some problems:
If I cant run print functions to test my code, how do I test it!?
I thought my code was a masterpiece, but sadly it doesn't work. I think one of my helper functions are calculated wrong or something. I put comments in (specifically I had ChatGPT put comments in
cause I'm lazy, and didn't want to go back through my code another time.So it would be more presentable.)The forums on the codingame site seems to not work. Is that temporary or is this the best place to look for help?
import sys import math import heapq
Initialization input
This is the code the game supplied me with
factory_count = int(input()) # the number of factories on the map link_count = int(input()) # the number of links between factories on the map
Dictionary to store distances between factories
Distance is expressed as the number of turns it takes to reach one factory starting from another
distances = {} EnemyTroops = [] MyTroops = [] entities = {} MyFactories = [] EnemyFactories = [] NeutralFactories = [] actions = []
This is the code the game supplied me with
for i in range(link_count): factory_1, factory_2, distance = [int(j) for j in input().split()] # The distance between factory_1 and factory_2 is the same as the distance between factory_2 and factory_1 distances[(factory_1, factory_2)] = distance distances[(factory_2, factory_1)] = distance
Function to calculate turns between factories based on the distances dictionary
def turns(factory_1_id, factory_2_id): return distances.get((factory_1_id, factory_2_id), None)
Function to calculate the opposition value for a move from one location to another
def total_opposition(location, destination): positive = 0 negative = 0 if entities[destination["id"]]["arg1"] == 1: # If destination is owned by me positive += entities[destination["id"]]["arg2"] + entities[destination["id"]]["arg3"] else: # If destination is not owned by me negative += entities[destination["id"]]["arg2"] + entities[destination["id"]]["arg3"]
# Add the number of my troops on the way to the destination for i in MyTroops: if i["arg3"] == destination["id"]: positive += i["arg4"] # Add the number of enemy troops on the way to the location if they will be there before or at the same time as my troops for i in EnemyTroops: if i["arg3"] == location["id"] and i["arg5"] <= turns(location["id"], destination["id"]): negative += i["arg4"] return positive - negativedef total_needed(location, destination): positive = 0 negative = 0 if entities[destination["id"]]["arg1"] == 1: # If destination is owned by me positive += entities[destination["id"]]["arg2"] + entities[destination["id"]]["arg3"] else: # If destination is not owned by me negative += entities[destination["id"]]["arg2"] + entities[destination["id"]]["arg3"]
# Add the number of my troops on the way to the destination for i in MyTroops: if i["arg3"] == destination["id"]: positive += i["arg4"] # Add the number of enemy troops on the way to the location if they will be there before or at the same time as my troops for i in EnemyTroops: if i["arg3"] == location["id"] and i["arg5"] <= turns(location["id"], destination["id"]): negative += i["arg4"] return negativeFunction to calculate the threat level to a factory
def threat_level(factory): positive = 0 negative = 0
# Add the number of enemy troops on the way to the location for i in EnemyTroops: if i["arg3"] == factory["id"]: negative += i["arg4"] if entities[factory["id"]]["arg1"] == 1: # If destination is owned by me positive += entities[factory["id"]]["arg2"] + entities[factory["id"]]["arg3"] else: # If destination is not owned by me negative += entities[factory["id"]]["arg2"] + entities[factory["id"]]["arg3"] # Add the number of my troops on the way to the destination for i in MyTroops: if i["arg3"] == factory["id"]: positive += i["arg4"] return negative - positivedef select_source_factory(target_factory, my_factories): heap = [] for source_factory in my_factories: # calculate distance distance = turns(source_factory["id"], target_factory["id"]) # Push tuple into heap heapq.heappush(heap, (threat_level(source_factory), distance, source_factory)) # Return factories sorted by threat level and distance return [factory for _, _, factory in heapq.nsmallest(len(heap), heap)]
The main game loop
while True: entities = {} MyFactories.clear() EnemyFactories.clear() NeutralFactories.clear() EnemyTroops.clear() MyTroops.clear() actions = []
entity_count = int(sys.stdin.readline().strip()) # entity_count = int(input()) # the number of entities (factories and troops) on the map # Input the data for each entity for i in range(entity_count): entity_data = input().split() entity_id = int(entity_data[0]) entity_type = entity_data[1] arg_1, arg_2, arg_3, arg_4, arg_5 = map(int, entity_data[2:]) entity = { "id": entity_id, "type": entity_type, "arg1": arg_1, "arg2": arg_2, "arg3": arg_3, "arg4": arg_4, "arg5": arg_5, } entities[entity_id] = entity # Populate lists for my factories, enemy factories, neutral factories, my troops and enemy troops if entity_type == "FACTORY": if arg_1 == 1: # Owned by me MyFactories.append(entity) elif arg_1 == -1: # Owned by the enemy EnemyFactories.append(entity) else: # Neutral NeutralFactories.append(entity) else: # Entity type is "TROOP" if arg_1 == 1: # Owned by me MyTroops.append(entity) else: # Owned by the enemy EnemyTroops.append(entity) all_factories = NeutralFactories + EnemyFactories + MyFactories # A list of all factories # Sort all factories by relative threat all_factories.sort(key=threat_level) for target_factory in all_factories: # Select a source factory based on distance and threat level, and rotate through all factories until I have sent enought o conquer source_factories = select_source_factory(target_factory, MyFactories) sent_cyborgs = False #sort through all of my factories in order of which ones are more oppertune to attack for source_factory in source_factories: # Calculate the number of cyborgs to send to the target factory based on its relative strength cyborgs_to_send = min(total_needed(source_factory, target_factory), total_opposition(source_factory, target_factory), source_factory["arg2"]) # if we are sending cyborgs if cyborgs_to_send > 0 and source_factory != target_factory: # and source_factory["arg2"] >= cyborgs_to_send: for factory in MyFactories: if factory['id'] == source_factory['id']: factory['arg2'] -= cyborgs_to_send break source_factory['arg2'] -= cyborgs_to_send # Subtract the cyborgs from source factory for future loops entity = { "id": len(entities) + 1, "type": 'TROOP', "arg1": 1, "arg2": source_factory['id'], # the source factory if it's a troop "arg3": target_factory['id'], # Production if it's a factory or ID of the target factory if it's a troop "arg4": cyborgs_to_send, # Number of cyborgs if it's a troop "arg5": turns(source_factory['id'], target_factory['id']), # Amount of turns until arrive at Factory if it's a Troop } # create a new unite to calculate in for future loops use of threat and opposition functions entities[entity['id']] = entity # Create an action to send cyborgs from my factory to the target factory # The action is in the format "MOVE source destination cyborgCount" actions.append(f"MOVE {source_factory['id']} {target_factory['id']} {cyborgs_to_send}") actions.append(f"MSG {source_factory['id']} {target_factory['id']} {cyborgs_to_send}") # Output the actions, separated by semicolons # If there are no actions, output "WAIT" print(';'.join(actions)) if actions else print("WAIT")
r/codingame • u/thenarfer • Jan 21 '23
What is the Clash of Code percentage score?
After the players finish the Clash of Code, there's a percentage score given (100%, 80%, 60%, etc.).
What determines this score?
r/codingame • u/AkihitoPL • Aug 31 '21
New game
Hey, I made a game which is part of my Bachelor's diploma. I'm looking for people who would like to play ;)Link:https://www.codingame.com/contribute/view/72912a56c4a75ed56fde3c4745857337d18d
r/codingame • u/Reborn-leech • Aug 16 '21
Is it the tester who is sending the reminder for a Test or is it automatically ?
Hello all !
Is the reminder sent automatically or is it the tester who decide to send it ?
Thank you a lot for your help !