« first day (1493 days earlier)      last day (3333 days later) » 
02:00 - 18:0018:00 - 00:00

2:42 AM
randomra's challenge inspired me to try Collatz in Prelude ^^
?1-(1+       1vv+++ 1-  1-)
      ^(1- )^  #   (2-))^!
        1v-#1#   )(#
         # ^(#
I don't think I'll go for his challenge with it though :P
(partly because this relies heavily on the divisor being 2)
 
@MartinBüttner If there's a language called Prelude, is there a language called Fugue?
 
yes
it's Prelude, but encoded in a midi file
we definitely need oneboxing for esolangs.org
 
found this gem: esolangs.org/wiki/…
PPCG is like the #1 consumer of esolangs
 
doesn't even sound as bad as it could
 
It could have sounded really bad, but some parts were actually not really bad.
 
2:53 AM
is PPCG strictly for challenges or general golf-related questions are allowed too?
 
what... uh... esolangs.org/wiki/2L
@randomra like what?
14
Q: Let's decide what kind of non-challenge questions we want once and for all

Doorknob4 reopen votes and 1 delete vote is a strange thing to see. It's also slightly worrying that we have so little consensus on this matter. So let's bring the community together. What kind of non-challenge questions do we want? Each answer will contain one type of non-challenge question, some ex...

 
I remember a Doorknob meta post that its allowed but I don't really see any
will read, I remembered another one :)
 
13
Q: Re-evaluating [tips] and tip-like questions

DoorknobCurrently, all tips questions on the main site are Community Wiki. Furthermore, there are not many other non-challenge questions on the main site. These types of questions are generally supressed on PPCG. This should change. The first point I'm going to attack is the fact that tips questions ar...

?
 
there's also
7
Q: Where should non-challenge questions go?

DoorknobI have a question about programming puzzles or code golf, and it's not a challenge for others to solve. Where should I post it? Return to FAQ index

 
still not that, will look it up
@MartinBüttner neither that :)
 
2:59 AM
My code for randomra's Collatz is too long :( need a better way of standardising the cycles
 
hm, I'm still trying to figure out a good way to annotate Prelude source code
my newest attempt
?1-(1+                                            vv++1+                  1-                         1-)
                          ^(1- )                 ^ #                    ^(2-)                     ^!
                            1v-#                1#                     (#    )
                             # ^                (#      )

First, we need to         Copy the current      If the value is odd    Else, divide by two.       Print the current value
decrement the current     value to the next     multiply by 3 and      This division code         and decrement before the
 
Horizontal scrolling is icky though
 
horizontal scrolling? are you on 1024x768? :P
 
I read 'Re-evaluating [tips] and tip-like questions' which is the older one and the other is much clearer so only 'competition-related' questions are welcomed
based on the 'Let's decide what kind of non-challenge questions we want once and for all' post
 
Well, considering answers are 728px wide.
And that most programs will probably be longer.
 
3:03 AM
oh
you meant for answer
no that's just for me
a properly golfed prelude answer can't even be exploded like that
 
Heh, okay
 
or more like... it can be exploded but it won't necessarily keep working
which is why my recent prelude answers do explode the code but in separate snippets
the above is actually still a working program
 
@FUZxxl sorry, didn't noticed your J code (codegolf.stackexchange.com/a/47224/7311) before posted mine
 
(with the comments in there)
that hello world for prelude on esolangs is way too long...
 
Is there a pure Hello World challenge on PPCG?
 
3:14 AM
I'm sure there is
 
PPCG is all.
 
hm, doesn't look like it
but without all the weird restrictions we've put on it in the past, it would be a rather boring challenge in non-esoteric languages
 
The shortest Hello World program is known in most normal languages.
 
They all seem to have slight restrictions... From the ones I remember
 
