« first day (1429 days earlier)      last day (3422 days later) » 

2:22 AM
I read as for a second and was confused as to why we had that tag...
6
 
 
3 hours later…
5:01 AM
I now present: Ostrich v0.1.0 alpha! (with thanks to bjb for helping me figure out how GitHub's releases work :P)
7
 
 
3 hours later…
8:28 AM
@PhiNotPi It's just a maximal pairing problem with the addition of the constraint that h must be paired. Maximal pairing is a well-studied problem; the constraint can be handled by iterating through the possible pairings with h and removing them temporarily from the set. It's still polynomial time.
Alternatively, this can be formulated as exact set cover. The universe to cover is the union of A and B; the sets which can cover it are the edges in the pairing, plus a one-element set for each element of B other than h, to allow for the fact that not every element in B needs to be paired. Then dancing links will find a solution quickly.
 
 
2 hours later…
10:28 AM
hello all
2
I have an idea for a challenge I wanted to pass by people
how about "count the number of triangulations". You are given the integer coordinates of a possibly concave polygon as input
 
10:58 AM
0
A: Sandbox for Proposed Challenges

nyuszika7hHappy Holidays! Introduction With the holidays upon us, I decided to make an appropriately themed challenge. Given a list of holidays and two dates, if the current date falls within the range when the program is run, output an appropriate holiday greeting. Challenge The preset list of recent ...

 
11:32 AM
@Lembik Is this fastest code? :P
 
@Sp3000 well..:) I think people should vote
what is your vote?
 
@Lembik Is the polygon specified or only the coordinates? That is, do you have to consider all polygons that could be made from the coordinates given, or just all possible triangulations of a specific polygon?
 
a specific polygon
 
If it's code golf, would just doing a basic recursion of making one triangle then recursing on the remaining polygon work?
 
@Sp3000 I guess so, although the "remaining polygon" may sometimes be more than one polygon unless you are careful to avoid that.
 
11:38 AM
Well if you put all the triangulations into a set then it wouldn't matter
 
That would allow you to reuse previous calculations then?
With concave polygons it would need edge intersection detection to avoid triangles that go outside the polygon boundary.
 
Oh, so you do need to do calculations anyway...
 
You could still recurse if each step checks the new potential triangle for correctness
Yes allowing concave shapes increases the complexity considerably
Sounds interesting with either shortest code or fastest code.
Presumably fastest code will favour more interesting algorithms - with shortest code I'd expect a brute force approach that simply creates the huge set including invalid solutions, and then culls them.
Could shortest code still lead to interesting algorithms if the number of points is sufficiently large? Or would it still be a brute force search with the culling done in progress to avoid surplus memory usage?
 
12:10 PM
@Sp3000 yes that would work but it's not so trivial
@githubphagocyte that is my view too.. fastest code is usually more interesting
:gi
@githubphagocyte although I would like to really make a joint scoring function. Where short fast code is scored more highly than long fast code
I suppose I also need some way to create random concave polygons
oh it's not too hard
15
Q: Algorithm to generate random 2D polygon

s5sI'm not sure how to approach this problem. I'm not sure how complex a task it is. My aim is to have an algorithm that generates any polygon. My only requirement is that the polygon is not complex (i.e. sides do not intersect). I'm using Matlab for doing the maths but anything abstract is welcome....

 
@Lembik I guess it would be difficult to settle on the right balance between speed and length without seeing the final answers in advance.
 
@githubphagocyte sadly you may be right
@githubphagocyte any suggestions?
I could just guess :)
I mean I know what the complexity of a good solution looks like
 
You could make length a tie breaker instead of a component.
 
then how to measure speed so there can be ties?
 
I'd probably just go with speed, although that means you have another challenge where you have to test entries yourself...
 
12:16 PM
Theoretical complexity's also an option, but I'm not sure how well that would work here
But there have been challenges which have done that
 
@Sp3000 I think someone smart will get O(n^3) quickly and then we are stuck
I also like it when >1 person adds an answer :)
 
Oh :/ damn
 
