As you may or may not have noticed we are doing a series of Brain-Flak Birthday challenges to celebrate Brain-Flak's first birthday.
Some questions in this series are only tangentially related to brain-flak by the balanced-string aspect (and thats fine they're still interesting challenges). The...
Give counterexamples to thesis that prime numbers are finite.
It is known since antiquity that there are infinite prime numbers, first proved by Euclid. An unorthodox yet brief formulation of this proof was recently posted on MathExchange:
There are infinitely many primes, if not, multiply a...
I believe that much of the confusion on this issue has to do with the fact that different people have different definitions of the term "reference". People coming from a C++ background assume that "reference" must mean what it meant in C++, people from a C background assume "reference" must be the same as "pointer" in their language, and so on. Whether it's correct to say that Java passes by reference really depends on what's meant by "reference". — GravityJul 30 '11 at 7:23
What would your reputation be without the rep cap?
In this challenge, you will calculate what your reputation would be, if there weren't any reputation caps on PPCG.
Everyone can access the rawdata for reputation changes on the adress: codegolf.stackexchange.com/reputation.
The raw data follows...
def is_pk_p1(n):
p, k = max(sympy.factorint(n).items())
return n == p**k * (p-1) or sympy.isprime(n+1)
def is_in_totient_image(n):
if sympy.isprime(n+1): return True
D = [d for d in sympy.divisors(n) if d != 1]
e = []
e = {d for d in D if is_pk_p1(d)}
generation = e
while True:
new_generation = {a * b for a, b in itertools.product(generation, e) if a * b <= n} | generation
if n in new_generation: return True
if new_generation == generation: return False
Task
Given a non-negative number n sort n's digits by their first occurence in PI.
Rules
Submit a program or function that does the above task. Input can be taken via function or cli argument or STDIN. Output via return value exit status or STDOUT.
# This file is not used by the host name and address resolution
# or the DNS query routing mechanisms used by most processes on
# this Mac OS X system.
I'm not a palaeontologist either, just interested in dinosaurs and other creatures, and slightly less interested in evolution (if mammal-like reptiles evolved into mammals, then is it possible for mammals to evolve back into reptiles?)
@KritixiLithos back into "reptiles" won't/can't happen, but there's nothing really stopping some mammals from evolving into things moderately similar to reptiles.
Like how whales are mammals that were originally on land but went back to live in the water, etc.
I am planning to write an improved GolfScript for even shorter programs that can do more things. This is not a challenge; it is a request for feedback and tips on what I should do. (see tags)
I'm not sure if this should be Community Wiki. If you think so, just flag for a moderator to convert it ...
@Geobits I'm 99% sure it's not in their scope. I mean, how many of their common users would have had more than trivial experience with golfing languages? :P
I am currently working on a golfing language. Do you have any suggestions for it? What in your language of choice is helpful for golfing? What feature do you wish you had? Do you suggest variables, stack(s), tapes, registers, etc?
As usual, please post separate tips in separate answers.
Yeah. Maybe something more like what was asked in chat recently "Should stack based languages take string input in normal or reversed order?" or something.
Well, it may be easier to compare/contrast things in a single "essay" format written by one person. That's not to stop anyone else from offering their opinions, obviously.
There's no reason at all to limit it to one answer
And voting for the post rather than the individual options makes it less of a poll anyway.
But it actually might be narrower, since answers should pertain to the majority of languages, it leaves out all language-specific things, which are the majority of tips.
I am writing a golfing language.
Do you suggest variables, stack(s), tapes, registers, etc for storage in a code-golf language? What about implicit imput?
@KritixiLithos On a tape, values are fixed in place, so if you have e.g. [1,2,3] you can move to the 2 and change it to 0 (so you have [1,0,3]), where as in a stack-based language you could just delete the second item and end up with [1,3]