« first day (2 days earlier)      last day (735 days later) » 

12:01 AM
It might be easier to write in pseudocode and then attack the JS particulars later. They can be a distraction otherwise
 
D:< that still has js things
 
Dave's players have all been updated to use short higher level readable code, which is just function names referring to all the JS elsewhere.
 
ok
well
ehhh
 
Makes grasping what is going on much easier...
 
[0,2,6,8]
 
12:03 AM
Some of my players during testing ended up completely unreadable...
 
those are the diagonals right?
 
Yes, in English reading order
[0, 2, 8, 6] is the diagonals in clockwise order
 
I don't see any reason to care about ordering really
actually
 
It led to a lot of wasted time searching for a subtle bug during testing for me...
 
maybe just the being able to see opposite sides
done
how to do js for loops again?
 
12:05 AM
much like C
 
I don't know c
but I think i remember now anyway
 
for (i=0; i<9; i++) { code }
 
does i be 1 first iteration through that loop?
 
No, it starts on what it's initialised to (zero in this case) and only gets incremented for the first time after the first time through the loop
And as soon as the termination condition is met (i<9 no longer true), it stops immediately so the code is never run with i=9
if in doubt you can get instant feedback in the console
 
12:09 AM
For example, typing for(i=0;i<9;i++){console.log(i)} in the console will show you for certain which values i takes
I sometimes find that easier than looking it up online
 
And I just realized that my trail-eraser was totally broken after the edit, as it was missing a .ant. and thus behaved like straighter
 
@ppperry They do happen to be adjacent to each other on the leaderboard so far...
 
yah, that might change because I fixed it now
 
I picked up the players at 22:45UTC, so any changes since then will need a restart to pick up
Oh - 3 minutes ago - that will definitely need a restart :)
 
yah
I just discovered the bug when doing some testing
 
12:13 AM
Thanks for letting me know. The leaderboard tournament is running with the latest players now
 
how do I add two to i
 
@DestructibleLemon i+2
 
Do you want to change i or just get the result?
 
in a for loop
 
i+=2
 
12:14 AM
or; in the for loop, i+=2
 
k thanks
 
@trichoplax great minds think alike ...
 
:)
Fools never differ :P
@DestructibleLemon If ever in doubt, longhand will work too - you can just use i = i + 2
The for loop is quite flexible. You can use any test for termination, and any code for updating i. You can square i each time, or take its square root, or whatever you need
 
gonna test my crappy code and see what happens
oh it got disqualified because I forgot the output format
TypeError: antFunction is null
what
@trichoplax
 
I can have a look if you like
 
12:22 AM
Right now my (plan for a) trailless ant can keep track of its location on a 108x108 area.
 
I've adjusted it from what it should be for the test and the comments aren't correct but whatever
var diagonals = [0,2,8,6]