O(n^3) is not 100% trivial.. and I may be missing some log factors :)
 
Well if the lower bound is well known then that might be hard to use
 
maybe the score is the length * the exponent in the complexity :)
 
12:18 PM
Complexity also leads to arguments when someone submits something that's difficult to agree on the complexity of
 
@Sp3000 there is no lower bound that I know.. i just can't see how to solve it faster than O(n^3)
 
I like self evident winning criteria...
 
@githubphagocyte speed is a good proxy for theoretical complexity in any case
 
@Lembik Agreed - and a lot easier to agree on the measurement of!
 
maybe I can set a hard upper limit for the number of characters
or make it less then or equal to two times the shortest one :)
which could be fun
 
12:20 PM
Well I was basically thinking of this question
But yeah complex scoring might put people off
 
as people can submit shorter solutions to cancel existing ones :)
sort of a KoTH combined with fastest-code and code-gold
code-golf
@Sp3000 oh that's the same scoring function I mentioned!
 
Yeah :P
 
I like it
unless no one else likes it :)
 
If you can come up with good multipliers then it could work
 
what about my competitive idea?
make the max length less than or equal to two times the shortest one
and have it as fastest code subject to that
 
12:22 PM
@Lembik That's interesting but would invalidate previous answers which seems mean...
 
@githubphagocyte isn't that a KoTH model?
where there is a knock out element
or your score could just be the time * how many times longer you are than the shortest one
 
I don't think people would like their scoring getting worse without them doing anything on a challenge like this
But that might just be me
 
@Sp3000 or is it cops and robbers?
I thought you all loved competition! :)
 
What you described sounds more like KOTH
 
@Sp3000 ok.. I suppose I could address your concern by doing a code-golf one first
so at least that part is static.. but it sounds less fun :)
 
12:25 PM
:P well if you think you can pull it off, then go for it
 
@Lembik I don't think it counts as KotH as they are not interacting.
 
@Sp3000 I need my ideas pre vetted :)
I want answers!
@githubphagocyte ah ok
maybe I need a new tag :)
 
If you don't mind testing any solutions in dispute on your own machine to determine the fastest then my favourite so far is the fastest code.
 
speed-golf :)
@githubphagocyte ok thanks
@githubphagocyte the problem is that it encourages C answers
or fortran
which puts off some smart people
 
@Lembik Maybe post it to the sandbox and specifically ask for feedback on the winning criterion
 
12:26 PM
@githubphagocyte what do you think about a hard upper limit on size in that case?
nothing fancy
 
Which is why complexity*length could also work, without disadvantaging languages
 
@Lembik Whatever the winning criteria some language will be favoured...
 
But I guess that'd disadvantage C for being too long then
 
@Sp3000 true
 
I wonder if (size in chars)*(runtime in ms) could be a good scoring criterion.
 
12:27 PM
@githubphagocyte I suppose so.. I just don't know which language in this case
@IlmariKaronen that's what we are discussing :)
 
Ah, didn't read the scrollback. :)
 
@Sp3000 right.. I don't mind disadvantaging C a little as it might still be the best language
 
@IlmariKaronen You'd have to specify which machine the runtime is measured on but that could work
 
mine! :)
 
If you replace chars with bytes that might be interesting
 
12:28 PM
@Sp3000 can you explain that a little more?
 
(chars = Unicode packing for some languages, which isn't very fun)
 
ah
@Sp3000 are any of those languages fast?
 
OK, fine, bytes then. :) Or you could just insist on printable ASCII only.
 
I quite like what you suggested early on, of a strict limit on the number of bytes, and then fastest code wins
So "fastest code in less than 3000 bytes" or something
 
Printable ASCII + tabs/newlines could work. I'd mention APL but I don't know how fast that is
 
12:30 PM
@Lembik I don't know if there's a Unicode-packed front end for C, but it wouldn't be too hard to write one.
 
@IlmariKaronen ah!
bytes sounds better
 
@IlmariKaronen You'd better write it quick before the challenge is posted if you want to use it ;)
 