managed to shorten the hello world from 129 to 100
I think there might be an even shorter way (especially with multiple voices), but I don't really understand the second half of the code
also lol... in 3 cases where there's a choice for the order of multiplicands, the code loops over the larger number adding the smaller number in each iteration
I wonder whether a Prelude string printing (code generation) challenge would be even more interesting than "minimal Prelude numbers"
 
 
2 hours later…
4:58 AM
Oh, I found Python 3.5.0a1
... it doesn't have the [*x] syntax yet :(
 
grc
new operator though :o
 
I think that's only for numpy and stuff
 
grc
oh
 
Yeah, somehow I wish some of numpy's features were in vanilla Python
x[:,0] would be pretty cool
 
grc
x[x<0]*=-1 etc. would be nice too
 
5:10 AM
What does that one do?
 
grc
it's like np.where
index part of an array where the condition holds
 
:o
 
grc
actually that doesn't even work
weird
x[x<0]+=1 works
@Sp3000 wow this looks awesome
 
That's exactly what I've been waiting for D:
Even in the golf I just posted I could save a few bytes by set() -> {*}
 
6:04 AM
I need two people to each give me a random word, and I'll try to make a challenge involving both.
 
random in what sense?
 
Bookkeeper?
 
6:25 AM
sexbobomb
 
The Sexbobomb Bookkeeper challenge ... great.
 
D: mine was a serious suggestion!
 
"We are sexbobombs and we are here to make you feel sad and think about death and stuff"
@Sp3000 so was mine
this is the most random word I can think of
(and I am sure no body got the reference yet)
 
Sure can't deny that :P
 
which part ?
 
7:14 AM
@randomra It's okay. Your approach is nicer than mine.
 
 
1 hour later…
8:25 AM
regex gurus .. match a string if it does not contains XYZ ?
ruby flavor
 
8:51 AM
In my phone so I can't test, but I'd imagine something like ^((?![^XYZ]).)*$
 
@Sp3000 yeah, that works :D Thanks!
 
grc
^(?!.*[XYZ]) maybe?
not sure about ruby though
 
(except for making [^XYZ] a (XYZ)
 
Actually ^[^XYZ]*$ might be simpler
Wait is XYZ a string or three chars?
 
a string
 
8:57 AM
grc's without the square brackets looks like it should work too
 
grc
wait nvm
 
:P not quite
 
grc's wont work
its only one side lookahead
 
Hm? I just grabbed my laptop and it seemed to work on regex101
What does it fail on?
 
ah nvm
 
 
4 hours later…
12:42 PM
@Optimizer I did
@Calvin'sHobbies If in doubt, Jabberwocky
 
too late
 
do the words have any particular length or letter distribution? or what sort words? nouns, verbs, adjectives?
 
@MartinBüttner did you like it ?
@MartinBüttner "random"
 
sure
@Optimizer then he should take word list and let his computer choose at random
 
sure
 
12:57 PM
CarpetPython's challenge looks hard
 
i did not even understand it
what are those numbers .. what is a rod here ..
It can need better explanations
 
yeah I had to read it a couple of times
basically, picture the numbers describing the heights of hexagonal pillars, like so:
bloody hell
and then the question asks how much water will be held on top of the hexagons that lower than their surroundings
so in the first examples, there will be a column of water of height 2 on top of the 01 rod, such that the water is level with the 03 rod.
 
This almost sounds hard enough on a square grid :P
But thanks for the explanation
 
@MartinBüttner ah. so that is the ground height configuration
(a simple term like that would have cleared things up :) )
and those are tiles. So where no number, its an infinite hole to the other side of the Earth ?
 
well, except it's just a little sculpture, yes :P
 
1:06 PM
you should be able to do some Mathematica voodoo to get a good 3D blueprint from one smaller example :P
 
I was actually considering that
let me see what I can do ;)
 
"sugar", "spice" .. and "everything nice"
 
Hmm on second thoughts this might not be as bad as I thought
But hex grid D:
 
on a square grid it wouldn't be too bad, yeah
 
1:27 PM
pulls out hex grid code from kingdom builder
 
creates a hex grid flood fill template in CJam
 
