Maybe it's a holiday? The internet tells me it's not a holiday anywhere in the world today, but maybe your office has its own religious observances. Have you noticed any cultlike behavior?
Compute 30000 digits of the mathematical constant π, with the fastest code. Your code can only do integer arithmetic, possibly with arbitrary pricision. Any other form of representing a number in a computer are not allowed, including floating points, fixed points, rational numbers.
Implement in ...
Ok, my first golf question. Please be gentle :) I know there's way too many ascii puzzles :P but here we go.
The task is simple, use your favorite programming language to print a triangle ripple. The input should be the size of the ripple.
Example
When size is 1, 2 and 3:
______
__...
@Dennis Well, I was working on a similar boggle-board approach. Wonder how much difference can be between the two algorithms at the end. Mine does 1014 now, probably won't be much better.
The algorithm is fairly simple and I don't see much tweaking possibility so we might end up with the same thing.
@MartinBüttner, I've got a formula as a weighted sum of products, and my code does N=600 in about 2 seconds. The remaining tricky bit is reviewing the literature to check that all of the products are proven correct and not merely conjectured.
@Geobits I proposed a change to the tag itself (some of this has been absorbed by now I'm sure) and it circumvented the reflection issue by suggesting that you can only access files you created.
The King of the Hill tag could use a "Suggestions" section to help posters avoid pitfalls that are KotH specific. It could also use a tip on what does NOT constitute a KotH challenge, since I have seen newbies using it incorrectly.
Note that just because all submissions are competing against ...
Yea, I knew you'd brought it up somewhere, but I couldn't figure out which of your posts it was in (searching for 'reflection' didn't find it since it was in a comment).
# javac Main.java
# java Main
Exception in thread "main" java.lang.ArithmeticException: / by zero
at controller.Map.<init>(Map.java:31)
at controller.Game.<init>(Game.java:44)
at controller.ui.MainWindow.<init>(MainWindow.java:24)
at Main.main(Main.java:10)
Be as unlikely as possible with 66Â characters
Sentences in italics can savely be ignored.
This is not golfing for a living; this is golfing for your life!
In a post-apocalyptic future, you are a prisoner of the mad and evil Robot Emperor, who wants to play a sadistic game with you: You are fre...
@randomra It's what I'm most fluent in. I could it it in C, but it would take me a lot longer to write the code. But yes, the lack of local variables is a bit of a pain for this challenge.
Using CJam for your challenge was the right choice for me though. I have no idea how to solve the LCS problem in another language.
@randomra Just memoization. But I've never used memoization in another language, so I can either spend a good amount of time googling or just use the language I know.
@Lembik before i forget, why did you mention irc? did you have a channel recommendation or something? i don't think you followed up about that, and if you did then i missed your message
@MitchSchwartz actually I had two questions to ask you... first, I still can't prove Min_25's formula although it is clearly right. Do you think there is some automated way of guessing formulae like this given a lot of exact fractions?
i wrote it in python specifically because i was more interested in the high level aspects than the low ones. if it were the best known algorithm then i probably wouldn't mind putting some time into that, but given Min_25's work on j = 1 and his guess about j > 1, i think it is probable that a better method exists for j > 1 and am more interested in thinking about that, although i might not make any progress
Someone randomly decided not to show up to work today. Turns out he is married and someone knows his wife. He isn't at home, he isn't at work, and nobody knows where he is.
A peer of mine approached me with this challenge and I wasn't able to come up with an elegant solution. After discussing my approach, we began to wonder what the people at Code Golf would come up with.
Given
A processor that implements only two instructions:
STO <register>, <address> (store ...
Stuff like this is the reason it takes me so long to fix bugs lately. string[] roleNames = {"Administrator", "Manager", "User"}; // Before string[] roleNames = { "Administrator", "Manager", "User" }; // After
I'm going to invent an IDE that takes Stack Exchange ideals and applies them to coding. You need a certain amount of reputation in a project in order to make 2 character edits without approval.
I'll have badges too. Negative Coder (silver) - 1000 lines of non-autogenerated code deleted Black Hole (gold) - 10000 lines of non-autogenerated code deleted
Except that the people you are playing with are right next to you, so Be Nice and Be Professional are like automatically enforced (not something you get with Stack Exchange)
I don't understand why some questions get asked... I just answered a question on arqade that was "If I delete my saved game and start over, what will I lose?"
I can't name a game where you don't lose everything in that case, but I refrained from being an ass about it, mainly because I'm sure someone would find an obscure example :)
And I guess I'm trying to be nicer or something something.
I would answer with something mundane but that nobody else would figure out like "If you backed up your saved game before deleting, nothing. Otherwise, your saved game."
@Lembik i don't understand Min_25's proof in detail, but i wouldn't be surprised if for j=2 we can consider a 3d random walk instead of a 2d walk and then derive a formula
mbomb007's comment "I bet if you port this answer to C++, you can get a higher value of n." saddens me -- he ignores all the brilliance and only points out something obvious and uninsightful. idk
A little genetics lesson
When you only have access to someone's visible traits or phenotype, a pedigree of their family history is often used to figure out the actual genetic information or, genotype of each family member.
When dealing with simple dominance as we will be, a simple pedigree cha...
Rules
Original source file must compile to object code without error.
One ASCII character is added to source code to create a typo, increasing file size by 1 byte.
Compiler is run with default options. Necessary options like -c and -std=c++11 are allowed, options like -Wall are not.
Metric is
...
The net of a standard six-sided die can be visualized like this...
Here are two possible views of the die:
The challenge is to write a program that takes input and outputs or returns a truthy value if the given input is a possible way for a die to be oriented and a falsy value if not. The ...