« first day (1162 days earlier)      last day (3688 days later) » 

12:18 AM
I wrote a bot for Rusher's KOTH competition. :)
0
A: Survival Game - Create Your Wolf

undergroundmonorailThe Sheep in Wolf's Clothing Runs away. It prioritizes running away from Wolves the most, since they're going to be the most dangerous. Next are Lions, since they're nondeterministic. Bears and Stones are both not at all a problem, but we still run away from them if we have nothing better to do...

 
Yesssss
Thank you for realizing my idea :D
I'm writing the wrapper program now for all the non-javavors
 
Cool.
One problem with my bot: I'm not sure if it's within the rules for someone to change what letter represents their wolf, but if that happens I'll crash and end up Move.HOLDing if one gets within a space of me.
I could easily add a default case, though.
 
Ah, no, the Wolf char must be 'W'
we discussed this at length last night, heh -- that's one of the challenges. Your bot won't know if it's seeing a friendly wolf or enemy wolf. It's a dog eat dog war!
 
I just realized I left something in there that only did anything during testing...
 
Oh, you're good, you haven't changed it. the call to super('W') is what sets your character
 
12:24 AM
Whatever, my wolf gets up close and personal with anything that looks like an H :)
 
 
2 hours later…
2:30 AM
@Rusher how is MAP_SIZE actually given to the class? I'm not seeing any invocations of that nature.
 
3:17 AM
@ProgrammerDan It's not there. There's a Game.SIZE, but it's not visible to Animals.
 
Sigh. @Geobits that's what I was thinking. Hopefully Rusher wakes up and corrects his spec. I'm trying to build a wrapper and these sorts of things are very important :)
 
Luckily my wolf is too lazy to care about the map :p
 
hehe, so are all the others so far
 
3:36 AM
Well, to be fair, they don't have much of a choice in the matter
I did find an easy way to form a pack, though. Haven't tested it, but it looks good on paper. Will know soon.
 
I was hoping to have each of my wolves remember roughly where the animals they've seen last were and prefer the way with the least last-known positions, but the best way to do that seemed like trying to chart out a map which is much easier with a known size.
 
@undergroundmonorail yeah. As the map size grows, though, algorithms of that sort will get less and less effective. If ROCKS were truly indestructible, you could anchor against them, but sadly, they are not (or happily?)
 
I didn't even need anything accurate, just a rough idea.
Also, I'm assuming it would be considered poor form to make a new submission that exists only to make it easier for my first one to win? :P
 
LOL, I'll leave that to Rusher ... it isn't explicitly forbidden.
 
At the moment, my wolves exclusively throw paper against other wolves. I could, in theory, make a new set that spreads out, seeks wolves and repeatedly throws rock to thin their numbers :P
 
3:49 AM
hahaha
Oh the chaos!
 