how is this
 
pretty clear
can you make a gif of rainfall and then water overflowing over the 03 block ?
:P
 
..
@MartinBüttner I challenge you to solve this question in Retina
 
1:33 PM
arithmetic that isn't in unary isn't much fun
 
why will someone upvote that comment ? o.O
 
Maybe someone else would like to know about such challenges too?
 
1:56 PM
does anyone have some feedback for the prelude syntax checker proposal in the sandbox?
0
A: Sandbox for Proposed Challenges

Martin BüttnerPrelude Syntax-Checker code-golfstringsyntaxprelude Prelude is an esoteric programming language, which has very few, but unusual, restrictions on what constitutes a valid program. Any block of printable ASCII text is valid provided that: Every column of text contains at most one of ( and ). I...

 
If I knew what the "outer edge" was in that hexagon challenge I would attempt to solve it
Finding the outside is tedious
 
In Python I tried doing that with a try/except
 
Oh wait... I missed the "missing rods are holes and do not gather water"
 
(had to be careful with the -1s though)
@MartinBüttner How many languages you know have a quick way to check matched brackets?
Apart from using regex
 
on a single line?
 
2:03 PM
Yeah
 
none that I know of
I just know a few regex flavours that can do it
 
Because it seems like once you check the column condition then you can collapse them all to check matching
 
Here's a bunch of non simple answers: stackoverflow.com/a/6709333/3224483
By non simple I mean "doesn't have a built in"
 
yeah, that's way more than necessary in this case though
you only need to check parentheses and can ignore all the others
 
2:12 PM
Hmm, well I don't see any problems :)
 
nice :) ... I'll post it in half an hour if no one complains or finds any problems
 
2:43 PM
0
Q: Prelude Syntax-Checker

Martin BüttnerPrelude is an esoteric programming language, which has very few, but unusual, restrictions on what constitutes a valid program. Any block of printable ASCII text ("block" meaning that lines of printable ASCII are separated by newlines - 0x0A) is valid provided that: Every column of text contain...

 
2:56 PM
hey, I was thinking about if statements
what's the difference between them and jump tables?
or do compilers that try to be efficient implement them as jump tables?
 
I think it depends on the language. Most probably don't compile to jump tables unless there are several else branches if I had to guess.
switch works the same I'd assume.
 
but wouldn't jump tables be more efficient in all cases?
 
Probably depends on the conditional. I read something about this on either SO or Prog lately, let me see if I can find it.
 
