king-of-the-hill javascript grid game
Moved out of the sandbox into its own post to allow running the Stack Snippet with test answers. Please don't compete here (the contest will be posted to main soon) but feel free to post answers to test any aspects of the Stack Snippet. Please let me know ...
@Mayube Thanks! Unfortunately I can't get it into a Stack Snippet but hopefully it will still work hosted externally. I'm looking forward to seeing what people come up with...
As long as you can all see the coloured regions spreading out as the ants move in the controller, then it should be nearly ready to post
Brilliant. I've tested it on Fedora with Firefox and Chromium, and on Windows with Internet Explorer and Edge, but I don't have a way of testing it on an Apple machine so if anyone does, I'd be interested to hear if it works
@Mayube Right. So until you find your first piece of food you can't make any workers
@trichoplax It's hard to predict the right balance between number of moves and size of the arena. I think someone should write at least one basic "competitive" test bot, so that a full game can be run. Then we can see how much of the arena the competitive bot is able to take over / how much different colonies interact with each other.
@Mayube Feedback on what is clear is exactly what I'm looking for. Even if something is mentioned but doesn't come across on a first reading, I want to fine tune it.
@PhiNotPi I have written more competitive players in private, and 10000 moves is enough to spread out over a significant fraction of the arena, so if it gets 16 players it should be enough time for them to crowd each other. Extending further could lead to battles later since food can be stolen, so I'm trying to guess how much of this to allow for
@totallyhuman That's up to the KotH author - in this case I'm allowing arbitrarily many entries each, as long as they don't collaborate - they have to all be trying to win individually
code-golf
Problem:
I need to call my friends but my phone is not working properly. The only buttons I can press are [Up], [Down] and [Call]. [Up] and [Down] can be used to navigate in my recent calls. My phone can hold up to N recent calls and I know all the friends I need to call are in the li...
@Mayube Yes I didn't add any colour because it was just about testing that one thing so it didn't matter where it was. It actually follows the same kind of path as the random walk player, but finds slightly more food on average due to not having to waste turns on colouring the arena...
> Since on average each piece of food is more likely to be in a dense region than a sparse region, a piece of food found at random is likely to be surrounded by more densely packed food than is found in general. This makes it worthwhile to search near previously found food even when the distribution is uniform. Is my thinking correct here?
A uniform distribution means that, if you find a piece of food at some location, then any other location near that food is just as likely to have food at any location further away.
Task
Find the first two primes above 1 million, whose separate digit sums are also prime.
Example
Take 23, which is a prime whose digit sum, 5, is also prime.
Solution
The solution is the concatination of the two numbers
If the first number is 1,234,567
and the second is 8,765,432,
your so...
@PhiNotPi That was my intuition, but then I thought that most food is in the clumped regions, so given that you have found one piece, the probability of being in a clump is higher. Sounds wrong but I can't work out why...
The optimal search strategy becomes one of covering as much ground as possible (based on ant vision, they only need to visit a fraction of the squares to view all of the squares).
But I'm not sure if it matters to make it more clumped, since there is already strategy is efficiently covering territory but also covering territory that is closest to the queen first.
@PhiNotPi Yes I'm keen to keep it as simple as possible without becoming uninteresting. There's also the fact that other workers can steal from the queen and disrupt each other's paths, so perhaps I'll stick with uniform
Actually, I think there might be a reason to make it more clumped, if you want the ants to perform more like actual ants where they search for food, and then establish a path for lots of workers to follow until they exhaust that food source.
@Mayube The worker types are just labels that each player can use however they see fit. So they can use it just to allow ants to distinguish each other, or they can write completely different code for different worker types - allowing for worker type 1 to be foragers and worker type 2 to be guards, or soldiers, or scouts, or whatever people come up with.
Just going off my intuition, paths right now are so you can find your way back to the queen (or so you can walk straight), there's not a reason for one worker to follow another worker's path.
@PhiNotPi Yes that's the thing. How much of ant behaviour do I want to include? Currently paths allow finding your way back to the queen, and avoiding going over the same ground twice, but there would be no point in advertising an area to other ants if the distribution is uniform. The only exception I can think of is if I'm a laden worker and I see food that I can't pick up myself, then I might want to communicate that
I would actually be a fan of "tiny clumps" of food. Like, food tends to come in pairs, either adjacent or spaced 2 apart. This means that there's incentive to either remember where you've gotten one piece of food to get another, or to search with teams of ants.
But since the clumps are tiny (2 food) their overall distribution is still very even and won't accidentally favor one colony over another.
@Mayube Because each turn you can either move, or change the color of a cell, or create a worker. You can't do more than one of these things simultaneously.
Hi, sorry I'm still here for this but I really wanna post it, so I'll post it later today. What do you guys think I can do for saying my 3rd rule clearly ?
Lennyface parser and selector
Your mission
Create, in the language of your choice, a program that outputs a randomly selected lennyface (artistic minifigures, see this) from an input - a string composed of numbers and lennyfaces. You will have to : first, parse this input; second, extract a pro...
I have severe depression and anxiety and had a bad reaction to a change in medication. But I've gone through a couple other revisions and am doing much better now.