4:03 AM
@undergroundmonorail As it is now, that might help. The more submissions come in, the less helpful it would be.
And my idea for packing worked wonders. The problem now is that they all die off rather quickly. They do pack while alive, though :(
 
4:34 AM
:(
 
4:58 AM
After a careful reading of the rules, it appears I can't disguise my wolf as an 'S' and throw scissors at other wolves when they try to paper me :(
 
^ How much PCG loves/hates tags, with 95% confidence.
is killing it.
 
Fascinating!
 
I get integer overflows running it on SO, need to polish it up a little, somehow.
 
5:18 AM
Ah, fixed.
 
6:17 AM
Wrapper class v1 posted
let the non-Java submissions flow
hopefully it works for folks other than myself. I'm sure it could be better, but hopefully it's useful.
and with that, good night.
(Just for posterity, here's the direct link)
 
 
2 hours later…
8:34 AM
@JasonC The people over on stats.stackexchange.com are not very impressed with Evan Fisher's approach, as I found out when I asked how to adapt it: stats.stackexchange.com/q/15979/6458
 
9:11 AM
@Rusher @ProgrammerDan I literally never did anything in java before so I'm blocking a bit on the instructions to test my "wolf pack" (that I wrote in R thanks to ProgrammerDan wrapper!). In particular the part where i m supposed to "rebuild" after I added my (compiled?) class to the folder animal. Concretely how am i supposed to do that? is it doable using javac only?
 
9:32 AM
I posted my R code in the meantime.
as a proof of concept more than anything
 
 
3 hours later…
12:12 PM
@plannapus If you wrote to spec, I'll whip up a compatible wrapper, no worries. You only have to compile if you want to test locally, and frankly that's going to be hard for people with no Java experience, I haven't thought of a way around that yet :/
 
12:38 PM
@plannapus -- I've got a wrapper for you Rscript program, but currently you aren't flushing your buffers
Consequently your wolves never initialize.
One last issue -- I do not invoke your process on every communication
your process is left running
@plannapus So you need to wait while reading from standard input, and every time you get a new line of input, reply with a new line of output. My Process Wrapper will end your process when the simulation is done.
I'll add some clarification.
 
Ok for the last point you mean i need to wrap everything with a while(TRUE){} basically?
 
Yep!
that's exactly it
if your language supports IO blocking on a channel, it will play well with all the others b/c that block frees up CPU as it's handled via interrupt requests (or equiv)
I've added some clarifications, thanks so much for being my guinea pig, @plannapus!
Posted a GIST with your custom wrapper :)
 
12:58 PM
You're welcome
 
I also have a version I can test locally, so if you have updates to your R program just ping me.
 
ok thanks!
@ProgrammerDan I added the while loop and something to flush the stdout (hope it works: I'm sorry for the "trial-and-error" but, professionally, I'm a paleontologist not a programmer :) so I do lack a formal training in some really basic thing, like typically connections issues)
 
@plannapus Not a problem!
@plannapus -- I've got to run for now. It's still not flushing right (it seems to be looking for an EOF terminator instead of newline for reading). Basically, you should be able to run it using Rscript and type in the input that my wrapper would send it, and have it return the correct responses to STDOUT
 
1:18 PM
arf of course, it's the damn scan. With readLines it should work better (see the update on the answer).
scan indeed need an EOF.
 
1:32 PM
0
Q: Regex in reverse - decompose regular expressions

DoorknobThe Problem I have a bunch of regular expressions that I need to use in some code, but I'm using a programming language that doesn't support regex! Luckily, I know that the test string will have a maximum length and will be composed of printable ASCII only. The Challenge You must input a regex...

my bot borked -_- but now it's fixed
 
@plannapus I'm on the road right now. When I get to my destination I'll try it out.It will be a few hours, sorry!
 
@ProgrammerDan No worries, it s nice enough of you already to do the tests :)
 
1:51 PM
@plannapus It had been a while since I used external process invocation in Java, great excuse for a refresher :)
 
3:01 PM
I did Doorknob's challenge, but I didn't notice the whole "no builtin libraries" requirement.
`import re,itertools,string
a=[""];d=raw_input();b=int(raw_input())
while len(a[0])<=b:print[c for c in a if re.match(d,c)];a=["".join(x)for x in itertools.product(a,string.printable)]`
So there's my code, if anyone's interested
It's just rediculously slow, and runs out of memory after about 3 chars ;)
 
@PeterTaylor Lots of good info there; I'll see if I can add some better ranking algorithms.
 
Oh dear.. I have some work to do @ProgrammerDan
 
Oh, don't actually run it
Running it in qpython just crashed my pc ;)
*ipython
 
3:22 PM
Is one of the criteria of KotH contests that the results of the competition should be repeatable (assuming the answers themselves are deterministic)?
In other words, is it an invalid KotH if it actually can't be repeatable?
 
@JasonC Can you link to the tag that has that requirement?
I can't seem to find it
 
Are you talking of ?
 
I'm going to say that some RNG is allowed because of the link to Prisoner's Dilemma.
 
@Rusher But I feel that RNG's should be PRNG and should be required to be seeded so that the program is deterministic.
 
I wonder if I should edit the challenge I just posted then to seed the generator. I don't think it would make much of a difference, because half of the submissions are using their own UNseeded RNG
Nah, because that would be unfair to the answers already posted. I'm just going to suggest an edit to the tag so that obvious to people in the future.
Suggested the edit if anyone wants to review it.
 
@Quincunx Yes.
@Quincunx Yes I agree with the PRNG seeds 100%. In particular, I'm wondering why codegolf.stackexchange.com/questions/25226/… is still open; to me it seems invalid. The issues were brought up to the OP a few days ago, but the challenge was never improved.
 
4:46 PM
Btw, does anyone know if chess KOTH has been done before?
 
@Synthetica I can't find any Chess KOTH when searching for it so I don't think it has been done before.
 
Hmm, very tempted to write a control program and post a question for it
 