if (view[4].ant.type == 5) // if this is the queen
{
    if (view.find((s,i) => i !== 4 && view[i].ant && view[i].ant.friend) !== -1) //we got a worker buddy
    {
        //tbd
    }
    else if (view[4].ant.food > 100) //if we clearly have spawned an ant (because we would have after having 1 food), but got separated
    {
        //tbd
    }
    else //start of game status, no food
    {
        if (view[4].color !== 5)
        {
            return {cell:4, color:5}
 
@PhiNotPi I'm now picturing a series of outposts with ants waiting to communicate to the next ant along how far it is from the queen, to allow going further than a single memory can hold
 
@trichoplax what happened?
 
@DestructibleLemon It's often a mismatched brace somewhere. I'll have a look
 
can't see any?
 
12:27 AM
try reloading the page with the new challenger still in the box. Sometimes that shows the correct message through disqualification-on-loading
and sometimes that just fixes the issue
 
wait
does search return -1 or null when stuff is not found?
I mean find
stupid js
 
I don't know. I didn't know JS before starting work on this KotH...
I'm not familiar with the => notation either
 
it's like the crappy computer version of lingua franca
stupid js
i hate it
 
It's surprisingly flexible and useful once you get used to it though
 
12:31 AM
The majority of mistakes I find during debugging my code are just my own daft errors, rather than anything wrong with JS
 
I've made another change to trail-eraser but it's relatively minor and shouldn't affect the leaderboard
significantly
 
wait a minute
 
@DestructibleLemon Just before half way down there's an unmatched opening parenthesis
 
ok thanks
that wasn't the entire thing
;_;
wait I have a lot of them
 
12:35 AM
Are you using a text editor that highlights matching braces/brackets/parentheses?
 
I don't recommend editing directly in the text area in the controller
It means not being able to press tab...
 
I developed my trail-eraser ant that way
 
Wow. I guess you're both happy with spaces...
 
@trichoplax lol my half done bot is in 5th place. I may just finish it and submit as a new bot
 
12:37 AM
yah
 
@Christopher It certainly doesn't score like a half done player...
3
 
var diagonals = [0,2,8,6]

if (view[4].ant.type == 5) // if this is the queen
{
    if ((view.find((s,i) => i !== 4 && view[i].ant && view[i].ant.friend)) !== -1) //we got a worker buddy
    {
        //tbd
    }
    else if (view[4].ant.food > 100) //if we clearly have spawned an ant (because we would have after having 1 food), but got separated
    {
        //tbd
    }
    else //start of game status, no food
    {
        if (view[4].color !== 5)
        {
            return {cell:4, color:5}
 
Still rejected before starting a game?
 
@trichoplax All it does wander around XD
Idk how it does so well
 
@Christopher Maybe it could win with a bit of fine tuning
Or a different disqualification message?
 
12:41 AM
@trichoplax I have an idea
Change color of path to blue
@trichoplax what number is blue?
 
@Christopher 7 in the main palette (they are shown in order from color 1 to color 8 in the palette drop down box
 
@trichoplax Thanks
 
10 messages moved from The Nineteenth Byte
 
@Christopher or 4, for light blue'
 
@trichoplax how do you run 85 games fast?
 
12:45 AM
@trichoplax Sorry, but I made quite a few more edits to trail eraser; you might need to restart
 
@Christopher 1. I click "No display". 2. I use a fast computer. 3. I use Chromium. 4. I optimised before posting the challenge
 
@trichoplax k
 
@ppperry No problem at all. As long as I know I can keep making sure it's running the latest code
 
its still ant function null
 
Much faster
 
12:47 AM
it simplified the code a lot, and avoided using state on colors other than to move straight
 
@Christopher If you don't want to use "No display" you can still get some speed up by reducing the delay (to zero)
 
@trichoplax Oh i did that the first time I tried it
Is there anyway to just make 2 workers and never make more?
Idk how I would convince it to remember
 
yes, by using the state of the board to store how many workers you made. See the older version of my trail-eraser for a similar technique
it is somewhat confusable, though
 
I bet
I also need to make my bot move faster.
 
@Christopher There may be lots of ways... Some examples are using colours to keep count, keeping the workers adjacent to the queen, or collecting more food (so no workers are created once you have more than, say, 3 food
 
12:50 AM
@trichoplax hmm good idea
 
@Christopher You can also use "No display" for just a few seconds at a time to boost forward and then restore display to see what happened
 
@trichoplax clever
I need to make my bot move faster. Every other coloring. Ideas?
 
@Christopher Roman Ants uses a dotted line to only have to paint half as many cells and move 50% faster. Alternatively, Forensic Ants and Steamroller Ants don't paint at all, using an adjacent worker to keep the queen moving in a straight line one cell per turn (the "speed of light")
 
@trichoplax hmm
 
I've been amazed at how many different approaches have turned up - far beyond what I came up with during testing
 
12:55 AM
broke my bot :_(
 
@ppperry Bad news, I'm afraid: Cannot create new worker on top of food. Input: [{"color":1,"food":0,"ant":null},{"color":1,"food":1,"ant":null},{"color":1,"fo‌​od":0,"ant":null},{"color":1,"food":0,"ant":null},{"color":6,"food":0,"ant":{"foo‌​d":1,"type":5,"friend":true}},{"color":6,"food":0,"ant":null},{"color":1,"food":0‌​,"ant":null},{"color":1,"food":0,"ant":null},{"color":1,"food":0,"ant":null}] Response {"cell":1,"type":2}
 
probably an exotic glitch that was present before but never showed up
 
Each one you fix opens up the possibility of new and interesting ones...
 
Everybody finds a glitch
 
@trichoplax fixed
 
12:57 AM
Wow that was quick
Included again
 
I just needed a !view[orthogonals[i]].ant.food check
 
Imma go to bed.
@ppperry oh thanks for that orthagonal code.
You were smarter
 
the basic straight line code for my bot is actually romanesco road with minor tweaks
 
@Christopher Another way is to "nest" after you have enough food for however many workers you want to make. For example, by colouring the 9 cells around you and then just sitting waiting for workers to return
 
bah, I just looked at the previous disqualification earlier, and realized that my ant was treating white as a color to erase and thus fixed that
 
1:14 AM
@ppperry No disqualification this time, but Trail-eraser has got to 35 type 2 workers without creating any other types, and without storing any food. Is that as intended?
 
no
it was a bug causing it to treat white as an intruder which I just fixed
so many problems keep proping up
 
I'll restart :)
 
sorry for repeatedly editing the same answer and forcing you to resetart
 
If there are more edits after I go to sleep, I'll probably post the resulting leaderboard once it stabilises, and then include the new edit in the next one. I don't mind restarting before I go to sleep though - it'll have plenty of time to stabilise overnight
 
@trichoplax diagonal ants still cover more ground, I think. 3/4ths the speed (1/2 instead of 2/3) but reveals 5/3rds the number of squares each step, giving 5/4ths better efficiency.
 
1:17 AM
My thoughts exactly :)
23 hours ago, by trichoplax
So Roman Ants get 50% more coverage, and diagonal gets 66% more coverage, so diagonal should still be slightly more effective
@ppperry One game in, Trail-eraser is not disqualified, and is 2nd place on the leaderboard (well, they are all still joint 1st at this stage, but it has the 2nd highest score after Lone Wolf)
 
ok, doing well
have you seen traces of it sabotaging things in that game
or did it happen to find a cluster of six food early, causing it to switch to food mode
 
It's going full speed on "No display" so I have no idea what it's doing. Now that I know it's working I might open a separate window to watch it with the display on
 
it will never beat lone wolf though, as it is never better in terms of raw food ability than straighter
I have at times seen trail-eraser sabotage ziggarut recently, so it still functions. I like it -- its a wild card of sorts, sometimes being a bomb that tears other ants' memory to shreds and sometimes being a subtle gatherer
 
I'm not running Ziggurat yet as it's still waiting to be fixed
In the display version, Trail-eraser is just making a long green line and no workers at all
Sounds like what you describe though - different strategies depending on initial conditions
 
1:35 AM
long green line happens when it finds no trails to erase
or it finds six food early
 
Yes it got 6 food very early on this time
 
oh
that makes it behave like straighter
and win some games
sometimes it finds six food later on and starts to build then ...
UNPREDICTABLE!
 
On average it seems to end up half way down the leaderboard rather than at the bottom like before
 
On an unrelated note, the controller crashes if an ant returns a cyclic value. For example the following code
a={}
a.a=a
return a
will totally prevent the game from being played
 
2:29 AM
@ppperry meenie
 
TypeError: antFunction is null help
Fixed, Syntax error that wasn't reported.
 
2:44 AM
@DestructibleLemon I didn't actually post an answer that exploited that crashing trick, just mention it for @trichoplax to hopefully fix
 
ok
@ATaco this is my ant
all the time
// is a comment right?
 
yes
as is /* comment */
which can be used if there are newlines in the comment
 
is view.find an actual command?
 
view is an array, which apparently defines a find method
I'm not good at that corner of Javascript; I just use for loops
 
Watching my ant near-miss food is the saddest thing.
 
2:54 AM
true
which is yours again?
or are you still making one
also I need help my antfunction is null
 
Still working on it.
 
(view[diagonals[i]].color != 5 && view[diagonals[(i+2)%4]].color == 5 && view[diagonals[i]].ant == null)
apparently missing parenthesis?
wait a minute this js interpreter uses negative list indices for errors...
 
3:18 AM
Shame I can't globally determine how many of each type of ant I have.
 
3:32 AM
why does this not work
var diagonals = [0,2,8,6];

if (view[4].ant.type === 5) // if this is the queen
{

        if (view[4].color !== 5)
        {
            return {cell:4, color:5};
        }
        else if ((view.find((s,i) => view[i].food)) !== -1)
        {
            return {cell:(view.find((s,i) => view[i].food))};
        }
        else
        {
            for (int i = 0;i<4;i++)
            {
                if (view[diagonals[i]].color != 5 && view[diagonals[(i+2)%4]].color === 5 && view[diagonals[i]].ant)
is it unmatched parens
 
4:22 AM
@DestructibleLemon for (int i
int isn't a thing, use var
 
 
3 hours later…
7:28 AM
ziggurat got pwned by wild fire
 
 
3 hours later…
10:10 AM
Can the answers use ES6 ?
 
@Evpok The leaderboard tournament is run on up to date Chromium on Fedora (Linux), so they can use anything supported by that provided it is consistent with the restrictions in the challenge specification.
Did you have a specific feature in mind? I can double check it works here if so
 
Not precisely, I never actually used ES5, so I am never sure of which features are ES6-exclusive :p
But OK, I am testing on Chromium over Ubuntu, so that should have the same capabilities :)
 
Anything you are used to on a modern, standards compliant browser should be fine. The behaviour seems fairly consistent across browsers as long as you don't use anything still marked "experimental". The only browser I needed to make significant changes for was Internet Explorer, and even that wasn't too bad.
17 messages moved to Trash
 
10:36 AM
@ppperry Thanks for highlighting this. Long running ants will be disqualified so only slow down the controller temporarily, but things like this that never return, or even things that take hours to return, will freeze up the controller making it impossible to even abandon the game. It would be frustrating to leave a long running tournament and come back to find it frozen, so I'll look into ways of forcing termination of a function that doesn't return quickly.
 
 
1 hour later…
11:45 AM
@trichoplax What if we have more than 16 entries? What decides which 16 players get to match each round?
 
@FrenzyLi Cryptorandom
Each game, 16 players will be selected at random
This is independent of which are nearer in score, to ensure they don't get compared more often with some than others. It does mean short term there may be biases just by chance, but the tournament will be left running until the controller indicates that the positioning is statistically significant.
I'm interested to see how this affects the ordering of those who suffer from Trail-eraser, once that player is no longer in every game
What makes for an effective strategy has changed subtly over time as new players arrive, and it may change again once not every player is present in every game
I suspect once we have more than 16 players I'll be running each leaderboard tournament for a lot longer...
 
12:02 PM
Thanks for your response :)
 
12:20 PM
@PhiNotPi I found an ant mill...
It's not an infinite loop as there is the option to exit to the lower left, but the laden worker pictured has been around this loop at least once.
There also seems to be a fair amount of randomness - it sometimes backtracks against the direction of the colours. I guess that's useful for dead ends? It still goes with the direction of the colours on average.
 
12:51 PM
@Zgarb even before your update, with some workers get caught in loops or white holes, Ziggurat built a huge structure and had the most food in this game, even coping with starting to overlap the black hole (and building over it):
Restarting the leaderboard tournament with the updated version now...
 
Hmm, interesting. Let's see how the new version fares.
 
Towards the end of that game, some of the workers got separated and started building areas that pointed the wrong way (you can see the beginnings of it in the region above and right of the main ziggurat). Seems to cope pretty well with encountering other players generally though.
Oh wow you changed the colour scheme - I had a moment of thinking the controller was breaking...
 
I chose the new colors based on what the existing straight-line ants are not using. :P
They were a problem in my couple of test games.
 
I wonder if someone will come up with a way of encoding direction in texture/pattern instead of colour so they can paint solely in white and green, to avoid the Trail-eraser
@Zgarb I also wonder how long you'll continue to have that luxury. It would only take a few more straight-line players and we'll be out of spare colours...
They've been hit by a Trail-eraser worker in the first game, but seem to be dealing with it losing only a few stranded workers.
 
1:24 PM
I experimented with a way to allow the workers to bust through trails if they believe they're following one, but it didn't work well enough to be useful (they would also destroy small parts of the valid ziggurat and slow down its growth).
I may return to that if another straight-line ant appears.
 
Ziggurat won 2 out of the first 3 games, but the single loss has brought it a fair way down the table. It happened because Trail-eraser managed to get right to the core so there were no paths left to the queen
 
It's annoying when that happens.
 
Also your new choice of colours becomes a problem when starting near the Black Hole - 2 of your colours overlap with its, which doesn't go well...
I only just noticed you have 4 colours rather than 3 now - I guess that means they can now cross a fault line without starting to loop
Hmm, I can't guess whether including green as one of your colours would insulate against Trail-eraser getting more than one layer in, or make things worse
 
My idea was to use blue to force the black hole to switch to it too early, if they happen start close to each other.
 
Ah I see. Will be interesting to see over a large number of games which of the two effects comes up more often.
I guess if you start close enough then they won't have enough workers to be able to keep up with your building
 
1:49 PM
so, this means that my trail-eraser modification trick from yesterday worked ...
 
Trail-eraser is about half way up the leaderboard at present (but we're only 4 games in)
 
ok
I expect it to do worse than straighter but better than the ants it sabotages earlier
 
It's still wreaking havoc but scoring in some games, so it's doing better on average than before
 
@trichoplax Medusa has been patched
 
Running a new tournament with the latest version now
 
1:53 PM
@trichoplax but then I'll modify trail-eraser to pick a random color at the beginning and build its trail out of that
meaning that no color will be safe
 
@ppperry Interesting :)
How will you choose a random colour?
 
not sure yet, but that would be an idea
maybe I change my color whenever I gain food
also, use of green isn't a perfect defense; if a trail-eraser follows another non-green trail into a green trail, or stumbles upon a green trail when lost, it will still eat it
 
@ppperry If you could do that, and gather a large amount of food yourself, you'd probably be near the top of the leaderboard...
 
or a lost trail-eraser winds up eating its own queen's tail, it will be happy to switch to any other green trail it finds
sometimes
does anything else actually use solely green right now?
(other than my straighter ant, which I'm deliberately keeping the same color to avoid competition)
 
If your Straighter player only uses it for keeping in a straight line, I'm guessing it doesn't matter whether its trail gets eaten, and doesn't matter what colour(s) it uses?
 
1:58 PM
yah
this only means that trail-eraser won't waste food when it crosses straighter's trail
 
Ah I see
 
it actually does matter the color, because my ants (both of them) ignore all colors other than green when pathing
which lets them path through black holes and wildfires
and means they sometimes barge through dave's ants' trails rather than getting confused by them
 
I'm working on coding up my trailless bot right now. To be more specific, I will probably let them leave trails, makes it much easier for them to know what ground they've covered and speeds them up a lot. But they won't depend on them.
 
We might find out what happens when there are more than 16 players fairly soon then...
We're up to 14.
 
there will be only a 1 in 17 chance that trail-eraser is excluded from the game, though
 
2:04 PM
At first, yes :)
Something even worse than Trail-eraser may come along though...
 
like ...
 
Only time will tell
 
all of the other confused ants are just getting confused by chance
not by some deliberate choice
 
@PhiNotPi for Medusa, does the guard change the queen's cell's color too? It doesn't always seem to wait until the whole border is one color before changing the centre cell's color.
 
@trichoplax yes
 
2:14 PM
That explains it then. I was confused at first
 
The queen doesn't let all the square be the same color, the guard tries to make them all the same color.
 
Oh I see - they are both changing all of them?
 
Queen only changes a cell when she has to to break up the uniformity.
 
2:31 PM
also, have you fixed the crash on cyclic values yet?
 
What crash?
 
@ppperry That's on the list of things to do, but not high priority as there are worse things to address first
 
ok
 
13 hours ago, by ppperry
On an unrelated note, the controller crashes if an ant returns a cyclic value. For example the following code
@PhiNotPi It's still important, as it means a long running function will not be disqualified until it returns, potentially forcing a restart days into a tournament. There were leaderboard bugs to be fixed first because they were current problems rather than potential problems. Luckily no one has yet posted code that doesn't terminate
 
@trichoplax because bugs like that are easy to discover
 
2:39 PM
Yes, they won't be posted if they happen frequently as the poster would already know about it. I still want to get around to preventing it though, as if it only happens 1 game in 100, the poster is unlikely to spot it but the tournament may well need to run for significantly more than 100 games if more players come in
 
 
9 hours later…
11:21 PM
has the leaderboard stabilized yet?
I would have expected a new leaderboard by now, considering there have been no edits for almost a day
 
It was about half stable, but I've restarted it for an edited player
If you sort by active, the last edit was 13:51 UTC today
I just restarted it by mistake though, mistaking a comment for an edit. I won't make that mistake again :(
It could easily take over 100 games to stabilise now, so the next leaderboard won't be before tomorrow morning UTC
Actually, thinking about it I needed to start over anyway, due to a disqualification. All games that contribute to the leaderboard should be excluding any disqualified players, to make things fair. Unfortunately this means a disqualification 100 games in means having to start from scratch with that player excluded
 
Hello everybody
How ya all doing
 
11:39 PM
Hello. Are you thinking of entering the contest?
 
@trichoplax what contest?
 
From the room description:
> A place to discuss the Ant QotH
The link is to the Ant Queen of the Hill contest, a JavaScript programming competition
That's what this room is all about :)
 
Sounds interesting
Although I have no idea how to program in javascript, but i guess it will be fun to watch
 
Yes you can watch in your browser without needing to know any JavaScript
You can also look at the existing entries if you want to see how they work - some of them don't require much code
 
is this a text based thing?
 
11:49 PM
If you follow the link to the contest page, you can run the game from there and see what it looks like. It's graphical - all players compete at once on a 2500 by 1000 arena.
 

« first day (2 days earlier)      last day (735 days later) »