Hi, can anyone help with my python 3 code, here is a sample:
minimo = []
for i in range(num_sites):
minimo.append(sites[i].dist_site)
minimo = sorted(minimo)
for x in sites:
if x.dist_site == minimo[0] and x.owner != 0:
msg = "BUILD " + str(x.site_id) + " BARRACKS-KNIGHT"
I created a class Sites for storing sites info and status. I calculate the nearest site and send the queen to build but she keeps rebuilding it instead of going for the next nearest site. It looks like the sites info arent updated every turn, but since the updates are inside the game loop, I dont understand why not.
This happend because i keep the minimum distance site a site that i already have, i just changed the condition to add the minimum distance always to a site that is not mine. Thanks for the help!
Hello, sometimes when I run my code this error comes:
Code failed: nothing should be sent to the output before reaching the main entry point for your language.
Read: [Error occurred during initialization of VM]
But I donât send anything to the output before the first round.
My Bot is written in Java. Does anybody else have this problem?
The number of turns keep changing randomly. now it is less than 10 turns all the time, it is even 3-4 turn!!!
in the code of the game I can see âtheGameManager.maxTurns = 200â
But it is not valid.
Any idea how to handle this?
I have just started Code Royale. This is very basic, but I was just wondering what the command to build a barrack at the queenâs closest building site is. Many thanks.
Hi, Iâm not sure if Iâm missing something, but in the description it says that the response time for the first move is 1s. Iâd like this second to calculate the best route between structures, but I donât know on where my queen is until the first turn⊠is there any way to know on which side I start before the game loop?
I know this is an old puzzle, but if anyone can help thatâd be great.
Iâve got everything working (at least, I think it does) for the first level in ruby⊠but the code is taking longer than the allowed time. Iâm still pretty new to this stuff in general, and donât know much about optimizing.
Can anyone give some advice on ways to get this moving fast enough?
Hi!
If any one could help me pleaseâŠ
I am trying to submit my first version in wood league and whatever I write in the first output line, I get the error âCouldnât process siteId:â
Hi, I just started doing Code Royale and am still getting the basic idea of it.
I have run into an issue, I am trying to find the closest site that I can build a tower. To do this I have to find the position of my queen. I am looping through the variable numUnits to find my queens position. This should work, but when I print it out numUnits = 0. I donât think it should be 0 because there are two queens on the field and it says:
"numUnits: Number of total active units, including Queensâ
The key part of the code is:
var numUnits int
fmt.Scan(&numUnits)
/*
The print below will mess up the code and cause and error, but
I am using it for testing purposes
*/
fmt.Println(numUnits, "numUnits")
Line 1 and 2: Two integers gold touchedSite
âŠ
Next numSites lines: Seven integers siteId gold maxMineSize structureType owner param1 param2
âŠ
Next Line: numUnits: Number of total active units, including Queens
Youâve deleted the lines that read the ânext numSites linesâ that come between the gold and numUnits. Probably best to make a copy of your code and reset to the default and make sure you donât remove any input statements.