« first day (1482 days earlier)      last day (3377 days later) » 

12:06 AM
It sounds like Oklahoma is up to some "brilliant" education reform.
2
 
@PhiNotPi If it makes you feel any better it takes 65 for Golfish because reduce/repeat don't work for the empty cases :P
 
By that, I mean cutting funding for AP US History.
@Sp3000 I'm trying to find a better way to do it.
 
0
A: Sandbox for Proposed Challenges

HSchmaleCode File Header Do you have a large number of source files that you forgot to put a header on, but never bothered. Well then this challenge is for you! This is code golf, so shortest program that works wins. The Challenge Write a function (if your language doesn't support this, write a progra...

 
1:08 AM
^ completely irrelevant GIF
 
1:33 AM
1
Q: Modular Robotics

theideasmith Introduction You are a roboticist designing the next generation of modular robots that self configure into various configurations, modeled after how birds fly together. You need to design the most efficient algorithm for switching all your robots from one configuration to another. Limitation...

Looks very interesting.
 
Hiw to pick m items out of array of size n..m is always less than n
 
Swarm robotics / modular robots are pretty cool.
 
@deostroll Hello, and welcome to the Programming Puzzles and Code Golf chat! Are you looking for general programming help? If so, you might want to ask a question on Stack Overflow.
 
2:24 AM
I'm googling to see how much microrobots would cost if I actually wanted a swarm of them.
The answer so far is: a lot.
 
3:16 AM
Hey, uhhh... when you see an answer like this. please flag it as offensive/abusive (it's not spam, it just links to Yahoo) instead of deleting!
Those flags have special properties that make moderating these situations much easier. (Also, 6 of them auto-delete a post and deduct the poster's rep by 100.)
(@xnor @aditsu @MartinBüttner, not trying to call you out or anything, but just a request. Thanks!)
 
got it
 
grc
why offensive/abusive rather than spam?
 
I doubt Yahoo needs any more advertising. ;)
(If it was some scammy site or whatnot, then yes, by all means flag as spam. But this is just random keymashing.)
 
grc
ah I see - didn't realise this was the policy
 
4:18 AM
I just found this: codebeautify.org
 
5:16 AM
Consider a set of N objects, one of which we will call K. Count the number of possible sequences where each element in the sequence is contained in the set, adjacent items in the sequence are different, and the first and last element cannot be K
I'm having trouble solving that problem. Specifically the last requirement (that the first and last element can't be K)
 
grc
6:02 AM
@NathanMerrill is there meant to be a limit on the length of the sequence?
 
ah, yes
too late to edit it though
 
6:25 AM
@Doorknob ok
 
 
2 hours later…
8:35 AM
@MartinBüttner Your devil's staircase has become a lot similar to mine now..
:P
 
0
A: Sandbox for Proposed Challenges

ThraxRandom distribution in array with exact number of occurences and max size Write a program or a function, that takes 3 inputs x y z, where : x is an integer representing the max size of each output array. y is an integer representing the exact number of occurence of each z value. z is a set of ...

 
8:56 AM
Ok, another question.
Given a sequence of integers, pick two non-overlapping ranges such that the sums of the two ranges have the greatest difference
 
Interesting problem :o can't say I have any ideas for an efficient solution, though
 
define 'range'
 
So, a range could be the indexes from 2 through 5, which means that the sum is sequence[2]+sequence[3]+sequence[4]+sequence[5]
 
I'm assuming range = contiguous interval?
 
yes
something that I've realized is that the intervals must touch
 
9:11 AM
If the intervals must touch then that makes the problem a fair bit easier
 
well, that isn't in the problem statement
but for the optimal solution, they have to
because if they don't touch, the numbers in the middle either needs to be added to one of the invervals
to increase the maximum or decrease the minimum
 
Hmm... what about [1, 1, 1, 1, -1, 1, -1, -1, -1, -1]?
 
assuming you have the two ends as the two intervals
moving either end to touch the other will never hurt
but will often help
so either the positive side moves over two or the negative side does
 
Oh I see
 
this doesn't seem too hard, should be O(N)
 
9:18 AM
the tough part is figuring where to start your interval
after placing the two intervals, you can greedily expand them
 
I would compute 4 arrays: left max, left min, right max, right min
then for each position check rightmax-lefthmin or leftmax-rightmin
 
what does "left max" store?
 
each array, and the final comptutation, can be done with one straight pass
left max[i] is the maximum value from some contiguous array that ends at position i
 
where does that contiguous array start?
 
anywhere to the left of i
err i said the wrong thing
it can also end anywhere to the left of i
 
9:58 AM
@MartinBüttner That was actually the easiest one to understand.
And certainly the easiest one to verify.
 
that's exactly what I said :P
 
10:33 AM
@PeterTaylor Yeah, I thought you'd say that. :/
Any suggestions for a reasonable epsilon?
@Optimizer Sorry, I still haven't looked at yours. Which one of mine?
 
the first one . but its okay, I myself was not able to shorten it , while urs was already 33
@MartinBüttner me too.
no way to shuffle in pyth ?
or GolfScript ?
 
Pyth seems possible, but just not an inbuilt way I don't think
 
so only J / APL can beat the 7 byte solution here
 
J and APL don't like 3-argument functions though
 
Oh CJam has a binning operator, interesting...
 
10:39 AM
binning operator?
 
@MartinBüttner 1/1024?
 
As in, distributing an array of size n into n/k arrays of size k
 
@PeterTaylor if you say so :D ... I have no clue ^^
still, wouldn't you need to know the PRNG's exact cycle length to determine this?
@Sp3000 ah right... well, I just thought of it as split by length
@Optimizer :) (re your comment)
 