I'd imagine some sort of workaround would be possible in a lot of languages
I don't know many languages, but I've seen Python and JS do Unicode (also CJam, but I don't think anyone would want to do this in CJam)
 
@githubphagocyte Nah, sounds boring. I have been thinking of writing a GolfScript/CJam -> C compiler, though.
 
(Wish I knew more about C/C++/Java)
 
12:32 PM
@Lembik you could post the challenge to the sandbox and then add a comment for each winning style, and see which gets the most upvotes
That allows people to add extra comments for winning styles we haven't yet thought of too
 
that's a neat idea
but do > 1 people actually read the sandbox?
 
Post the link here. There are provably >1 people in the chat. :)
 
ok thanks
 
@Lembik lol yes
 
and thanks all
 
12:34 PM
bytes are better than characters, because otherwise you may get massive Unicode-encoded nonsense as answers. I learned about that recently, and it's a good point. APL characters actually count as bytes because of the historical character set (unless you use Unicode characters in the program), so that's pretty fair
 
bytes it is
 
@IlmariKaronen NewMetaPosts automatically updates chat with Sandbox questions
 
@IlmariKaronen The link comes here automatically shortly after you post to the sandbox
 
ok thanks
 
@nyuszika7h That's true. On the other hand, counting bytes encourages unprintable code that has to be posted as a hex dump. I personally like "printable ASCII only", but then that's unfair to APL... :(
Of course, we could just tell all the APLers to write in J instead. ;)
 
12:40 PM
how about something like "printable ASCII only, unless your language heavily utilizes non-ASCII characters, like APL"?
and then we'd probably want to make sure that only ASCII and APL's character set is used for APL
 
@Sp3000 snowflake ran out of memory again :/
 
Ah... damn D:
 
looks like even with Rasterize it tries to build the vector graphic first
and apparently 120k point primitives require a lot of memory
@user23013 thanks for the comment on the battleblock challenge, I was afraid something like that might be the case. I was actually considering to just limit it to 3 blocks, but I need to figure out if hardcoding all solutions is actually shorter than solving it in that case.
 
1:00 PM
@MartinBüttner The solution is trivial for three blocks, e.g. for 142 the solution is 2-4, 4-1-2+4, 1-4
Basically if the three blocks are X,Y,Z then Z-Y, 4-X-Z+Y, X-Y
(If I did my algebra right)
 
I don't understand your notation, but yes, the problem is pretty simple for 3 blocks.
 
Er, notation is number of times to toggle the block. Should probably have said that
Because e.g. if the first block is X then you just need to solve (number of toggles for first block) + (number of toggles for second block) + X = 0 mod 4
 
you never need to toggle the second block though
 
?
Say we have a solution where we toggle the blocks A, B or C times respectively. Then we're solving A+B = 4-X (mod 4), A+B+C = 4-Y (mod 4), B+C = 4-Z (mod 4)
Oh they just have to be the same level
Well in that case you can replace 4 with any other constant :P
 
1:16 PM
hi @MartinBüttner
 
1:38 PM
hi
@Sp3000 as I said you don't ever need to touch the 2nd block in the first place
 
Yeah I forgot it can just be any level. But the solution's still simple - Z-Y % 4 times for block 1, X-Y % 4 times for block 3
 
How about n blocks, and a length (n-1) binary string for each one, indicating which of the other blocks it increments?
 
@Sp3000 yes
I think the n>3 case is interesting enough as it is, no?
 
Probably :)
 
I think n > 3 is fine, even if it's just any solution :)
 
1:43 PM
can you confirm with your tool that there are no solutions for some n=5 inputs? I suspect 21111 to be such a case
 
Just fixed it a bit now and yeah it returned nothing for 21111
 
k
should I exclude n = 2 mod 3 or include the requirement to output if no solution is possible? the latter is probably better
 
You could either require that the code identify where no solution is possible, or you could specify that output is undefined if there is no solution.
 
According to Github, Ostrich 0.1.0 was released approximately 4 hours before that challenge was posted
 
