@Sp3000 I was thinking pawn promotions and such, but I wouldn't go so far to require that the state is actually reachable with alternating moves from white and black
I'll set up rigorous rules for it, but the rules will be guided by "the board has to look believable"
so if there are two pawns in the same column but the opponent still has all pieces, that's weird. but I doubt most people would be able to see a board state and think "that's impossible, white must have made 40 moves, and black only 38 to get here!"
Are you running it from the command line or an IDE?
Eclipse at least is a pain with working directories. If you toss all the .class files along with the players.conf in a single folder, it should run from the command line fine.
Otherwise you could play with paths and settings :)
Yea, it's more important at the start of battle, and later on in the tourney. If you're fast(er) and can one-hit KO an opponent (due to bonus stats), you don't need def at all.
I have a capacity X, and a set of objects of A,B. I can carry the objects as long as the sum of all of the objects' A is equal to or under X. Maximize your sum of B
I think I'll probably just post that one today, and then work out the details for the others as I go along... I've got enough ideas lined up to be confident that I'll manage to find 8 ones that work well
@MartinBüttner Whoever downvoted it recently retracted (and possibly upvoted instead). It mysteriously went from 13/1 to 14/0 without me seeing a notification o.0
About the Series
I will be running a little series of code-golf challenges revolving around the theme of randomness. This will basically be a 9-Hole Golf Course, but spread out over several questions. You may participate in any challenge individually as if it was a normal question.
However, I ...
@Rainbolt in principle, I've intended it to be repeatable (once per person), hence the long time frame. But I'll stop doing it if I think people are trying to game it
It's just declaring ints and assigning only one of them. Not much different than your int g,j,i,x;, but since you only need them inside the loop scope, you can do it the init part.
My reading of the rules: 1) The range of random() is [0-1]. 2) I may assume my built-in generator gives me a uniform number from that range (regardless of the vagaries of FP).
Yea, Peter is diving into the workings of the PRNG and finding a flaw. And your challenge pretty much says we can ignore that flaw. What was the point of that rule if not for this case?
And what language has a PRNG that generates random numbers from a random range?
FWIW, I agree that in practice, nextInt() is more suitable. I used random() because the OP specifically stated I could assume it's perfectly uniform over the documented range [0-1], not perfectly uniform among the doubles [0-1].
@Rainbolt It is, but nextInt() rejects some to overcome the bias.
@Geobits Yes, this is the intended reading of the rules. The spirit of the challenge is to golf down an algorithm which is unbiased in principle, but not having to worry about the details of the underlying implementation of your language's PRNG.
@Rainbolt any that claim to be uniform. don't let the others confuse you :P
Math.random() generates a uniformly random double from a set of doubles which is a subset of the interval [0, 1). java.util.Random.nextInt(1) generates a uniformly random int from a set of ints which is a subset of the interval [0, 1). So if you're going to talk about intervals rather than ranges (in the sense of the image of the function), you still need to address the issue of what the image of the function is.
Why not just omit it altogether. Assume the distribution is uniform. (use this one) Assume the distribution is uniform over the interval. Assume the distribution is uniform over the range. Assume the distribution is uniform over the Foo.
wow, it really can't be that hard. I swear everyone in this room is perfectly aware of the intended ruling of this challenge. how it can be this hard to come up with an unambiguous meaning that no one will challenge?
@Rainbolt it's still ambiguous, because of the power of two thing.
what I'm trying to say, these fiddly details are not supposed to be a concern for this challenge. if I wanted to ask a challenge about creating perfectly uniform integers in an arbitrary range from Math.random() then I'd have asked about that.
@Peter I'm pretty sure it was you who said at some point that a good challenge isolates the problem in question. burdening people with these PRNG details is no better than having them parse their input for a fibonacci challenge from a partially invalid HTML page.
I don't think anyone has yet attempted the question in a language which doesn't have a built-in function to uniformly generate an integer from 0 to n-1 where n is a positive integer, so I don't see a burden.
The O(n) requirement is a bigger burden, because it rules out lots of esolangs.
@Geobits Alright, spit it out. Who did you make mad? What site?
I don't understand why this shift thing isn't working out. If I rotate the array a random number of times (between 1 and array Length times), it should have an equal probability of each element ending up in each position, right?
I'm obviously doing something stupid
Take [1,2,3] and randomly rotate it 1, 2, or 3 times.
@trichoplax for n = 5 you have (2, 2, 2, 2) in you solution set, I think that one is not possible. Furthermore you have (2, 2, 2, 1) and (0, 0, 0, 2) which I think are the same.
@DominikMüller good point - I can find out a fair bit without a visualisation. I'll try and track down how those incorrect ones are getting through now
@Lembik this means my answer is wrong and your question is safe...
@Lembik Ok, so the sequence starts with 1, 1, 2, 4, 9. After that I think 23, but I could have missed something. But so far I have no smart idea for a solution.
@Rainbolt it's not an exact dupe either. he doesn't ask us to find the input that generates the most words. he asks us to find as many words as possible in a given input.
@Martin Does the topic of your meta post include answers that depend on any of the previous answers, and not necessarily the one directly before it?
I was thinking that answer-chaining sounds weird because each link is only attached to the previous link
But "answer bubble diagram" is too long
Anyway, I wasn't sure what the topic was because there are multiple answers like "ordered" and "chronological" and they all imply that each answer depends on the one directly before it.
And feel free to let me know if you have no idea what I'm talking about lol
@Lembik That still gives larger numbers than your question requires. It means no two unit lengths of wire are in the same place. They can cross like an X as long as they don't share a path of length 1 or more