Take a look at this image. Specifically, at how the holes on the ends are arranged.
(Image source)
Notice how the pipes in this image are packed in a hexagonal pattern. It is known that in 2D, a hexagonal lattice is the densest packing of circles. In this challenge, we will be focusing on min...
> Note that I am ignoring the additional pi units that the actual perimeter would be because I'm only looking at the circles' centers, not their edges.
Well the above example also has the same circumference as your 'valid' 8-circle solution (I know this one is not valid for your challenge, but just for illustration purposes=)
from scipy.constants import*
from numpy import*
n = input()
def s(n):
s = int(sqrt(n))
return s*s == n
if (arccosh(n/2)/(log(golden))).is_integer() or (arcsinh(n/2)/(log(golden))).is_integer():
if s(5*n*n - 4) or s(5*n*n + 4):
print "Travis"
else:
print "Lucas"
elif s(5*n*n - 4) or s(5*n*n + 4):
print "Ness"
else:
print "Pippi"
I was experimenting with numbers and I just found that the ninth root of 29809 is surprisingly close to pi. The ninth root of 29809.0993335 is even closer.
@El'endiaStarman I thought a bit about your circle challenge, I think I would have liked it even more if you did not requre to find an optimal solution, but rather come up with an own algorithm that tries to find a solution that is good enough and is then rated on how well it performs (so no codegolf, rather like an algorithm challenge or so=)
@flawr I had it in the Sandbox for three days and asked here in chat at least twice whether it should be code-golf or code-challenge. (Admittedly, you weren't around those times.) No one responded.
@quintopia Actually, I'm fairly sure that he does it by calling the interpreter "from the command line", so language updates are no more complex than swapping out programs.
@flawr Peter did give me feedback on that question, incidentally. :P
@Dennis Side note: updates with the language include class interaction. It's not necessary to add these. c: Does it treat them like files or like command line input?
Adjust your Chair
code-golf
Challenge
You just bought a brand new chair! Problem is, you have no idea how to control it so you'll need to write a program to do it for you.
You can only sit in the unadjusted chair for so long, so your code will need to be as short as possible, so you can qui...
Interestingly, there's almost a game you can play with this: figure out what Dennis named the file! ` in Vitsy reads the filename as defined in the stack and gobbles up its whole data and pushes it to the stack.
It also makes a three character cheating quine: '`Z, if the name of the file is Z`.
Restricted "Hello, World!"
The task is very simple, output Hello, World! to STDOUT. The thing that makes this different are the rules:
You need to provide a full functioning program, taking no input and outputting via STDOUT.
The program must not write anything to STDERR
The maximum amount of ...
3. Write a Seriously implementation for the chemistry class challenge
@AlexA. true... I have chores too.. like taking quizzes, have to do homework, and do some coding for some projects...
@AlexA. Also, it is a self-imposed task to do all these code golf things.. I like to solve challenges...
I am happy my Pyth answer for the chemistry challenge got 2 upvotes. I was hoping people could give me advice on how to golf it down further, but didn't get any.
@Mego comes later in the day? I have several Seriously questions to ask him. But I will just spend some time looking at the commands.txt
@TanMath That's what the inside of the minecraft mars base I'm working on currently looks like. The spawners on the left are endermen, the ones in the middle are creepers, and the ones on the right are blazes. That armor stand guy standing there is supposed to be an alien.
This is the cops' thread. For the robbers' thread, go here. (link coming soon)
Introduction
For this Cops/Robbers challenge, the cops will write output-producing programs and interweave them together. It is the robber's job to pick apart the cops' programs to produce the desired outputs.
Cop r...
This is the robbers' thread. For the cops' thread, go here.
Introduction
For this Cops/Robbers challenge, the cops will write output-producing programs and interweave them together. It is the robber's job to pick apart the cops' programs to produce the desired outputs.
Robber rules
Robbers wi...
I haven't studied Japanese since high school. I really want to learn Tatar but the only person I know who speaks it is my grandpa and he lives far away.
As in, its grammar rules have no special exceptions, there's no irregular anything, and there's generally only one possible meaning of a given sentence.
@PhiNotPi Well there's the problem with it. Because there are so many words missing, the community constructs new grammar expressions to reflect "modern" words. Those new constructs are barely regular.
Sig-fig calculator
As a scientist, sig-figs are definitely one of the most important parts of measurements and calculatations (unless you are a theoretical scientist, where everything must be exact!). Sig-figs is an important way of measuring uncertainty and accuracy of a value. To calculate the...
Sig-fig calculator
As a scientist, sig-figs are definitely one of the most important parts of measurements and calculatations (unless you are a theoretical scientist, where everything must be exact!). Sig-figs is an important way of measuring uncertainty and accuracy of a value. To calculate the...