Would you recommend a character limit on it?
 
Come on... 1 vote away from great answer:
99
A: Program that creates larger versions of itself (quine-variant)

QuincunxH9+ : 1 char 9 That's right. One character. Outputs the lyrics to 99 bottles of beer, which is a valid program. All the extraneous data does not count, but there are plenty of 9s in there. The output of the outputted program is the lyrics to 99 bottles of beer 59 times. This function gives t...

 
4:52 PM
There ya go ;)
 
@Synthetica Thanks! Now I have 3 gold badges (once the system updates this)
 
@Synthetica Maybe? The thing is, and this is just my opinion of course, I feel like a chess competition is sort of as played out as "Is C++ faster than Java?". A PCG championship would be kinda weak compared to the WCCC. That said, who knows? It would definitely attract interesting and good answers. A character limit would put a unique and interesting twist on it.
Why don't you put a short time limit on moves instead? Then it's about the algorithm instead of choosing the least verbose language.
 
@JasonC Yeah, that was also my original idea.
Call, and if it doesn't respond within, say, a second, it loses.
 
Yeah
 
5:11 PM
@Quincunx @JasonC Out of curiosity, why do you feel KotH has to be deterministic? Any real life parallels aren't. Take chess/go AIs for example; some of the best in the world use Monte Carlo simulation, and won't play the same against each other every time. In general, it seems that most times serious AI doesn't use some elements of randomness are when the game played has been thoroughly solved and the best strategy is known.
If we force them all to be deterministic, then we might as well do away with any "average of multiple runs" or similar, since that wont matter. In addition, it makes it easier to game for later entrants, since they know exactly what will happen on every single run.
 
@Geobits It's not that the results have to be deterministic (e.g. if the answers use randomness), it's that I feel the challenge shouldn't implicitly prevent deterministic results. In your example, Chess and Go have specific deterministic rules.
 
The rules are deterministic, yes. But take the survival challenge. If the scoring program is initially seeded with a known seed, then wolves can all know exactly where they start, so they have the map in hand.
 
@Geobits An extreme counter example would be, say, a game where a random sequence of numbers was generated and the challenge was to predict the results.
That's true too.
In that case, I'd say, the challenge could be run multiple times, with different seeds, and the winner could be determined by the majority winner over all the runs. It's not perfect, but at least it gives every answer the same ground to start on.
The key there being not letting competitors know the seeds ahead of time.
 
@JasonC If the winner is different for each seed, how would you determine which seed to use?
 
In that case, what's the difference between just using clock time as seed?
 
5:19 PM
In other words, if you choose a seed that favors one submission, doesn't that skew the results?
 
@Rusher You'd have to make a judgment call depending on the nature of the challenge I suppose. E.g. if you ran it 100 times with different seeds each time and one of the algorithms won 95 times, you could define that as the winner for the purposes of that contest. You could also declare multiple winners if there was a tie, I suppose, if that makes sense.
 
Well that is a circular argument. How do you choose which 100 seeds to use?
 
@Geobits Well, in the 2048 challenge example, each competitor would have a different seed if the clock time was used. It's an odd case because the programs in that challenge don't directly interact.
 
I also wonder, if the seed is not known to the competitors, would we then be working on the honor system?
 
@Rusher The point is to give every competitor the same set of 100 seeds.
@Rusher Not if you published the seeds after the results were announced.
 
5:25 PM
I'd argue that if you chose the seeds randomly, the results are statistically going to come out exactly the same as if you had not seeded it at all.
 
@Rusher MAP_SIZE not yet implemented, but plannapus' R program is now ready to go. Ran my local test suite and it works quite nicely. Installing R is super easy, too.
 
Hmm. Have any KotH results ever been challenged by a competitor because of this, or is this just a theoretical issue that doesn't really matter?
 
@Rusher Would you argue that for a 2048 AI challenge with 14,400 total moves allowed (however many games that ends up being)?
@Geobits Not sure, actually.
 
@JasonC Would failed moves count?
 
@Synthetica Yes.
 
5:27 PM
@JasonC I would argue that. If the seeds are chosen randomly and the results are significantly different than unseeded, there is a problem with the implementation.
(or the chosen seeds are not actually random)
 
@Geobits By "unseeded" do you mean everything has the same seed?
 
Unseeded generally falls to time
Which is hard to predict
 