@Geobits I was working with IL code a few years ago (.NET's byte code), and I remember that you actually needed quite a lot of cases before switch wasn't compiled to if/else if/else
 
wokring on cjam prelude checker
 
3:07 PM
@NathanMerrill I guess 'jump tables' could be implemented a few different ways. If you mean the simple array of positions to jump to, then it may not be as efficient if the possible values are sparse.
 
I'm talking about a simple if/else
you have 2 possible values
 
So what is to be gained by changing it to a jump table?
 
hmm...you're probably right
 
@Sp3000 how does your check for two ( in the same column?
 
A&B
 
3:10 PM
but isn't one ( and the other )?
 
Oh I know, lemme whip up a new test case for you
(##)
(###
It passed all the test cases you have because for the two ( in a column case it only pushes one parens, then fails the matching criteria
 
oh I see
thanks
 
Woop I got down to my previous byte count :D
 
3:27 PM
@Optimizer Your 70 byte isn't working for me :(
 
y ?
it gives 0 for the link ... ?
 
I tried () and it gave 0...
)( gives 1 - did you switch something around?
 
yeah ..
my logic is currently wrong ..
 
3:43 PM
Ahaha should I not try CJam for staircase? XD
 
please do :P
 
Fixed my logic
a lot shorter now
 
why not '(/ and ')/?
 
oh ..
 
@Geobits wow I didn't even see that
thanks
 
3:51 PM
No prob :D
 
Is there a way to copy a string 5 times in CJam, rather than string multiplication? e.g. ["x"] -> ["x" "x" "x" "x" "x"]
 
a5*~
 
Woo! Spoilers started today. mythicspoiler.com
 
Oh thanks... although that's the same length as ____ unfortunately
In this case anyway
 
Stratus Dancer will see constructed play for sure
(Yea I realize I am talking to myself. The crowd on Board and Card Games is nonexistent)
 
4:02 PM
@Sp3000 no pyth conversion of your python prelude syntax checker ?
 
Pyth uses Python 3, so you can't map None
Okay Martin got 32, I can give up now
 
is it even possible to do this in O(n) - codegolf.stackexchange.com/questions/47249/…
its not even possible to get all substrings in O(n)
and then indexOf is O(n) in itself
 
@Optimizer Generalised suffix tree, yes
 
@Sp3000 what is the time complexity ot create one ?
 
O(n), and it has O(n) nodes
Then you do a BFS
 
4:08 PM
hmm, I should have taken more CS courses
 
hi
 
The trick is to have a pointer which doesn't point to a specific index, but instead automatically grows as you traverse the string
 
I see you are discussing my challenge :)
 
... if I remember right (at least in one algorithm)
 
you can also make a suffix array
which might be less code
in the suffix tree it is just the deepest node that has both strings as leaves
 
4:09 PM
goes searching for suffix tree
 
linear time suffix array construction even has code online :)
argh... why the downvote??
 
I just toggled my vote like 5 times.
 
ah :)
@PhiNotPi why?
 
4:24 PM
Because I could. Somebody else is still downvoting, though.
 
bah
I just passed the 10 minute timer to downvote your question
 
Strange that there hasn't been a longest common substring challenge before, even without the O(n) requirement. It seems like low-hanging fruit that would have been plucked a long time ago.
 
Does the timer reset every time I swap my vote?
 
probably
 
thanks for the edit Martin
 
4:37 PM
@MartinBüttner thanks for the eidt
@PhiNotPi I wonder why they downvoted it.. they should say, right?
 
@Lembik no problem
 
@Geobits I thought so too!
 
@NathanMerrill which edit are you talking about? :D
 
@Geobits although it is not trivial if you want the right time complexity
@NathanMerrill why did you want to downvote it?
 
4:43 PM
Can you mash all of the internals of the for loop into the for(;;PUT ALL YOUR STUFF HERE)?
 
That would get rid of exactly 0 bytes.
 
and what is the 10 minute timer?
 
Is a full program required? Seems like you just need a void function.
 
Yea, you're right lol
 
@MartinBüttner is my latest challenge more up your street?
 
4:48 PM
hm, the O(n) restriction means that it currently takes more time than I'd like to spend on it ;) (it does make the challenge more interesting though)
 
@MartinBüttner damn! :)
I did consider allowing O(n log n ) :)
which then let's you try some other approaches
maybe I could have had a scoring bonus for O(n) time :)
one day I will make a challenge you want to try out!
 
@TheBestOne
class E{public static void main(String[]z){String a="",b="_____",c=b;for(int i=0;i<21;b=i%5<1?b.replace(c," "):i%5>3?b+" "+c:b,i++,a=b+(i>19?"":"|")+(i<1?"":"\n")+a)System.out.println(a);}}
Saved the _____ into another variable for reuse
Looks like it saved 5 bytes
 
@MartinBüttner I didn't know that was the accepted default. Thanks.
@Rainbolt Thanks for the suggestion ;)
 
It looks like you can use print() instead of println() also.
Odd, OP added a time limit of two days now :/
 
5:04 PM
@Geobits Ok, weird Java question
Consider this code
for (init;test;i++) {
 myVar = i + i;
}
If I move the ++ like this, is the behavior well defined?
for (init;test;) {
 myVar = i + i++;
}
 
yes
 
In that case, you can save a few more bytes
Move your plus plus inside
Hmm that didn't work at all lol
 
