Fractal smoke
code-golf
Introduction
A229037 has a quite intriguing plot (at least for the first few terms):
There is the conjecture, that it might indeed have some kind of fractal property.
How is this sequence constructed?
Define a(1) = 1, a(2) = 1 then for each n>2 find a minimal posit...
@flawr it's not gonna be a competitive option, and making it mandatory distracts from the interesting part of the challenge (computing the sequence).
it also doesn't actually add anything interesting. if you want to make a challenge about generating scatterplots, then it should be just that, I think.
@flawr yeah, I've been meaning to split that up into substring and subsequence for a while, because using it for challenges about substrings is misleading.
but in terms of tags, I think code-golf, number, sequence, subsequence and maybe arithmetic would be good.
@CᴏɴᴏʀO'Bʀɪᴇɴ I meant more like string processing, pattern matching, array manipulation, ASCII art generation, arithmetic, complex arithmetic, geometry, graph theory, stuff like that.
I wonder if this would be fun: a code golf with a larger problem that requires 3 or 4 distinct stages of fairly different nature (some string processing, some arithmetic, whatever). answers can consist of multiple programs (in different languages) and you get pipes between those programs for free.
Given the ASCII art of two vectors, find the resultant vector's magnitude and degree.
Input
This can be received via STDIN, read from a local file, or provided through a function call. Here is an example of a two vector input:
^------>
|
|
|
x
This represents a change of 4 units north and ...
@MartinBüttner I can help you with general weaknesses of Jolf: Jolf is bad at almost nothing; that's the way I designed it. As thus, it will rarely be the shortest, but will often be amongst the shortest. However, iteration is really a problem. The only control structure is a while loop, and for loops can only be simulated by iterating over a range. Recursion is also hard.
but first.. would anyone who can write fast code like to do me a favour please? It's only a small favous :)
I would like to know if there exists a 14 by 28 circulant matrix with all entries +-1 where all the rows are orthogonal. There are only 2^28 such matrices so in theory this is doable but my python is too slow :(
@NathanMerrill I added a comment to the meta answer but I'm guessing it won't ping you - it's another point in favour of the extra meta discussion you suggested.
Python 2, 631 bytes
from cmath import*
C=input()
O,R=C[0]
def I(p,r,q,s):
try:q-=p;d=abs(q*q);x=(r*r-s*s+d)/d/2;return[p+q*(x+z*(r*r/d-x*x)**.5)for z in-1j,1j]
except:return[]
S=sorted
V=S(i.real for p,r in C for c in C for i in[p-r,p+r]+I(p,r,*c)if-R<=(i-O).real<=R)
A=pi*R*R
for l,r in zip(V,...
@MartinBüttner I don't know that there's one particular type of challenge that Japt is not so good at. I guess any challenge that could really use a built-in Japt didn't have at that point.
Oh, it used to be bad at challenges requiring getting the date, up until Thanksgiving when I added Ð.
And it's still bad at challenges requiring loops or timing, as I haven't implemented built-ins for those yet.
Brainfuck, 83 bytes
Open-ended bounty: If anyone can improve this score, I will pass the bounty (+500) on to them.
-[[<+>->----->>>+++<<<<]>++]<<+++++.<<--.>..<<.<<<----.>>+.<<<-.>>>>.+++.>>.<-.<<+.
Try it online!
The first 28 bytes -[[<+>->----->>>+++<<<<]>++] initialize the tape with the...
I feel like the test script just checks for the substring Hello, world! and the cheating ones throw an error in the BF interpreter that prints the source code
Python 3, 7306 Bytes
So before I start, I should mention that I did this late at night and didn't have time to turn the massive i method in the below code into something which is probably 3 times shorter. That is my plan tomorrow, so by no means is this final.
This solution runs in log(n) compl...
@MartinBüttner A token is "any sequence of bytes which, when one of the those bytes is removed, does not perform some part of the original operation". Thus for is a token in python because fr doesn't do something. An eval'd string of CJam operations is not a token because removing some byte from the middle of the string will still allow most of the operations the string describes to be performed.
@MartinBüttner Checksum won't break it because because the section of code still changes meaning even if it never gets run. Compression/hashing is not allowed.
Count the number orthogonal matrices
Call a matrix with all rows orthogonal an orthogonal matrix. We well only be interested in matrices where the entries are either -1 or 1. A circulant matrix is one where each row vector is rotated one element to the right relative to the preceding row vector...
@MartinBüttner This is hardly an uncommon restriction in restricted-source challenges. And you yourself said that atomic-code-golf is only good when the source is restricted. Now we just have to settle on how much or how little restriction is absolutely necessary.
@quintopia I didn't say it's good when the source is restricted. I said it's good when you define a language to use for the challenge that doesn't have those problems in the first place.
@MartinBüttner Now you're saying the same thing I am in different words, approaching from a different direction. You're saying "create a language by starting with the empty language and adding features until there's enough to solve the problem but not enough to break atomic-code-golf" and I'm saying "start with the language union of all programming languages and remove features until there's not enough to break atomic-code-golf"
@quintopia right, but "compression" or "hashing" is not a feature. I don't see how you can define these in an unambiguous manner that doesn't allow similar approaches that still break the challenge.
@MartinBüttner You don't have to completely disallow them. You just have to disallow enough that attempting to use them will result in more tokens than not using them.
@MartinBüttner Oh. I've never worked with the interpreters. I just assumed it would round up to the correct amount of digits by padding with leading zeros