(quick question: does anyone know what KeyError: 'unknown symbol table entry'
's supposed to mean?)
 
Right, whatever the PRNG naturally uses if you don't provide a specific seed
 
q="eval(q)";eval(q) in python
 
5:29 PM
Is eval a built-in python function, or did you forget to define it?
 
@Rusher Python has a default eval funtion
 
@Geobits It's still a seed. The thing is, that's actually a bit of a counter argument. If you assert that a difference between results with "a randomly chosen seed" vs. "a default seed" implies an implementation error, then you also assert that any difference between any two seeds implies an implementation error. Which goes back to support my original point of "differing results between different seeds = invalid".
 
I mean, I understand THAT it crashes, but the way it does baffles me
 
@Synthetica Are you running out of memory? stackoverflow.com/a/19613644/752320
 
I think that a better improvement to the problem would be "If the results are different after each trial, we need more trials."
 
5:32 PM
@JasonC I understand it's still a seed. I'm saying that statistically speaking, "choosing" a random seed is the same as not providing one.
So over the course of many runs, you shouldn't see a large difference.
 
@Rusher That's a great idea. What about pick a seed, run the trial, repeat, say, 100 times. If there's no consistent winner(s), keep repeating until some winning threshold is exceeded?
 
That's not a bad idea.
 
I think the key word there, threshold, should go in the tag.
threshold or tolerance
 
But that still falls back to "different winners for different seeds" if you're using the same seed 100 times.
I think a better idea would be to separately generate 100 'random' seeds. If there's no clear winner, repeat. At least then you have a known list of seeds you can publish.
 
@Geobits Different seed each time is what I meant. Run the entire competition with one seed, then choose a new seed and rerun the entire competition, 100 times.
 
5:35 PM
@ProgrammerDan I added MAP_SIZE this morning. I don't know how I missed that. And suprisingly, only a couple of people missed it (or the rest weren't too vocal). I hope that knowing the size of the map won't confer much of an advantage anyway.
 
Ah, okay, then yes.
 
Just to be clear I'm referring to competitions where a random starting point is given, the "seed" I'm speaking of is a global seed used to generate the starting point for each competitor, so that each competitor has the same starting point on a given run of the competition.
 
@Geobits I also feel that answers should be deterministic. Yes, others may wish to run results many many times, but I think that it should be easy to order the programs in order of best performance to worst performance. If we allow non-deterministic behavior, it would vary depending on the number of times the tests are run.
 
@Rusher Sweet competition by the way, the wolves.
 
@Rusher Nice. Yeah, I actually had it as part of the spec initially, if you look through my git log. Then realized you hadn't implemented it, and removed it.
 
5:39 PM
BTW, do any you think a new version of the 2048 question would be a valid new question, if: 1. It allowed multiple languages, and 2. was seeded/deterministic?
 
Lunch time. I'll finish loading the submissions and post results this afternoon, promise. @JasonC Thanks for the compliment!
 
@Synthetica I would have no qualms about posting one. That is completely independent of whether or not it's actually "valid" and how it would be received, heh. For what it's worth, though, you'd have my vote.
 
@Quincunx Doesn't the entire contest then fall down to the seed used? That hardly seems more fair than a "best-of-x" approach to me.
To be clear: If my entry loses and I can change nothing but the seed it uses, making it a winner, how does that prove it's "better" in any way?
 
5:59 PM
Enjoy your weekends!
 
6:18 PM
@Rusher okay, MAP_SIZE updated. Now back to Twilight Imperium.
 
 
4 hours later…
10:26 PM
@Rusher Do you object to Scala submissions for your Survival game? I could provide a link to the compiled class and the scala-library.jar to include in the class path with my answer if you don't have Scala installed.
 
I'm already downloading and reading the manual for R, so why not Scala. Go for it.
 
Cool. I just need to come up with a better answer than the random one I have at the moment. :-)
 
Have you look at programmerDan's wrapper?
He made it pretty easy to communicate with just about any language. If you opt not to use it, just include some instructions for how I can add your submission.
 
I didn't think I'd need it because Scala runs on the JVM. I've got it working with your Game on my machine by compiling my Wolf and putting it in with the Java wolves. Then I just added the scala-library.jar to the class path when running the game. I'll include this in my answer and if it causes you problems, I'll look at the wrapper class.
 
Oh neat. However you got it working is good, just post it the instructions with it.
 

« first day (1162 days earlier)      last day (3688 days later) »