@Sp3000 I've been trying to save a char on forward differences
f=lambda l,n:l*(1-n)or f([b-a for a,b in zip(l,l[1:])],n-1)
f=lambda l,n:l*0**n or f([b-a for a,b in zip(l,l[1:])],n-1)
f=lambda l,n:l*-~-n or f([b-a for a,b in zip(l,l[1:])],n-1)
Code Golf - ASCII Art maker:
A text to ASCII art generator maker, the program must input a string and return ASCII art from it. Something like patorjk.com/software/taag/
Prelude, 95 bytes
?v(1-)#(1-vv(1-)#(1-)#)v ^ !
? 1- vv- # ^(1-)#(1-)
? # # ^ #
Input format is
N
M
n_1
n_2
...
n_M
where N is the depth of the differences and M is the number of integers in the input. Adding M was necessary, because there's no way for Prel...
@randomra The forwards difference task can almost be answered with the very simple J script +/\inv since the forwards difference is the inverse of the sum scan.
@MartinBüttner In case anybody else wanted to golf it? There's probably a lot of minor tweaks possible, but I've gotten my point across so I won't be doing much more
it might be suitable for code-golf although I don't want really slow solutions as they are boring so maybe I could give a large input and give a time limit?
or is there a better way?
in any case.. what do you think and what would make it most likely you would try it out :)
@Sp3000 hm fair enough... and regarding your comment, it's definitely on topic, but I think (as feersum did) we should apply SO-like quality criteria and ask people to show their own effort
heh, first I doubled David Carraher's score on Forward Differences by telling him he can't use Difference, and then I brought it back down to the exact same size by golfing his modified answer :D
I've cut down the non-whitespace characters from 48 to 38
basically, I used to loop N times with (1-). but a) that's 4 columns, and b) it's really annoying if you need to remember N for future loops. now I'm instead converting N to unary on another stack. then I can simply loop with (#) (only 3 columns), but more importantly, if I've got a spare voice, I can remember N for free by building a unary representation on that other stack, while this one is being emptied.
furthermore, in principle, for (#) I can put the ) on the same column as #, which reduces the minimum loop to two columns. this is not possible with the (1-) loop. (in this particular case, I don't have any spare voices to move the ) to though.)
I'm only posting this in the sandbox because it may be too broad, even for a pop-con. If it gets some support I'll post it very soon.
Generating Postmodernist Writing and Other Logorrhea
Writings about postmodernism are known for dealing with highly abstract ideas, potentially in a verbose mann...
that really depends on the cycle length of the underlying PRNG though... and even if it's long enough, there might be some weird relationship between consecutive random numbers which happens to produce a collision at some point
@Sp3000 It could be reworded. It's just to ensure someone doesn't post a few hardcoded convincing examples that are are really repeated over and over in their 2^32 outputs.
@MartinBüttner I know that writing a submission would be easy, but writing a submission worth upvoting would not be. Much like Tweetable Mathematical Art.
@Sp3000 actually, the version now is a bit tidier than it used to be: the bottom two voices are merely passing stacks of 1 back and forth, while the top two voices to the differencing.
@Calvin'sHobbies even so I think the scope of Tweetable Mathematical Art was a lot more limited. the question had a really tight framework and size restriction.
@Calvin'sHobbies How random are you thinking for submissions? Are we allowed templates like "We believe that this <A/B/C/D> <E/F/G/H> will be the technology of the future."?
(with more options to meet the 2^32 restriction, of course)
@Sp3000 That would be allowed, though I wouldn't expect something like that to be very popular. The hope is that some people would see it as an opportunity to really stretch their NLP muscles and create cool things.
I guess they'd have to if it was limited. Then 1000 bytes looks pretty small. With no limit they could have external word list files and other stuff if desired.
I haven't created a duplicate question... and I don't even want it to be necessarily reopened. I'd just like to be able to post an answer (either to it, or to the supposed "original" question)
Obviously, as it almost always happens... duplicates aren't perfect duplicates, and in this case there'...
@Lembik there will be a few more difficult ones but probably also a few simpler ones... I don't want to end up with only one or two people being able to solve one of them.
However, if people are optimizing for one scoring method/formula, it would be nice to not screw them after posting by making it different enough that they have to change their code.
No real suggestions to fix that. Doing it yourself first so you have some idea of the balance is encouraged, but many times answers will do something tricksy that you didn't think of.
Sandboxing for a few days can sometimes help, also. Sandboxing for an hour or two, not so much ;)
I don't know. I don't see "go away from center (hide)" as a good long-term strategy, even if the possibility of stall exists. You're just setting yourself up as more likely be further from the next one as well.
@MartinBüttner Also, if a piece of food spawns close to you and you manage to eat it, and the next one spawns far across the field, it is likely that your enemy is closer to it than you.
Ok, so if I go away from center, I lose out on food at least 3/4 of the time when the next food spawns closer to you. Either way it mostly comes down to luck, IMO.
this band released a new album, streaming it on youtube with a visualisation on youtube. the visualisations are all in the exact same style, but I'm already picking out clear favourites where I think "this is so much better" :D
The most important thing when golfing in J is to not only understand the problem, but to reduce the problem to a series of array transformations. You need to understand this way of thinking to have any success with J code.
For example, a recent challenge asked to solve the largest subarray probl...
J (3 characters)
$:0
The builtin verb $: (recurse) evaluates to the longest verb that contains it. In the phrase above, the longest verb that contains $: is $: itself so we get infinite recursion. A 0 is needed to invoke this verb as a phrase of type verb doesn't do anything if it stands on it...
I think @feersum doesn't have a point with his critique.
We've recently received a Vim golf question that's sparked a bit of controversy as to whether Vim golf, or "editor golf" in general, is on-topic here.
Should Vim, Emacs, or editor golf in general be allowed?
so I've been playing Risk of Rain for the last few days... yesterday I managed to survive long enough to see all the difficulty levels for the first time (the difficulty increases every 5 minutes). I had managed "Insane" before, so I was really curious what the rest would be. the full list is: "Very Easy", "Easy", "Medium", "Hard", "Very Hard", "Insane", "Impossible", "I SEE YOU", "I'M COMING FOR YOU", "HAHAHAHA". :D