There's not a great place to put it that I saw. He needs its value to stay the same throughout the ternaries.
 
I'm guessing the line he wants it on is a=b+(i>19?"":"|")+(i++<1?"":"\n")+a;
But I get weird results
So the parentheses make the behavior weird?
 
That's evaluated before each b=i%5<1?b.replace(c," "):i%5>3?b+" "+c:b, so you'd have to change the conditionals using i there.
 
5:09 PM
Oh I see
Hmm... could we do it in the test?
 
Maybe. It would be one-off for each iteration unless you init to -1, which would be an extra byte plus the ++. So, you could save a byte on the comma if it works right. I haven't looked closely, but it probably should.
 
I was thinking init to -1
And yea, the extra byte matters
Comes out even as far as I can tell
 
int i=-1;++i<21; only adds three, so you save one over ,i++
 
Yea, you're right
void b(){String a="",b="_____",c=b;for(int i=-1;++i<21;b=i%5<1?b.replace(c," "):i%5>3?b+" "+c:b)a=b+(i>19?"":"|")+(i<1?"":"\n")+a;System.out.println(a);}
 
@TheBestOne ^
 
5:15 PM
I'm listening.
 
Pardon my function name lol
 
4 challenges in an hour. We're on a roll.
A bit too fast of a roll D:
 
lol, I probably have several posted where my ungolfed function is named 'a' and my golfed is b/c/d/etc.
 
I refactor everything at the end of my golfing to have names like that :)
 
5:17 PM
T_T
 
Also, Lambert's Cafe (home of the throwed rolls) in Gulf Shores, Alabama is amazing. Best rolls you ever had. And they throw them at you.
I caught half a roll once. The other half hit my cousin in the face
 
Wait, it broke in half as you were catching it? What kind of claws do you have? :P
 
@TheBestOne Your for loop needs to test against 20 if you do it that way
 
Already done :D
 
@Geobits A lot of rolls do this when they bake: examiner.com/images/blog/wysiwyg/image/lambertsroll.jpg
They form a rift and if you catch one lobe the other lobe keeps it's momentum until a force acts upon it (my cousin's face)
 
5:22 PM
I tried doing the staircase with an explicit formula, but it's much longer :(
21,29,ff{_2$5/)6*(=@@6/5*=_++" |_|"=}W%N*
 
@Rainbolt Great. Now I want a roll.
 
Sometimes I want rolls so much that I eat at Ryan's, knowing full well that I'll be disappointed but I'll get all of the hot buttery rolls I want.
 
@Rainbolt Those kinds of rolls are made differently than your regular round rolls :P
 
I don't discriminate.
 
Don't mind him; he's a rollist.
 
5:26 PM
Now, I may not be a rollist like TheBestOne, but I do hate biscuits.
 
(Unless they have homemade gravy on top.)
 
I don't like white gravy either
 
I joined the roll and posted another challenge.
 
@Rainbolt That's because you're a God-hating unamerican communist :D
 
And who makes brown gravy for breakfast
I make my pigs with croissant's because I hate biscuits so much
Does "pigs" mean anything to people outside of the US?
or even "pig in a blanket"
 
5:28 PM
Well, pigs go fine with croissants... no complaints there.
 
Out of all of my ancient sandbox posts, are there any that stand out to you all as challenges I should post soon?
 
Wow... 22 posts.
 
Are those all unposted?
 
I believe I deleted all the posted ones.
 
Looks like these countries are all familiar with pigs-in-a-blanket: "United States, United Kingdom, Denmark, Australia, Ireland, Germany, Belgium, Russia, Canada, and Japan."
 
5:30 PM
No wonder we have a bajillion answers in the sandbox. It's all Phi's fault :P
2
 
The sandbox is challenge purgatory...
 
@Geobits Have you ever heard of this? It says for US on the wikipedia page: At breakfast or brunch, the term "pigs in a blanket" refers to sausage links with pancake wrapped around it.
 
