I personally think that answering a question you've VTC'd is generally not good, not necessarily because it's like a special case of bad practice but more so because there's usually no good reason you should do that.
5
as in, if you've voted a question closed, then that question has something about it that makes answering it a bad idea.
I'm going to write a program to find the odds of getting a Yahtzee (all five dice the same) assuming optimal play (after each of the first two rolls, keep the dice that appear most often). I estimate there are only about 2 billion possibilities that need to be searched.
I'm thinking it'll be around 1 in 250, any other guesses?
I'm 90% done with the brute force, so I might as well keep using that
1 in 193
0.5719%
That means any player can expect a Yahtzee about once every 15 games, and getting two Yahtzees in one game will happen to a player about every 500 games
@RedwolfPrograms the only club i remember from my school was the programming club that i cofounded with people i played league of legends with where we nominally prepared for a competition but really we just ate lunch in a closet while shitposting on a miniature whiteboard and then did well anyways because 80% of the teams were using java and had barely even learned it
I thought it'd be interesting to turn AoC day 3 puzzle into a Golfing Challenge, so here it is.
Task
Find the number of # you'd encounter in an 11x11 grid (consisting of # and .) that repeats itself (to the right side), starting at the top left corner, which is always a .. You will need to check ...
Isosceles triangle truncations
Most triangles are not isosceles. Here is an example:
A ____ C
| /
E| /
| /D
|/
B
However, we can cut this triangle into two smaller triangles, one of which is isosceles. We can do this in a number of ways:
By cutting from C to E, we create isosceles triangl...
I would like to pass a query in sql to a java list, I am working on this code:
public List<Foro> getForo () throws SQLException {
List<Foro> foro = new ArrayList<Foro>();
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT foros.id, foros....
Let's define how "controversial" a challenge (with net score ≥ 5) is by how close the ratio of upvotes : downvotes is to 2 (i.e. it has upvotes, so it's probably not a bad challenge, but it also has a substantial downvote count). What's your most controversial challenge?
@thedefault. i'm not afraid of revealing mine: write 3 functions that generate all edits (deletes, changes, inserts) for a given string using gather-scatter indexing
i think i can end up at least within a factor of 2 from your solution and thus save face :)
@rak1507 I've still got that section of the GCC manual memorised, even though I haven't done C for years, because I had to go back to it so many times.
Though I do know it well enough to know I wouldn't like it, except in the “write incomprehensible code” sense; it's a very nice language for obfuscation.
It is a whole new language stapled to Rust, for the sole purpose of manipulating AST in a not-quite-Turing-complete way, and they're planning to replace it.
@wizzwizz4 No, actual standard IPA isn't very precise when it comes to tone for English, though there are markers one can add that make it a nightmare to type.
@fomin as someone once put it: the best thing about computers is that they do exactly what you tell them to. the worst thing about computers is that they do exactly what you tell them to.
The nice thing about COQ is that if your program compiles, it's definitely correct. The ugly thing about COQ is that it's because your program definitely won't compile.
@rak1507 The point of that is exactly to show that English isn't a very good language, as here "twice" is used with two entirely different meanings. Repeat something twice or double the value of something?
It wouldn't work syntactically. How would the interpreter know if -{your code with def left operand} should use - as operand or apply it to the result?
Halley's Comet is the only comet that may appear (i.e. become visible to the naked eye on Earth) twice in a human lifetime. The orbital period of Halley's Comet is not constant: it has varied between 75 to 79 Earth years since the first definite apparition was recorded in 240 BCE. This variabilit...