You probably need to use well-documented libraries or methods which take an integer input.
 
Hm... split by length...
 
10:46 AM
@PeterTaylor That seems quite prohibitive. I'm sure there must be a lot esolangs which provide some sort of randomisation but no information about the PRNG being used.
@Optimizer I'm sure he got it by now...
 
@MartinBüttner I am gonna point it out at least 2 more time
 
11:01 AM
@Optimizer you can delete your comments on Thrax's sandbox post
 
11:16 AM
Hmmm on a scale of 1 to 10, how useful is filter?
 
11:27 AM
10
 
Ahaha k, guess it needs its own instruction then :P
(I seem to have implemented my map so that, for 4 extra bytes, it can filter)
 
oh that's fine then
I think if I had to filter manually in CJam that would be more annoying
 
Is there a way to do "if <condition>, pop"?
In CJam
Hmm <block> 0 * doesn't seem to give an empty block, damn
 
g{;}*
if the condition is a non-negative number
else !!{;}*
at which point you might as well do {;}{}?
 
So... 100,{_mp!g{;}*}% filters out the prime numbers from the first hundred nonnegative ints? More annoying indeed...
 
11:36 AM
after ! you don't need g
 
Oh signum, right
 
python native guys have it hard :P
 
So that's {_mp!{;}*}% (11) v.s. {mp}, (5), I see... (ignoring the fact that mp is a builtin, that could be replaced by any other expression)
@Optimizer How so?
 
i mean , trying to understand cjam
how so, i dunno. not a python native
 
Pssh I don't think that's got anything to do with anything :P
Just all the small details you learn as you use the language more, I think
Stuff like [\]
 
11:41 AM
@Doorknob could you superping CH and point him to the sidebar? I think my ping didn't work.
 
while you are at it, super-get-a-question him too
 
11:58 AM
What does [\] do?
 
Wraps the top two elements into a list backwards, apparently
a2^,Fspth

2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97
Woo filter
 
your code is imcomplete
a2^,Fspthreethousand
 
12:13 PM
That works too :P
 
@Sp3000 is golfish on github or somewhere?
 
@MartinBüttner its on SourceForge.net
 
@MartinBüttner Yeah it is, although it's called Teleporting Flatfish now because the 2D wasn't very useful :/
(I was having trouble getting map and such to work the way I wanted for empty arrays)
 
more like wrapping flatfish
how else can it teleport ?
 
. pops x and moves the instruction pointer to that x-coord
Also t teleports to the last bookmark set down
 
12:23 PM
:D
so befunge ?
 
It's turning into CJam x ><> now that it's 1D :/
 
teleporting ..
 
?
 
ugh.
teleporting is not possible in cjam
is it possible in ><> ?
 
Yeah, .
 
12:33 PM
oh ok
 
Pops y, x and jumps to x, y
I'm not sure why I use ><> more than Befunge, personally. Maybe the mirrors.
 
12:57 PM
Hmm. Unit tests would be good.
 
Some hope to beat Pyth in heatmaps
 
I was just reading your heatmaps answer as you were updating it :P
 
i still have the old one there
 
1:41 PM
Ok, I have another programming puzzle. You are given a set of pairs (X, Y). You need to pick a sequence such that both values in the pair are at least 1 bigger than the previous pair's values. In other words, if S(n) = (a, b), and S(n-1) = (c,d), then a < c and b < d. Your goal is to find the longest sequence
 
pairs cannot be separated ?
 
Construct a DAG then DFS? Think that works
 
or FTY and TYX
 
