« first day (3662 days earlier)      last day (1173 days later) » 

1:03 AM
Does anyone recognise this mathematical function: Lc(z) = z*ln(2*sin(z*π)) + S(τ*z, 2) / τ where S(x, 2) = sum^{\infty}_{k=1} (sin(kx) / k²)?
It's one of the ones I added to Whispers v3 but I can't remember what it is
 
2:01 AM
Huh?
Definitely no idea.
@Razetime Print returns Null. ([downvote])
You know...
9 hours ago, by user202729
@cairdcoinheringaahing Now it seems like that you don't bother to read the formal description and nitpicking me. -- Anyway, I added a FAQ.
Time zone mismatch is another annoying thing thing.
That having said the challenge is not unclear just because the close voters don't want to understand it, right?
This is not stack overflow, so I can totally say "If you don't want to answer the question, just go away"
(don't take it seriously. But you get the point.)
Let's check the remaining issues... (making the challenge interesting is not the responsibility/requirement of the challenge proposer...)
 
2:26 AM
@user202729 woops
@cairdcoinheringaahing lc sounds like Laplace idk
Maybe look at the commit names
 
Isn't it harmful for people to close vote challenges that they are too lazy/consider too hard to read?
@cairdcoinheringaahing Don't see any problem, but I have to say that I didn't notice the "same length" condition on my first read, only when someone said it in the comment.
Initially I find it weird that the length must be even.
 
@user202729 I don't know if "too lazy" is necessarily the correct interpretation. It seemed like quite a few people were trying to understand it. I voted to leave it open, but if it's genuinely hard for almost everyone to understand the actual task I see how it could be considered to need more clarity.
 
@xnor ... you know that I can't fix/improve the formal definition if you don't explain what's the issue, right? The informal description is not a substitute. — user202729 7 secs ago
Saying that "I can't understand it but I don't explain why" is the same thing as "I'm too lazy to read it".
I mean it could be "I'm not good enough at math to read it" too
(it's weird for xnor to say it, isn't it?)
but that's basically the same thing. It doesn't make sense to close it in that case.
 
It could be the clearest and most well written spec in the world but if nobody can understand it that doesn't mean it's their fault. It's also not necessarily easy to pinpoint exactly what's hard to understand about something.
 
 
1 hour later…
4:01 AM
@user202729 okay so I think that the description is a tiny bit convoluted
If I've understood it correctly, you're asking for people to golf a brainf program so that it produces the same tape
 
I did include an additional "background" section there
which should explain the challenge without reading the formal definition.
(it's unfortunate that the challenges I put the most effort in don't get that much upvotes)
Which is understandable, because easy accessible challenges are easy to understand for most people, and at the same time
 
But what is the crux of the challenge?
There's a lot of information but there doesn't seem to be a short summary of the challenge
And the introduction could be worded better
 
> Your task is to find the shortest program that can be obtained by rearranging the memory layout, without changing the execution or order of the other commands.
Is that not clear?
I did even include an example there.
 
What do you mean by memory layout?
 
That's a short description. For more details you have to read the other parts.
> whatever a cell x is used (by a command not in <>) in the original program, the cell f(x) is used in the new program. Then the new program might be shorter than the original program.
 
4:06 AM
So basically you golf a BF program by rearranging the cells used?
 
See that reads a bit unclear
 
There's the formal definition.
 
Oh good, that one reads a lot unclear
 
In theory I could include only the formal definition and it's still clear but...
that's not interesting.
 
It may have well specified, but it reads unclear
2
 
4:07 AM
Uh, not sure how to rewrite it.
You find a function f that maps from the old cells to the new cells, such that (the above).
 
Given a BF program consisting of only the characters +-[]<>., with the property that there's an equal number of < and > between every matching pair of [].
 
I specify how the cells are swapped in the example.
 
The word given implies that there's a challenge statement coming
But then the next paragraph isn't the challenge
 
It's in the next next paragraph. Is that a problem?
 
(I think it's a really cool challenge, btw, the wording could just be improved)
 
4:09 AM
@user202729 no, I'm saying the grammar doesn't flow like one would expect.
The challenge has well specified information, but it could possibly be simplified
 
Not sure about this point. I'm not a native English speaker, but that reads natural to me.
 
In fact it's probably overspecified
 
What. When there's not enough information you complain it's unclear, then I include more info you still complain?
There are 3 layers there. Each one is (should be) self-contained.
 
Does this summarise your question: "Given a bf program, golf it. Programs will only have []<>+-,"
 
No.
Actually, kind of.
 
4:12 AM
Maybe put this at the beginning
> The goal of this challenge is to write a program (or function) which takes a brainfuck program, and rearranges its memory layout to minimize the size of the result.
 
But I have to deal with the special cases (programs that does not satisfy the memory condition like [>],
and the dead code.
 
@RedwolfPrograms memory layout
 
Without these there will be other people complaining that it's unclear.
 
What do you mean by memory layout?
Do you mean the tape?
 
Let me try to explain it.
... wait.
 
4:14 AM
Yeah, from what I understand the goal is to golf the locations of things on the tape
 
First, do you know what the language is?
 
Yes
It operates on a tape of cells
It moves the cell pointer left and right along that tape
 
By the way, is there a problem with the formal definition? If everything is wrong, you can still read it and reverse engineer the challenge.
Anyway --
Perhaps you can read the formal definition part of codegolf.meta.stackexchange.com/revisions/19310/14 which "only makes sense for people who knows the language".
 
Okay I think I got it
 
Having to write the challenge for the 4 types of people who {do/don't} know what the language is and {can/can't} read math is terrible.
 
4:17 AM
> Given a valid, terminating, bf program, rewrite it so that the number of non-zero cells at the end of execution is minimised
 
I don't think that's correct
Take ,>>.
 
@Lyxal Wait what's wrong with you.
 
Does the formal definition in the link above makes sense?
 
Frankly no
 
4:18 AM
I can't explain what "rearrange the memory layout" is except by saying "find a function f :: C -> C".
 
@user202729 nothing
I was giving what I thought it meant
 
...
 
How close is this definition to what you mean:
 
> The goal of this challenge is to write a program (or function) which takes a brainfuck program, and rearranges its memory layout to minimize the size of the result.
(copied in the wrong thing :p)
 
4:20 AM
That's exactly what I'm saying.
("resulting program".)
 
All the test cases lead to the programs using less cells on the tape
Which is what I'm saying
 
I think it'd clear up a lot of confusion if you put something like my summary at the top of the question.
 
Most people know the word cell/tape when they think of bd
*bf
They may not instantly know the term memory layout
 
@Lyxal No, the number of cells used is the side effect of making the program shorter.
In the second program there, the number of cells accessed is the same.
 
Okay so why mention memory layout if you aren't impacting cell usage?
 
4:22 AM
The goal is to minimize the program length.
@Lyxal That's the thing and the only thing that you can change about the program.
 
22
Q: Minify Brainfuck

DoorknobYour challenge is to minify Brainfuck code, according to these rules: Remove anything that is not one of +-><[].,. For any group of consecutive + or - characters, if the amount of +s and -s is the same, remove them. Do the same as above, but with > and <. Remove sequences of the +->< character...

 
You can change +- to -+, for example.
@Lyxal Only the title is the same.
 
So how does it differ?
 
How can I explain it to you without explaining what my challenge is in the first place?
> The amount and order of the non-<> in the input and output must be the same.
 
@Lyxal Basically all you golf in this one is the position of things in the tape
 
4:25 AM
To make it so that less cells are used?
 
@RedwolfPrograms I think that's what I'm saying already, no?
Anyway, I hope this is more clear.
 
@Lyxal No, just rearrange them
I.e. ,>>,[<<+>>-] to ,>[<+>-]
The goal is to minimize the program sizde, which may or may not minimize the cells used
 
@RedwolfPrograms whysn't that the same as the question I linked
 
Because it requires other things like removing +- and other characters
 
So it's an easier challenge
Easier version
 
4:34 AM
No, the other one only removes useless bits like <> as far as I can tell, but not any actual logic stuff like rearranging the cells
Imagine the cells in the tape are named; if a program uses w x y z and repeatedly has to copy data between w and z, you could probably shorten it by rearranging the pointer movements to make it w z x y or x y w z
 
I'm still not sure I fully get the challenge
but having said that, I do believe there is a high level of specification
 
Wish I had some chalk and a sidewalk :p
 
so if I get the chance I'll vote to leave it open
@RedwolfPrograms well I'd lend you some chalk but I used some of it to experiment to see if ants are deterred by chalk powder
 
I'll have to try this challenge, seems like it'll be a lot of fun
Brute force is probably going to be close to optimal here though
 
 
2 hours later…
7:14 AM
@dzaima Why does horizontal add act like this in canvas? , 28 bytes
 
 
2 hours later…
8:59 AM
WIP 1065-byte 3-char DC solution to [code challenge - Print a string in as few distinct characters as possible - Code Golf Stack Exchange](https://codegolf.stackexchange.com/questions/11336/print-a-string-in-as-few-distinct-characters-as-possible/218685#218685)
https://tio.run/##pVfdb9s2EH@2/gpWeYhky56dvXRCFaxY@1AgaIt2KwYYQaIP2mYrUypJpXaL/OvL7o6ULDnu1mEvjsj7vvvdHVPvzaaSPz@t1cPD2ZOfMiF/qunK83Ti/77h7HMj8k8sU9UXyVbVjn1strVm1R1XzAC5TL/uWVGt/RmXeVXw4Lx5eh563kpVW2b2tZBrJrZ1pQy7EtpE7E1tRCXTMmK/pWWZZiX3HF3vdfsppK55btqj1dOetqnZdDJNVqsq57oTXTUyN1VVaohgr2eaG8XzRmkwWoqtMMFiPh7/Ah7@2nHOStXc5Gm@4cE23Wnxl
 
9:31 AM
@seshoumara i can't directly send rep, so feel free to post it. the reason i didn't do a +500 bounty was to save it for the answer that ties or beats that 99 byter. the 30b solutions are cheating, i believe, on that fizzbuzz challenge sed can use read and write, so probably some abuse there. but yeah, there are some really experienced sed golfers on anagol (compared to the paucity of sed golfers here on ppcg)
while i was repeatedly submitting my very long sed submissions (at the time >160b) to anagol, mitchs must have noted these poor attempts at golf.shinh.org/recent.rb (recent changes) and soon posted a solution outgolfing everyone
i suggest trying against other sed programs there golf.shinh.org/l.rb?sed, doing that helped me up my game a bit
 
10:08 AM
@Lyxal I'll make an analogy with C. Suppose you have a program which only uses global variables. They all have a unique name, but the resulting executable doesn't contain any names, instead the variables have been assigned addresses in the final memory layout.
Now programs compiled for position independent code typically have a global memory register which is initialised with the address of the global variable area. The good news is that the very first global variable is already at that address, so accesses to that variable don't require an offset, which saves a byte. The bad news is that if you have more than sixteen global variables then accesses to subsequent variables requires a two-byte offset.
A compiler optimising for size could therefore arrange the variables in global memory so that the more frequently accessed sixteen variables use the shorter instructions, with the most frequently accessed variable using the shortest instruction.
Similarly, the input to the challenge is a program from a simplified subset of BF that has the property that the cell that is accessed by any particular non-motion instruction is readily predictable, as if it was a named variable. Unfortunately your BF compiler didn't optimise the memory layout so the challenge is to fix up its output.
 
10:37 AM
@Razetime the pushing underscores up makes the top-left corner of the resulting canvas be (0;-1), which for some reason means that will always append one up. one fix
 
11:25 AM
@dzaima thanks a lot for the explanation
 
12:05 PM
0
Q: making lyrics and combining songs into an album

onayoI was just asking if anyone can show me how to combine a still photo and an mp 3 format so that they can be presented as mp 4. Then write lyrics on the photos.

 
12:31 PM
1
Q: Next to the middle

DavideGiven an array of integers, find "the next to the middle". The next to the middle is the smallest integer greater than the smallest among mean, median and mode of the given numbers, that is neither the mean, median or mode and is also contained in the array. For example, in the following array ...

 
 
1 hour later…
1:35 PM
@user41805 Here is my submission for the FizzBuzz sed bounty: codegolf.stackexchange.com/a/218716/59010
 
 
4 hours later…
5:09 PM
@user41805 Turns out that it's terribly tedious to find that program.
There are so many possibilities.
And also hard.
 
5:33 PM
is there compact way to represent the list 1,2,3,.., length, length-1, ... 1 in python?
 
Are "tips for golfing in x" questions allowed to also ask for tips for using the language in non-code-golf challenges?
 
I have for x in itertools.chain(range(1,length),range(length,0,-1)): but it's long
 
@Anush [*range(1,length)]+[*range(length,0,-1)]
 
@cairdcoinheringaahing oh that looks better
 
5:47 PM
If I want it to start and end at 0 I need -1 in the second range
which is a bit silly
I was wondering if you could add ranges but it seems not
 
@Anush Jelly, 3 bytes RŒB :P
 
:)
 
6:03 PM
CMQ: What level of sound notifications do you have enabled? (default is when mentioned)
 
6:13 PM
@RedwolfPrograms when mentioned
 
6:37 PM
@cairdcoinheringaahing Now that is clever. I like it!
@cairdcoinheringaahing makes me wish it was a challenge on main so you could have posted it
 
6:54 PM
@Anush I think there might be a challenge on main that does that
I remember seeing an 05AB1E builtin (think it’s Ý or similar) for exactly that
 
@RedwolfPrograms none
 
7:46 PM
0
Q: Ginormous number

xnorOutput this 1364-digit base-10 number: 103460631753827759549832149652889423518536125363820346639059351014612220605481957740849415041277790277954847110487462892690955130279104384989067512256481977665900644579654613141301499421525450747120740065457976230757565799021904335313258516455863752317730378...

 
 
2 hours later…
9:36 PM
@cairdcoinheringaahing We've identified S(x, 2) so progress
 
9:54 PM
1
Q: Tips for golfing in Whispers

caird coinheringaahingWhispers is February 2021's Language of the Month, so what tips do you have for golfing in it? Tips do not have to be specific to code-golf, so long as they apply to other types of challenges on the site. Tips should be at least somewhat specific to Whispers (e.g. "remove ignored code" is not an ...

 
10:25 PM
@RedwolfPrograms default
 
10:39 PM
So I was wondering why bash was giving me a bunch of weird unicode when I was trying to do stuff with a file full of numbers, then I realized I had inputted the entire compressed contents of wikipedia instead
Haha relatable computer problems amirite
 
@RedwolfPrograms 👌
 
Okay about to run a script involving over 200k calls to dd, please don't erase my hard drive
Oh, it's going at a rate of about one per second. Not going to wait 55 hours for this.
 
👌 👌 👌
 
@RedwolfPrograms Windows Loading Bar: task will finish in 5 minutes. 55 hours. 187 years. 6 minutes
 
@cairdcoinheringaahing Relevant xkcd
 
10:51 PM
I was originally planning on processing each wikipedia article into a more usable format all at once, but looks like I won't be doing that
Unless maybe I copy the files to my server and leave it running in the background for a few days/weeks
 
11:25 PM
@cairdcoinheringaahing Why not make it a single slice to make it 35 bytes
 
@Bubbler Because I always forget how slices work in Python :P
 
Yeah, it's kinda like "I know it should work with this but I always forget exactly how I use it"
 
11:43 PM
In bash you can run length with grep -o '.' | uniq -c and you can group and count with unstable order like grep -o '.' | sort | uniq -c. But how can you group and sort while retaining the original order with a one-liner? TIO for clarity
To clarify, I'm curious if it can be done directly with unix tools, rather than, say, by a prodedural awk script which can obviously accomplish it.
 

« first day (3662 days earlier)      last day (1173 days later) »