XD looks like sjoelen's becoming a testing ground for new languages
 
1:59 PM
@githubphagocyte that was exactly my question :D
 
@MartinBüttner Oops... :)
 
@githubphagocyte btw, the generalisation that would actually make sense in the context of the game, is to not have a string of blocks, but a grid (where some cells might not contain a block), and each block toggles all adjacent ones
because you can build that in the level editor
(and you could only toggle blocks which have a free side)
 
@MartinBüttner Sounds like I need to look at the original game...
 
lol
in the core game it doesn't actually appear with more than 3 blocks (and only 3 or 4 times), but it does come with a level editor.
 
I think printing if there's no solution should be fine
To differentiate from if the solution is toggling no blocks
 
2:06 PM
yeah, I'll allow any (consistent) output for unsolvable inputs, as long as it's distinguishable from any potential solution (including toggling no blocks)
 
0
A: Sandbox for Proposed Challenges

WrzlprmftPrint rotation-safe numbers codegolf numbers Background You are working for some board-game manufacturer and need to produce wooden tiles with the numbers from 0 to n engraved on them for some game. However, some tiles would become indistinguishable, e.g., 6 and 9. To avoid this, you have to e...

 
Ah, consulting :)
Speaking of Mathematica I'd like to see that golfing language of yours :D
 
I wouldn't
 
:(
 
I don't mind golfing languages like GS or CJam, which just stand on their own and use a paradigm that's really useful for golfing. But I really don't like stuff like Pyth, which just takes a language and replaces built-ins and keywords with single characters and removes superfluous syntax.
 
I see...
 
2:53 PM
of course, mathematica is the language with the most number of built in features
 
in that particular case it didn't actually use anything fancy though
 
dot product ?
 
I'm sure most maths-oriented languages have it
 
add a single number to each element of an array
 
(matlab, octave, r)
likewise...
 
 
1 hour later…
4:08 PM
I updated my proposed challenge to require one specific format, I think it's unnecessary to support so many formats when you can't even use a library for it
2
A: Sandbox for Proposed Challenges

nyuszika7hHappy Holidays! Introduction With the holidays upon us, I decided to make an appropriately themed challenge. Given a list of holidays and two dates, if the current date falls within the range when the program is run, output an appropriate holiday greeting. Challenge The preset list of recent ...

 
 
1 hour later…
5:26 PM
@MartinBüttner I'd always thought that Pyth was a golflang that "compiled to" and was inspired by Python. Not at all different from GS or CJam...
 
gs cjam are completely different languages
not like any other
 
GS and CJam are stack-based/postfix-notation where Pyth is prefix, and all were designed with brevity-at-all-costs in mind.
 
gs is not a minified version of any other lang.
 
Would a language design contest be of any interest? Is there a straightforward way of setting a challenge and then competing to design the language that can best golf that challenge?
 
The trivial language which solves problem X with the null program mapping STDIN to STDOUT kinda breaks that idea.
 
5:32 PM
Would requiring it accept more than one potential input get around that?
 
Can be more explicit about "more than one potential input"?
 
Or would you then just define the language to give the required output for every input?
 
@algorithmshark you don't get it. The spec of GS is not derived frmo any other language, while Pyth is just Python with minified literal and function names
 
@Optimizer I never made the claim that GS was a minified anything. I just stated that the goals of GS and of Pyth were not dissimilar.
 
I meant that the program has to take input and give output - but I see what you mean now - the language could just be defined such that null source code takes the input and gives the output as required, for arbitrarily many different values for the input
 
5:35 PM
"Not at all different from GS or CJam" does not sound like you are comparing just the goals.
 
Okay, point taken. I meant in the sense of "all were designed with brevity-at-all-costs in mind."
 
Is there another way of phrasing a language design contest that doesn't suffer from that trivial solution?
 
If you can think of one I'd be interested in hearing about it.
 
If you specify a problem space the language has to excel at, then the language mapping strings as short as possible to the solution of those problems is the trivial winner.
If you try to say that the language has to have some intuitive interpretation in the sense of every other language we've come up with, then that's fraught with ambiguities.
 
5:42 PM
What about competing based on shortest average code length over solutions posted to future challenges? Say, 10 solutions to challenges over the next month?
Only challenges posted after the last edit to the answer containing the new language count
(and the challenge cannot be posted by the same person that posted the new language design...)
I'm happy leaving it open so that people are free to design arbitrarily opaque languages - that leaves them at a disadvantage when trying to find 10 challenges they can work out how to solve.
Or maybe it could be open-ended rather than just the next month. So that each time a solution is posted using the language, it's original post is updated to show its progress so far.
 
That's an interesting thought, but I don't envy the person tasked with organizing that.
Also, it would take a while to see any results.
I think perhaps PPCG itself is already a challenge of that nature. If you design a golflang, you get to pit it against every other language in problems of your choosing.
HQ9+ would have an astounding track record, in that case :P
 
5:59 PM
@MartinBüttner updating connection points is also not that straight forward ;)
 
 
2 hours later…
8:06 PM
@algorithmshark That's a good point. It doesn't need a question here.
 
