« first day (4222 days earlier)      last day (626 days later) » 

12:39 AM
@mousetail Seems like some kind of pseudo-OISC tarpit? I see that there's always two sets of three things, separated by a colon...
Collatz Conjecture in funstack.hs, 80 bytes (15 tokens): Length Dec takewhile At flip Pair Plus 4 Times 6 compose hook flatmap #N iterate
 
@mousetail clearly a Burn clone
 
The fun part here is how the 3n+1 function is computed: by generating the infinite list [0, 4, 1, 10, 2, 16, ...] and indexing into it. This was the shortest method I found, both in tokens and in bytes.
(though it would be shorter if I implemented an if modifier)
 
wait what is that infinite list
 
Do you mean what's it used for, or how did I generate it? (Or both?)
 
12:55 AM
might as well go both, but i presume the latter should answer any lingering questions on the former
 
Looks like it's a single step of the...thing function
Forget what it's called
Collatz
 
kind of but then "how the 3n+1 function is computed" would be circular, no?
heres how i compute the function: first i compute the function...
 
How to generate:
- Take natural numbers [0, 1, 2, ...]
- Map each number n to [n, 6*n+4]: [[0, 4], [1, 10], [2, 16], ...]
- Flatten
 
woah
trying to convince myself why thats right
 
12:57 AM
Based on the observation that the values of the Collatz function are two different arithmetic sequences interleaved (one for the odd numbers, one for the even numbers)
 
ok wait that helps
evens are unchanged because theyre not allowed to be affected by 3n+1
but i dont understand 6n+4
 
Instead of 3x + 1 you have to do 6x plus whatever since the x will be half of what it normally is
 
if it were 6n+2 id get it
 
And it's +4 instead of +2 since it's one indexed instead of zero indexed
 
ohhhhhh
 
12:59 AM
Took me a sec to think through how that was correct as well lol
 
right i forgot, youre not mapping every other number, youre mapping every number, and its doing the work for the next number as well
thats kind of very insightful and clever
i wonder if that can be used to golf literally any other language's solution lol
 
Languages with zipmap could probably benefit from it
 
I was just trying it for Haskell, and it looks like it's gonna be a bit longer than the shortest solution
 
Same for Vyxal
λλ6*4+;Þ∞‹Zfi;İJ using the inf list approach (16 bytes)
‡₂[½|T›]İJ is shorter at 10 bytes
and is a more literal approach
 
3 bytes longer in Haskell, to be precise.
cycle[div n 2,n*3+1]!!n
(do i<-[0..];[i,6*i+4])!!n
 
1:17 AM
ah that seems like a good builtin to have, cycle
 
If you support infinite lists, yes. It's one of the basic inf-list builtins.
In this case, of course, it's just being used to emulate the cyclical indexing builtin that nearly every golfing language has
 
LDQ: Is it worth having both a normal list indexing operator, and a modular one?
I could see special casing indices that don't exist being useful in some circumstances, but not others
 
if you have productive failure, maybe
like if you have choice points there's a chance failing could be useful, though i'm having a hard time thinking of when exactly
 
@RadvylfPrograms i.e. stdin or a file
 
doubt special casing a det indexing function like that could ever be useful
 
1:22 AM
Well like, with a null coalescing operator it'd be useful occasionally
"Get item N from a list, or if it's not there, this other thing"
 
@RadvylfPrograms I've been flirting with the idea of adding a non-modular indexing builtin to Pip.
 
Although since that's the only real use for it, maybe a triad that handles the coalescing too would be better
 
For exactly that reason.
 
oh yeah it could work with nulls
 
Hi!
 
1:24 AM
Hi!
 
Idk why, is the usual for people to keep switching sites?
 
@UnrelatedString I mean, in a golfing language, you didn't think I was suggesting making it error did you :p
 
i figured you meant some falsy value that belongs to some existing type
 
@DialFrost Like, getting bored of one SE site and moving to another on the network?
 
like zero or an empty list
 
1:25 AM
@RadvylfPrograms exactly
 