@Sp3000 yeah that should work
I think that makes it a bit of a duplicate (we've had longest path before... most recently with dictionaries)
 
how do you ensure that you find the longest path in your DFS?
@Optimizer yes
 
1:48 PM
Make each node point to the child with the longest sequence? If you want to recover the sequence in the end
There could be multiple starting points, but if you cache it I think it should be fine
 
Maybe I don't understand your DAG. Each point in the DAG is a pair that points to all of the pairs that are strictly smaller than it?
actually, its only O(n) to visit each node of the tree. However, I don't know of an efficient way to create the tree
 
Strictly bigger, since that's what you have in the problem
O(n)'s for nodes, but don't forget there could be up to O(n^2) edges (although I'm not sure if the ordering restriction helps with that)
 
@Doorknob how is that tips un-CW script coming along? ;)
 
so historically we will get rep ?
 
when the next site-wide rep recalc happens, I think
 
2:03 PM
that's a thing ?
 
2:20 PM
yes
once a year I think. although I'm pretty sure mods or at least devs can trigger it manually (at least for individual users)
 
@Martin I proposed a Retina PR for the Split limit: github.com/mbuettner/retina/pull/13
 
hm yeah that's similar to what I was going to implement
but all modes have one numeric parameter, so I was considering to handle that separately.
 
I see.
 
and I wanted to not hack this into the code, because I need to rethink the configuration string anyway
 
2:24 PM
for all the list-based outputs I also want to make the format configurable, which will break the one-char-at-a-time concept anyway
thanks for the effort though, I appreciate it. I'll definitely look at the code and see if I can reuse that
 
you're welcome!
 
since I just finished Guacamelee I might be able to spend some time on Retina tonight or tomorrow again ;)
 
My work has a bacon cook off tomorrow.
The same fat guy won our chili cook off, our queso cook off, and our cookies cook off.
 
Ah, Texas :D
 
2:35 PM
But I've got this one. I have duck in the freezer that I've been saving for this moment.
 
Duck bacon?
 
The criteria is that bacon just has to be in the dish somewhere
 
Oh, that makes a bit more sense :)
 
People are supposed to vote on the best dish based on taste, presentation, and how well bacon was used.
 
So does the guy win because his stuff is the best, or is it one of those good ol' boy things?
 
2:36 PM
So I'm doing mini duck kabobs
It's anonymous. I give it a name and Lorie lays them all out
 
Hmm. Well, I lived in Arkansas long enough to know that those "anonymous" entries aren't always as anonymous as you think. Good luck, though!
 
Well I always vote for his dish out of maybe ten dishes without knowing which one is his
 
So it is just that good? Nice.
 
@Geobits Also, thanks!
Yea, we had like 9 bland, watery chili entries and then his. It was a complete blowout
 
At most chili cookoffs I've been to, there's a bunch of mediocre, one or two good/great, and then one that some asshole decided to make the spiciest thing in the world, just because :P
 
2:40 PM
I just got a slow cooker last month. Along with my only large pot lol
 
Well, chili is easy enough to learn/experiment with if you don't do much cooking. It's hard to make it so bad that it's inedible.
 
I'm gonna guess and then see how close I was
Beans, hamburger meat, rotel, chili powder, and a giant ham bone just because
Doh, I forgot the onions. That was obvious.
 
Well you can use hamburger meat if you want..... but a nice chunk of round is better IMO ;)
 
Oh wait, no I didn't, rotel has onions.
Hmmmmm
Nobody uses bones in their chili. I'm going to experiment with this
The grocery store down the street will cut up cow femurs for me into two inch sections
 
I don't want to know how you know this.
At least you specified "cow" :P
 
2:45 PM
Vietnamese Pho takes bone marrow to make the broth
I'm dating a Vietnamese guy, and my Dad is a rancher, so this is not odd for me
 
That does makes some sense.
I've just never needed to cut up femurs, I guess.
 
You can buy "marrow bones" from most asian markets
But our Asian market sucks
 
Most Asian markets here suck. Except in bigger cities with a large subculture (esp out west), they're just terrible.
I never knew that until I got back from Japan and couldn't find anything I was used to. I just thought that was normal Asian groceries.
 
I guess Austin spoiled me. It's a bright spot
The asian market in Austin scared me though. I'd ask for sushi grade salmon and they would just nod their heads and grab something and if I asked if it was sushi grade they would just smile and keep nodding.
 
:D
"sushi-grade" doesn't really mean anything here in the US. It's not a regulated phrase.
 
2:52 PM
Really? What can I ask for that means "I'll pay more for fish that won't kill me if I eat it raw"?
I wonder how lucky I got doing that maybe ten times and never getting sick.
 
There's not much you can do except find a place you trust, to be honest. A lot of groceries (esp small ones) don't have the space or inclination to handle the fish completely separately to avoid cross-contamination. They just don't do enough volume to make it worth it.
The bright side is, the likelihood of getting seriously sick is often overstated.
 