8:34 PM
@Optimizer I noticed...
 
8:44 PM
@Sp3000 ^
I wonder if it's just this run or whether they'll all look rather regular for 10k particles... I'll do some more runs over night
 
its depends on how you choose your particles' starting points
is it uniform distribution ?
also, what length do you discard a walk ?
 
they all start way out on the x axis
 
(also,, higher resolution pic ? )
 
I don't discard walks
@Optimizer what resolution would you like? :P
 
new year's
 
8:47 PM
...
 
ok . 4 K ?
 
Are the particles all released one at a time (after the previous particle has attached)?
 
or 5
 
@githubphagocyte yes
@Optimizer actually what for, you can already see individual particles in that image
 
I'd like to see what it would look like releasing a block of them along the x axis all at once, but I guess keeping track of them would mean a slightly longer program?
 
8:50 PM
@githubphagocyte would they combine before attaching to the main tree?
 
@MartinBüttner I'd have them only attach to the tree, not to loose particles.
 
@MartinBüttner so in a brownian tree, a random particle is started at a random point , it walks until it reaches a white pixel (in this case) . If this walk is short enough, it is drawn, else, discarded
 
It does give the possibility of the tree growing through several particles at once if a particle moves to suddenly connect a string of others to the tree
 
@githubphagocyte I don't think it'd be much different, except that you would fill more holes
@Optimizer I start at a fixed position, and I don't discard any walks
 
@MartinBüttner and that is why, the positioning of these random particles matter.
@MartinBüttner so how does your tree grow ?
when do you branch out ?
 
8:52 PM
I'm assuming that particles are constrained to stay the right side of the x axis, so that every path eventually reaches the tree?
 
branch out?
@githubphagocyte they are constrained to stay in a 30 degree wedge from the x-axis, as specified in the challenge
 
Are you making the particles reach the tree or originating branches out of a tree ?
 
also, I never move them away from the origin, (along x), which is why I don't need to discard walks
@Optimizer the former
 
@MartinBüttner And they can't wander off to infinity because - ah - you beat me to it :)
 
@MartinBüttner so not discarding walks is your issue
 
8:55 PM
@Optimizer why do I have an issue? o.O
 
You might get more variety in structure if they were permitted to move away from the origin but only a certain distance. Then branches could grow in 3 directions instead of just 2.
 
if you do not discard, at higher particle numbers, you get uniformly filled regular hexagon
 
@Optimizer The particles are not started inside the tree - they are outside it and have to move towards it, so the gaps never fill
 
lets say, if your randomly created particles have a pattern (circular/triangular etc), and then if you discard longer walks, you can get nice patterns in your final image.
@githubphagocyte I know. uniformly filled, but still having holes only
 
@githubphagocyte oh that's true. although I doubt the fine details would affect the overall shape much (and be noticeable for 10k particles)
 