Oh, yeah. I guess null is kind of unusual in golfing languages
@DialFrost I don't, but I get bored of CGCC all the time, and I've never met anyone here who doesn't. Answering on other sites for a while seems like a pretty reasonable response to that sort of boredom.
 
@RadvylfPrograms Heh Me: CGCC -> ELL -> SO
Although soon I'm afraid I'll run out of sites to have fun on :(
 
There's like 200 of 'em, so depending on how varied your interests are, that could take a long time :p
 
@RadvylfPrograms My interests aren't varied at all unfortunately :P
 
I know it's a bit of a pink elephant thing to say, but IMO it's not worth worrying about losing interest in something in the future. Quite often doing that makes me lose interest in that thing now, at least temporarily,
maybe since I feel an urge to make the (not really) inevitable event as painless as possible. In reality, just do what you enjoy now (and of course, what allows you to enjoy things in the future), and if you lose interest in a year, the nice thing is that you probably won't be interested in being interested.
 
1:37 AM
@RadvylfPrograms "won't be interested in being interested"? Isn't that a bad thing?
 
Say, are feminist programming languages a real thing? Like the stuff described in femtechnet.org/2014/07/a-feminist-programming-language?
 
@DialFrost Only from the perspective of now-you, who is interested in being interested
When I'm interested in something, that's like, a vulnerability. I'm tempted to think of the possibility of losing interest as a threat to what I enjoy now, when the point is that I won't enjoy it when I lose interest. It's this weird circular thing.
 
@RadvylfPrograms It does, because I get bored way too easily, and when I do, I feel like crap :P
@RadvylfPrograms Hmm, interesting logic
 
@DialFrost Yeah, I know the feeling. It's not a fun one.
 
@RadvylfPrograms [laughs in Pip] ... Although Pip's techniques for handling nil could probably stand to be improved.
 
1:39 AM
I wonder if a Some/None sort of thing would be at all viable in a golfing language
You could make most common operations sort of...pass through Somes, and return None if either input is None, and...wait this is just null
Quick question for any rustaceans here
 
@RadvylfPrograms Gee you switch topics fast Hehe
 
If I'm making a library, called idk, xyz
Do I need to do pub mod xyz; in lib.rs, or is any pub fn already in xyz::fn_name()?
@DialFrost Yeah, I do lol. Although this was in the context of the null-in-golfing-languages discussion
 
@RadvylfPrograms No idea what you're talking about but okey, continue! :3
 
Also, off-topic but I'm going to my first concert tomorrow! :D
 
\o/
 
1:43 AM
@RadvylfPrograms (this is in the context of the two following messages not the preceding one, prob should've used a ---)
 
@RadvylfPrograms wow this looks so weird since on my screen lowercase regular s is between the height of monospace capital S and monospace lowercase letters
 
Chat Monospace Fix gang :p
 
oh thank god pls pass the link
 
Requires Tampermonkey, just hit Raw
 
woot looks good ty
 
1:51 AM
@RadvylfPrograms Too smart for me to understand ... :/
 
2:03 AM
So, for the shorispo library (what catstruct and any other golfing languages I make in the next few years will use), I think I've decided on a number type
Arbytrary precision floats
Now Radvylf, you might say, that doesn't make sense.
And it doesn't (well it does but in the wrong way). Float here doesn't refer to how the numbers are stored, but instead how they behave in certain corner cases.
Despite having arbotrary precision rational/real/complex support, it will also have signed zero and infinity
Since I find them really really elegant, and they could possibly be useful in some really rare cases
 
Makes sense, but I wouldn't call it floats just because it has signed zero
 
Yeah, I need to find a better name
 
2:19 AM
signed arbnum?
wait
@RadvylfPrograms will it also have unsigned 0?
wait im stupid LOL
 
Rational numbers with signed zero and infinity :P
 
@thejonymyster No. For securty reasons, all zeroes are digitally signed.
 
@RadvylfPrograms It's good to be able to verify where your zeroes come from. This is what is known in the industry as a zero-knowledge proof.
4
 
2:35 AM
I hear they're developing a new blockchain for such a purpose that uses proof-of-zero technology
Basically, whenever a new block is published, a whole bunch of computers compete to verify that, it is in fact, a 0 that has been added to the chain
 
2:52 AM
so the next sequence for the oeis thingy is some erroneous sequence: oeis.org/A001984. yall think its fine if the next sequence is the correct version instead: oeis.org/A045535
 
imo yes
 
@AidenChow no, play it as it lies
 
@thejonymyster well u would have to hardcode at least one of the values (because the sequence is wrong, obviously), is that allowed?
 
why wouldnt that be allowed?
its just a sequence that follows a different set of rules than the ones laid out for it
similar to if you got the one thats just jeopardy numbers or something, it doesnt have to have a closed form does it?
 
bro the sequence is based on some property, but its wrong
u gonna have to be hardcoding some values im pretty sure
 
3:04 AM
correct
 
> Hardcoding is only allowed if the sequence is finite. Please note that the answer that prompted this (#40) is the exception to the rule. A few answers early in the chain hardcode, but these can be ignored, as there is no good in deleting the chain up to, say, #100.
ig the wrong sequence is finite lol
but it feels wrong
like the property its based on can be used to extend to infinite sequence
 
but it isnt that sequence, its the finite sequence that isnt actually following that property
if the title were "this collection of arbitrary numbers" would that change your mind?
i guess the way to make it reasonable to use the corrected sequence is for the challenge's rules to overrule oeis's historical stuff
 
@thejonymyster actually, yes. if theres no discernible pattern, i would be ok with hardcoding. but because theres a discernible pattern (many of the numbers are actually correct except for maybe a few), its a little more gray for me
 
"if the sequence is a histortical/wrong version of an existing sequence, you can use the correct sequence", which makes sense
i just dont feel like its really necessary when like... you could just do something with the existing wrong sequence
its not like it makes it impossible
also i wonder if any A number used in the challenge so far will ever change what sequence it is
 
@thejonymyster well thats not really the problem, its more like u can have some code output the sequence based on the property but then hardcode the wrong values, but then why not just use the correct sequence if u gonna do that anyways?
 
3:10 AM
cause then you're not actually using the sequence you were given
its inconsistent with the rules in favor of being consistent with being "reasonable"
 
eh watever im just gonna submit a hardcoded answer and move on
actually im gonna wait for more ppls opinions before doing that
 
yeah im curious to see what other people think
that whole spiel is just my opinion after all :P
 
3:56 AM
im trying to do it but I can't figure out this weird quadratic residue thing
I tried porting the PARI/GP answer but apparently an intmod is different than a Euclidean modulo, so it doesn't work right
 
4:37 AM
@Steffan isnt it like k is quadratic residue mod m if there exist x where x^2 congruent to k mod m
so like the easiest way is to just loop from x = 0 to m-1 and test if its congruent to k?
 
4:50 AM
or wait even better, just test if k is a square number
 
5:32 AM
wait nvm i dont think checking if k is square works
tho all the squares less than m are quadratic residue mod m
but there can be more than just those
 
 
2 hours later…
7:15 AM
Is there an OEIS for 3, 31, 1, 314, 14, 4, 3141, 141, 41, 31415, 1415, 415, 15, 5 etc?
 
7:54 AM
@emanresuA OEIS has search you know
 
Forgot
 
Hello all
 
@lyxal CMC:
 
@graffe hi!
 
Aug 17, 2021 at 16:38, by pxeger
(no joke, the first programming language I tried to make used XML)
exactly like that
I was trying to avoid writing a parser, by just using an XML parser
but validating the XML without a formal schema turned out to be about as hard
 
8:10 AM
I am already wondering what to do when my bounty fails
Maybe too pessimistic
I think I should have made it a new question instead
 
nothing much u can do tbh
@graffe made what a new question??
what u putting a bounty for
 
 
1 hour later…
9:36 AM
4
Q: Optimal strategy to defeat the wizard

graffeConsider the following setup. An evil wizard has ten opaque boxes in front of him. Hidden from you, he chooses a random number of coins \$x \in \{1 \dots 10\}\$ and spreads them uniformly at random in the boxes. That is, there should be equal probability of assignment of coins to boxes from all...

 
 
3 hours later…
12:16 PM
i am so bored so i am making some physics engine
 
@PyGamer0 Welcome to the world of rounding errors
 
@mousetail no thanks
lol
i am making a new and better one
 
How is it better?
 
i am rewriting everything
and hopefully it should support polygons
i say hopefully because i am bad at math
 
Convex or concave?
 
12:29 PM
hopefully both
 
Nice, good luck with that
 
also i am commenting everything
 
You should animate the source code itself falling into a heap
 
hard
and i'm lazy :p
you know what would be cool for python:
that
 
1:40 PM
@pxeger that’s actually kinda smart
 
I thought so
but it was not
 
Using xml or lisp to prototype your language before deciding on the syntax
@pxeger f
What happened?
Oh ok
I guess you could just not bother validating it
 
2:30 PM
@emanresuA Vyxal, 12 bytes: Try it Online!
 
33
Q: Write a program to elasticize strings

Mario IshacNice verb there, in the title. Write a program that given an input string, will "elasticize" this string and output the result. Elasticizing a string is done as follows: The first character is shown once. The second character is shown twice. The third character is shown thrice, and so on. As ...

 
 
3 hours later…
5:48 PM
I am trying to find a nice sed solution to the "elasticize strings" problem above, and this is my attempt so far, which almost does what we want except for the unwanted newlines. I need some way to P without including a newline, or perhaps a wholly new strategy. Any ideas? (ofc I could remove the newlines with a 2nd run of sed, but want a solution with a single run)
 
 
2 hours later…
7:29 PM
@UnrelatedString How does ` ðƙF⁼` parse?
 
7:40 PM
start a new dyadic chain with ð, ƙ pops the original monadic chain, it's effectively identical to ¹ƙF⁼ɗ
and it's profoundly tragic because for some reason there is no original monadic chain if the code itself of the chain is empty
i.e. i would reasonably expect ðƙF⁼ to work for 4 bytes but it errors instead
 
Ahhh, so the parsing problems I was having were because it was a monadic chain, and yours makes it a dyadic chain instead (but still works fine if you only give it one argument?)
 
yep
the number of arguments passed to the program (or the adicity it's invoked with with ¢ÇçÑñ£Ŀŀ) determines the adicity of the meta-chain (the "furlong"), and the first chain in the meta-chain inherits that adicity, but after that it's all determined by chain separators then evaluated according to chain rules in the meta-chain
 
*acidity /j
 
"how many arguments does that builtin take?" "oh, it's alkaline, you should know this already"
 
I'm just disappointed that ƙ creates a dyad in the first place. I think I'd prefer to have a dyadic atom that does what ¹ƙ does, and make ƙ a monadic quick that does what ƙ` does.
 
7:48 PM
^
ƙ is remarkably ill-conceived
 
CMQ: what sort of strategies exist to generate fibonacci numbers? im trying to do it without explicit looping / not just the closed form "floor f(phi)", but i have mapping, reduce, range, and some other stuff
 
i think for a while nobody in jht even could figure out what it did
 
i cant just list explicitly everything i have because im still designing the lang and im not sure what i need; this is part of me deciding what to add lol
so im more curious abt general strategies
 
@UnrelatedString That discussion spilled over into TNB and I got interested, with the result that ƙ is basically the first part of Jelly I learned :P
 
@thejonymyster There's the recursive one
 
7:50 PM
By reading the source
 
lmao nice
also bizarre that it literally only accepts monads; as marginal as the mapping over groups functionality is i think i actually have had a few times i've wanted to do so with access to the group's key :P
 
@thejonymyster There's the Haskell way: define the lazy infinite list of Fibonacci numbers as itself, shifted, added to itself.
 
@thejonymyster 1/0.9899
 
shit yeah having an infinite list might make a lot of sense with what im making but ive never implemented them before / they scare me
 
they're really not that bad
 
7:53 PM
@JoKing Isn't that just the method using phi?
 
and they are extremely expressive
 
@RadvylfPrograms i don't know how phi is involved here
 
@thejonymyster If you implement your language in a language that handles infinite lists easily, implementing infinite lists is easy. Otherwise, not as easy.
 
ok yeah
the lang im trying to make would also be way more interesting with infinite lists lol
python has them right?
 
7:55 PM
not really
 
^
 
python has generators but they're stateful
you can't treat them and normal lists uniformly; they're more like iterators
 
@DLosc How does that work? Wouldn't it need to know other stuff, since other lists like, all zeroes, also have that property?
 
you shift it with a 1 :P
 
7:56 PM
@RadvylfPrograms Yeah, what I wrote is the oversimplified version. You have to give it the first couple of numbers manually
 
come to think of it i always underestimate how much of the sequence i have to seed with whenever i try it lmao
 
might be too hard for me atm, i might just trudge onward without cool fib and just accept that this will be more of an experiment than a useful lang haha
 
@UnrelatedString I think in this case, you need two numbers, because you're generating the rest of the list by adding two different entries together. So you need to have two different entries to start with.
 
8:00 PM
I was thinking of something like this, which is a bit longer. But it turns out we've both been outgolfed by scanl: codegolf.stackexchange.com/a/89/16766
 
oh
oh yeah
funny how you can get the powers of 2 by permuting it to f=1:scanl1(+)f, essentially removing the conceptual shift
 
@UnrelatedString That took me a while to figure out, lol
 
lmao
i actually thought of it because that's how i read it for a split second
and then i was thrown off by the 1f because it's kind of counterintuitive that identifiers can have trailing digits but not leading digits
 
Helped that I was just reading about foldl vs foldl1 yesterday
Oh, wow. You did it. You outgolfed Dennis.
 
happens :P
 
8:08 PM
It did really seem like a 4-byter was possible, which is why I kept trying different stuff.
 
So Þ says it takes a monad; if you give it a dyad, does it bind the left argument to it first or something?
 
i actually got most of the 5-byters you did after you bumped the challenge with bqn but trying to use ƙ only got me to ¹ƙṢFɗ@ƑJ which doesn't even work lmao
@DLosc can't entirely tell what you mean but yeah; x dÞ y sorts the elements e of x by e d y if that's coherent
 
Okay, so I would call that binding the right argument.
 
yeah
basically passes it through
 
8:32 PM
Is there any golfing language with a one-byte "is sorted" builtin? Seems like it's 2 bytes everywhere I look: ṢƑ in Jelly, ÞṠ in Vyxal, ≤₁ in Brachylog...
(and $<= in Pip, although if it were strictly increasing you could do $< in 2 bytes)
 
Don't think so
 
8:51 PM
seems like there should be
 
9:41 PM
There's nothing quite like spending half an hour writing and rewriting 12 lines of Haskell, tying your brain in knots to figure out how the types fit together, and finally at the end of all that clicking Run and getting no compile errors on the first try. :D
7
 
the best feeling
 
Even better: It works! =D
Well, okay, mostly works. The part that involved the brain-knotting works. There's a small bug in a less-involved part that should (heh heh) be easy to fix.
 
10:17 PM
@DLosc New and improved version: Trio self map Range 100 151
 
10:49 PM
I tried running a fork bomb on TIO and the stderr gets messed up because so many forks are trying to write to it at once lol
 
retryork
 
whats a fork bomb
@UnrelatedString lol, also unavailableork
 
In computing, a fork bomb (also called rabbit virus or wabbit) is a denial-of-service attack wherein a process continually replicates itself to deplete available system resources, slowing down or crashing the system due to resource starvation. == History == Around 1978, an early variant of a fork bomb called wabbit was reported to run on a System/360. It may have descended from a similar attack called RABBITS reported from 1969 on a Burroughs 5500 at the University of Washington. == Implementation == Fork bombs operate both by consuming CPU time in the process of forking, and by saturating the...
 

« first day (4222 days earlier)      last day (626 days later) »