I've seen it, but never heard them called that. That's more like a fluffy comforter than a blanket.
 
In Scotland they call it kilted sausages
How original
 
I find pigs in blankets (the food) rather disgusting :P
 
5:32 PM
What kind of pastry?
And don't go by the crap they sell at donut shops
Those giant, fluffy, cheap blankets that have been sitting there for hours
Filled with crap sausages
 
@Rainbolt Are you talking about corn dogs?
 
They're best when they slightly scald your mouth because you're impatient.
 
They basically do taste like corn dogs actually. At the donut shops
But more floury taste instead of corn
 
@PhiNotPi I like the Core War KOTH.
 
And baked instead of fried
 
5:34 PM
I've only had homemade pigs in blankets.
 
Omg that was the missing dish at our bacon cook off!
 
@Geobits Yum!
 
Those pigs are like the creepy skin-wearing serial killers you hear about :D
 
@PhiNotPi I really like the KOTHs. I don't like your Core War KOTH though :P
 
5:36 PM
I wanna make bacon pinwheels now
Like this but with bacon instead of bread comfortablydomestic.files.wordpress.com/2014/01/…
 
Interesting fact about the staircase challenge: the lines are in alphabetical order.
 
1) Make a little (1") bundle of french-cut green beans 2) Wrap with bacon and shove a toothpick through to keep it together 3) Coat with brown sugar 4) Bake until caramelized 5) Contract diabetes and/or heart disease
 
I already save bacon grease and throw a spoonful into my green beans when I boil them
 
@Geobits The brown sugar ruins it :P
 
That's the most insane thing I've heard today.
Even worse than Rainbolt hating biscuits.
 
5:41 PM
I have a theory that WingStop puts brown sugar on their fries. Mostly because I tried it and it tasted the same.
 
Now that sounds a bit odd. Any good?
 
1
A: The Staircase Challenge

Paul RC, 86 bytes main(i){for(i=25;i>=0;--i)printf("%*s%c\n",(i/5+1)*6-1,i%5?" ":"_____",i<25?'|':' ');}

 
I made some potato wedges with salt, brown sugar, and vegetable oil. Tasted almost exactly the same as Wingstop. I'm missing a few spices I'm sure.
 
gaaaaaah
I had just finished Zgarb's challenge when chrome crashed
which normally isn't a problem because it restores the contents of the CJam interpreter correctly... but I had worked on it in a tab I had previously opened through a permalink... so the permalink contents replaced the code... :(
 
Well that sucks.
 
5:46 PM
@Geobits Looks like pepper is the missing ingredient. I think I'll try it tonight
Could probably just go crazy with chili powder
That's how Five Guys does it
 
Cool, let me know how it goes.
 
@Geobits luckily it wasn't too long, so I could write it up from memory
 
See, this is why I don't typically explain my downvotes, even when people ask :(
4
 
@Zgarb I will most likely do Core War next. The KOTH I've done in the past had some serious (and bizarre) problems with my ability to run it in a reasonable period of time. Since Core War would be run as single process, it would go much faster.
 
Speaking of bizarre KotH problems, I had a challenge break the character limit for Windows command line args because more than 63 people participated. Totally broke my I/O
Lesson learned - passing the game state via command argument has limits
Gotta watch out when it grows with the number of players
 
5:57 PM
Good vs Evil I assume?
 
My bizarre problem was that Python programs like print("0 5") were sometimes taking over 500ms to run.
 
@Geobits Yup
 
Well they do say python is slow.... ;)
 
So I ended up breaking players into pods of about 30 and running it that way instead.
 
@PhiNotPi Using pipes usually fixes that ;)
 
5:58 PM
Which meant I had to randomly generate pods and run multiple trials to ensure fairness, which took days to do.
Gah. This guy keeps writing his emails in all italics. It's destroying my soul.
 
Better than all caps with typos and emojis.
 
02:00 - 18:0018:00 - 00:00

« first day (1493 days earlier)      last day (3333 days later) »