8:58 PM
@Optimizer I'm not sure if we're talking about the same thing. Even with arbitrarily long walks, if the particles always start at a large distance from the tree then as the branches grow closer together the growth rate approaches zero in the regions they have fenced off.
 
I think if I just move the starting position further in, it will give more bias to the x-axis again
the maximum coordinate that got filled was about 340, and I started the particles at 4999
trying from 999 now
(which also much faster)
 
@MartinBüttner You could also allow 4 directions by limiting the particles in x and y directions. I would expect that to give a sparser tree as branches growing towards each other in both directions can cut off regions faster.
 
"allow 4 directions by limiting the particles in x and y directions", I don't think I understand what you mean by that
 
@MartinBüttner I mean the particle can move up, down, left or right, and is not permitted to move past the upper limit you set to the right or to the top (you might not need a limit to the top if the limit to the right prevents getting around the initial tree).
 
ah I see.
wow, the result for starting at 999 is very different.
 
9:08 PM
Ooh - let's see!
biased outwards?
 
I think I'll get nice results somewhere in between
 
ah - biased inwards
 
too biased
a nicer looking snowflake would have 12 sides
6 major, 6 minor
 
well it does, but the minor sides are very minor :D
 
make them major-minor
 
9:13 PM
I was thinking of an initial line as the starting tree, but it's just a point, isn't it? I might have to try this in python to see what happens (even though it won't be any good for the question).
 
yes, it's only the origin
 
9:24 PM
starting from 1999:
I think I just generally like the 1k particle flakes better
 
9:37 PM
ugh, I've got an almost working ~90 byte solution for the graph construction (which is still very golfable), but representing an empty matrix is giving me headaches...
 
I have got 72
so u have catching up to do
 
yeah, I think I might just drop it
 
also that APL looks wrong :P
 
does your new code also use an adjacency matrix?
 
i dont know terms
(not from a CS/maths background)
 
9:41 PM
are you using a matrix? :P
(in this case, square with one row/column for each node)
 
umm, no ?
let me fix this final glitch and post it
 
okay, nevermind then
okay, got mine working
at 99, but there's a lot to be golfed
 
75
now that my code is there. Am I doing what you asked ?
 
I'm not going to try and read a 75-character CJam program :D
 
its fairly easy
;)
 
9:55 PM
Is this 75er the longest CJam golf outside of things that require encoding data?
 
I don't think so
 
Like, Kolmogorov complexity-type challenges, I mean.
Oh? What is there that's worse?
 
yeah, we can easily base convert 75 to get around 60
 
oh, your question was something else
@algorithmshark remember that my initial answer was 129 bytes long in that 75 one itself :P
 
9:59 PM
Initial answers in long golfs are always liable to shrink immensely.
 
immensely only if you change your algorithm
3 more bytes to APL!
done!
Netlogo is prettty slick language (at least wrt this challenge )
 
I thought this was a cool problem so I challenged myself to do it without looking at any of the existing answers. I wrote a fairly short program and then spent a while making it shorter and shorter. I felt proud and finally posted it, and now that I'm letting myself look at other answers I can see one in the same language that's 89 bytes shorter. :P
 
10:14 PM
the instructions must be under the ground
@MartinBüttner your code has too many {}?*s
 
Oh no, I wrote a J solution for the graph golf and I have to debug the empty list case...
 
is empty list so hard ?
 
Not in this case, as I just found out, but in general APL and J arrays can be empty along any dimension.
 
oh!
 
E.g. you can be empty in the rows, or in the columns, or both.
It's no coincidence that APLers tend to take great delight in writing empty array jokes: jsoftware.com/papers/eem/Empty_Array_Jokes.htm
 
10:35 PM
i don't understand a single one of those jokes :P
 
@algorithmshark didn't get the last one
ok, only got the first one
 
Yeah, I can't remember where the page with all the good empty array jokes is.
 
11:03 PM
@Optimizer And even 75 is way too many.
 
its 61 now
but what is your algorithm ? o.O
I wonder if anyone would understand anything reading the ungolfed version :D
 

« first day (1429 days earlier)      last day (3422 days later) »