I just thought of a sushi inspired code golf. Output a spiral of length n using only {'/','|','\','_'}
Seems complex enough right?
 
You'd think we'd have a "draw a spiral" golf already. Might be worth a search first, but sounds decent.
 
We have an actual spiral one
 
non-ascii?
 
2:57 PM
Yes
 
I know there's a number-spiral one, too, but that isn't the same.
 
So I think an ASCII one would be nice
  __
/  _ \
| | | |
 \ \_/
I'd have to come up wiht some solid rules on how to draw though
 
Yea, it might be harder to word it than show it. Stupid words.
If you want to make it a bit more complex, give another input for CW/CCW. (I only thought of this because your spiral looks backwards to me for no good reason)
 
I like that idea
This one looks a little more standardized. I think I can generate a rule set from it.
     __
    /__\
   //__\\
  ///__\\\
 ////  \\\\
 ||||  ||||
 \\\___////
  \\___///
   \___//
I hate that it keeps getting taller though
 
Definitely more standardized. Much less "pretty", though :P
 
3:07 PM
I'll fix it
 
I think if there's two types of challenges we'll never run out of it's "Print this ASCII art pattern" and "Calculate this OEIS entry"
 
u missed the "draw this thing" :P
 
"Print this ASCII art based on this OEIS entry"
 
Is this better?
     ________
    / ______ \
   / / ____ \ \
  / / / __ \ \ \
 / / / /  \ \ \ \
 | | | |  | | | |
 \ \ \____/ / / /
  \ \______/ / /
   \________/ /
     ________/
 
Much
 
3:11 PM
@Geobits hmmm :)
 
Yea, you're right
 
@randomra true, although I think the lack of symmetry makes this a bit more interesting
 
definitely not the same task
 
@Rainbolt maybe add a snail head to the bottom left? :P
 
3:13 PM
just similar ascii
 
I like the snail head idea
Errr...
But then it always has to end at the bottom left
 
or bottom right (if it turns CCW)
 
Yea, limits the possible n that way.
 
I figured the challenge would be much more difficult if you had to stop at an arbitrary n length
And no whitespace allowed before the leftmost character
 
Ha ha. I just earned the announcer badge for sharing a link to Standard Loopholes.
 
3:15 PM
oh I see
that would definitely make it even more different from the hexagon challenge
 
@Geobits I think because of your CW CCW idea I will post this. That makes it unique enough
 
@TheBestOne interestingly, no one has Booster for that yet
@Rainbolt CW/CCW is fun but I don't think that' the selling point
it's really just reversing all lines and swapping slashes, no?
 
I got Announcer on a Cop/Robber linking to the other half :/
 
@MartinBüttner Yea, I think so
I'll have to think about it for a while
I'm so worried about posting a total flop that I never post anymore lol
 
I like that n is the number of non-space characters as opposed to the number of turns. that makes it a lot more interesting.
@Rainbolt nah, I think this would be good
 
3:22 PM
I'd certainly do it if I was on holiday
 
3:41 PM
@MartinBüttner: So what's the point if I have to open a bounty on a question basically saying: "to win this, you've to comply to the specifications of this other question"?
 
@DavidOngaro Well no, that's not what I meant. If you put a bounty on the other question, you'll get answers using the ASCII format specified there. But I believe that such an answer should be possible to adapt without much trouble.
 
I doubt that, this is code golf so even a slight difference in output can make a big difference in the resulting program
 
Even so, I'm sure there are a hundred different ways to render a 7-segment display display in ASCII art, and it wouldn't really add anything new to the site to have another question for each of them. I realise that this is unfortunate in your situation, but I'm afraid this is what our current policies on duplicates are like. (Which isn't stopping anyone from casting reopen votes, though.)
 
Not to mention that the difference is not even slight here
 
The best thing you can do in the meantime is vote according to your preference on this meta post (or write your own answer)
that being said, I think this chat is a good place if you're looking to golf down a specific piece of code
alternatively, it might make a better question for main if you actually made it a question (although those usually have a somewhat smaller scope)
 
3:52 PM
It's worth pointing out that Martin's second voted answer is essentially the same as the number one answer with one major change: must be competitive.
 
It seems the most reasonable answer on the meta post is already on the top? (copy and paste possible, which is clearly not the case here)
 
well "with minor modifications".
 
I will misspell competetive until the day I die apparently.
2
 
that seems to be where we disagree, the modifications wouldn't be minor
 
it's definitely the subjective part of the policy, I agree
 
3:56 PM
Wow Martin ninja'd me before I even thought of something lol.
It's like he inserted his comment before two of my own after I was done typing them.
 
well a complete rewrite is certainly not minor, without arguing
 
So the burden is on close voters to prove that one of the existing answers can be ported without being completely rewritten?
Oh wait, you said without arguing. So you have proof that you are right.
Please share.
 
a complete rewrite isn't a minor change by definition
 

« first day (1482 days earlier)      last day (3377 days later) »