« first day (3860 days earlier)      last day (1279 days later) » 

00:01
0
Q: "-rot" transform

BubblerBackground -rot transform (read as "minus-rot transform") is a sequence transformation I just invented. This transform is done by viewing the sequence as a stack in Forth or Factor (first term on the top) and repeatedly applying -rot +. -rot is a command that moves the top of the stack to two pla...

@NewPosts @Bubbler How short is your crazy APL/J/Jelly solution?
Just so I have a point of reference to get double :P
@Dudecoinheringaahing My first working solution was 36 bytes in J
Ok, so there's not some crazy array-lang trick involved? :P
Not an arraylang trick per se, though I used a J-specific builtin
I think Jelly has the same thing
Can we take the input in reverse? — Dude coinheringaahing 9 mins ago
00:14
@Dudecoinheringaahing No. — Bubbler 1 min ago
ah well. "yes" would have shaved a byte off my answer lol
@Bubbler Your challenges have a tendency to make me say "blegh" about my Jelly answers to them :P
I'm sure there's a more elegant way, and I was so happy about the ḣ2S;ɗḢo, before it got ruined :/
btw, the J builtin I abused is this
00:17
@Dudecoinheringaahing Imagine using letters
@Bubbler œ? in Jelly, I believe
Where should I post if I find a minor typo in a SO blog post?
Ping Catija if it's a minor one (here or the Tavern should be fine), open a bug report on MSE if its more than a couple of mistyped words
there's an interesting pattern there but I can't see any nice way of getting it with some sort of scan
[a, b + c]
[a, b + c, a + d]
[a, b + c, a + d, b + c + e]
[a, b + c, a + d, b + c + e, a + d + f]
[a, b + c, a + d, b + c + e, a + d + f, b + c + e + g]
[a, b + c, a + d, b + c + e, a + d + f, b + c + e + g, a + d + f + h]
Gotta visit the tavern I guess
does jelly have 'uninterleave'?
vyxal does, but there's already a very short vyxal solution
@rak1507 but you can't really compare it to Jelly, because it uses the fact that it's already operating on a stack
yes
tio.run/##y0rNyan8///opKOT//@PNtQx0jHWMdExjQUA sorry, should this not do something?
Use arguments not input
00:32
oh, it should be an arg
yes
out of practice
@Dudecoinheringaahing is using a for-loop len(input) - 1 times any shorter somehow?
Jelly's always-on implicit print hurts it here
shortest way to do [1, 2, 3, 4, 5] -> [1, 3, 4, 5]?
searched for 'pop' (didn't find anything)
really
00:36
The Ɗ is to keep it as a single link, isn't always required
ok, whatever
@rak1507 How would Vyxal do it?
no idea, I don't know vyxal
Don't you? Huh, I've lost track of who does and doesn't :P
You're probably looking for "swap the first two" instead?
00:37
yeah that'd be better
thanks :P
no idea how to do that either, @Dudecoinheringaahing ?
@rak1507 is that "remove second item"?
indeed it is
@rak1507 ḣ2Uo, assuming no elements are 0
can that be assumed? @Bubbler
Nope
00:39
darn
ḣ2Uḷ" if there can be zeros
how on earth does Ḣ;Ḋ work btw
oh, modifies the list
@Dudecoinheringaahing :ẏ1oİ
duplicate, range(0, len(top)), remove 1, vectorised index
actually, ḣḢJ works
@rak1507 yor Nyan...
don't encourage the cat people.
btw, please can I post this as my own answer with credit? it's sufficiently different imo
Yeah, of course :P
00:44
thanks
ah, Z rather than z/
I don't think it's correct
ḣ2Uḷ" annoys me
@Bubbler oh no
oh right, just have to replace the last C with an H
should work
@rak1507 *replaces with D instead*
ḣ2Uḷ"µŒœÄZFḊ
@exedraj yeah, forgot I wanted tail not head
actually ends up shorter because you don't have to do the rotation twice
Looks good
Feels like there's some way of shortening ḣ2Uḷ"µ
probably
I'll get writing the explanation
ooh nice
ok golf langs can be quite cool, even if you have the idea it can be hard and interesting golfing it
anything unclear in the explanation?
05AB1E should win this, but it's being held back by design issues ಠ_ಠ
@rak1507 I'd typically do both heads first, then the below in the explanation, but that's definitely a point of preference :P
rip
ok, that makes sense
done
01:04
@Dudecoinheringaahing how many bytes do you have in 05AB1E?
In general I think I write 1 then 2 when I have a 2-1 combo (or just combine both in one line)
CMC: Give your cat control of your keyboard.
@emanresuA can't.
catn't
I don't have a cat so that may prove slightly difficult
Ideal 05AB1E would be splat; swap; wrap; uninterleave; cumsums; interleave; remove_head, where each of those is 1 byte (for a total of 7), but (cumsum) doesn't vectorise, and, because the stack is the wrong way around, it needs `rsr) instead of `s) ಠ_ಠ
01:05
@Dudecoinheringaahing I have an 8 byter in 05AB1E
@emanresuA wstgyk;io
Plus, prepends 0 when it does cumsum ಠ_ಠ
It was my imaginary cat in my head
@exedraj Using your Vyxal method?
correct
01:06
HaLpI 'M TrAped inSiDe ThE BoDy Of A CaT ! /??
@Dudecoinheringaahing if length of stack was 1 byte, I could get a 7 lol
Yeah, I was expecting that. What annoys me is that 05AB1E should have the perfect builtins and stack model to make this a walk in the park, but it just misses the mark
Why did adnan make length of stack .g?
yea, so close but so far
@exedraj Because length is g
01:08
@exedraj not as if getting the length of something is an extremely common operation or anything, nahhhh
Well, length of stack is rarely needed for a high-level language :P
@rak1507 but why does it have to be a digraph
I was being sarcastic
yeah I could tell
That's one thing I like about Jelly vs stack languages is that you never have to balance builtins that operate on either the stack or the top element
01:09
@exedraj oh, well, yeah I agree it shouldn't be a digraph that's dumb
11 in jelly is pretty decent really, would be nice if swap first two elements was a single byte, not sure how often it comes up but at least a digraph maybe
The thing is that g is well-defined for integers (cast to string, length), so it can't do what O does (sum of ToS if list, else sum of stack)
inb4 stax wins with source compression somehow
@rak1507 Head rot (rotate the first n elements one step to the left) would be great tbh
yeah
would save on the separator as well right
01:11
So that would be œṙ2, and you could get rid of the separator
9 bytes in Jelly for a stack-centered challenge is pretty good :P
and if it was a single byte it could be 8
Next up: deque-centered challenge :P
@rak1507 Yeah, if Œs (or whatever) was special cased as œṙ2 it'd match Vyxal, which has the right stack model and the builtin as a builtin
yeah
> the builtin as a builtin
that lowkey confused me at first
01:15
Every 60 seconds, a minute passes in Africa :P
> the builtin as a builtin an element
ftfy
@emanresuA ===============]
(No joke, that was actually what my cat's paw just pressed)
@DLosc Don't believe you, I reckon you're the cat :P
@Dudecoinheringaahing [shrug] Who knows? Maybe you're the cat. Maybe we're all the cat...
01:20
Lynn Lynn'd it again
ok, how does that work
œ? is "Permutation at index x of the items in y (where y defines the sort order of those items)"
1st permutation is the list unchanged. 0th permutation is prev of it, which is entire list reversed. -1th is prev of that, which is entire list reversed, then last two elems swapped
U then reverses that
01:22
Yes
wow, that is insanely high iq
Jelly sus
@Bubbler (Was in the middle of typing out what -œ? meant before you ninja'd me :P)
I did think of using œ? but didn't think of generating the reverse permutation
Given that Jonathan Allan added œ? and it's 3 variations, yes, very high iq :P
œ¿, œ?, Œ¿ and Œ? :P
My headcanon is that he chose ? to indicate it's confusingness :P
01:24
:P
But yeah, using permutation index is so powerful at times
someone smarter than me feel free to edit in a proper explanation rather than handwaving :P
I'd suggest changing -œ? to be "-1th ordered permutation, i.e. second-from-last. This will always be the array reversed with the last 2 elements swapped"
Or you can quote my message verbatim :P
if it helps humanize the events, I came here to say that I thought of U2œ?U first and didn't just look at it and think “oh duh, -œ?U
yeah yeah whatever 'I am definitely not an all knowing being' mhm sure
01:30
That still involves going "How can I swap two elements? Oh, I know! œ?!" :P
@rak1507 oh, the key word is, "This will always be the array reversed with the last 2 elements swapped"
(and then U un-reverses it again)
I'm totally gonna start telling people U stands for un-reverse
It's "upend" IIRC :P
@Lynn blame caird for that :P
> This will always be the array reversed with the last 2 elements swapped"
01:36
what
I copy pasted it
how did that happen
Magic ¯\_(ツ)_/¯
You may have copied it in the 10 seconds before I added in the "reversed" :P
lol, yep
I wanna create this binary matrix and then matrix-multiply it with the input:

[1 0 0 0 0 0 0 0] [a]
[0 1 1 0 0 0 0 0] [b]
[1 0 0 1 0 0 0 0] [c]
[0 1 1 0 1 0 0 0] · [d]
[1 0 0 1 0 1 0 0] [e]
[0 1 1 0 1 0 1 0] [f]
[1 0 0 1 0 1 0 1] [g]
well, that didn't go well, but it's still readable
@Lynn I never expected out-of-range index to work there...
I feel like I recognise that matrix
01:44
The matrix looks like a lower triangular checkerboard matrix with 2nd column repeated
what is that from
oh, right, that solves the problem
-rot transform, obvs
it looks suspiciously similar to something else I was doing a while ago
you could start from [1, 0] and then iterate C,1 (in Jelly terms) to generate the rows
@Lynn This is going to be like your Padovan answer, isn't it :P
01:45
[1,0] [0,1,1] [1,0,0,1] [0,1,1,0,1] etc
if you manage to outgolf me I will be extremely annoyed impressed
then dot-product each of those with the input? I hope dot-product has the right behavior when one list is short, fingers crossed
@Lynn You're already at 7 bytes at that point tho :/
@Lynn There are 2 dot products, that have different behaviours
pads with 0, æ. pads with 1
Maybe start with 0,1 and iterate with (Z with some dot)C and do U at the end?
ḋ should work at the very end
probably the worst thing about this approach is that you need to specify the iteration count
01:50
@Bubbler That's probably be shorter, as there isn't a digraph for 1,0 (superscript 5, D sometimes works, depending on the chain)
DLosc's answer is making me think this is somewhat Fibonacci-esque, and that ¡ has some crazy short dyadic link
02:07
14 though, pretty short still
wow nice
lynn is about to golf that down probably :P
Prefixes is OP
so glad my first lesson tomorrow is at 1:45 not 8:30 so I can stay up golfing :P
0
A: "Hello, World!"

emanresu ATarfish, 160 bytes x++++++++++++++++++++++++++++++++:+:+++++++++++:++++++++++++++++++++++++++++:.+++++++++++++++:++++++++++++++:.+++++++:::..+++:.{{{.{.{{.}}.:++++++.:.--------..; Tarfish is an esolang of mine that is a more tarpit-style version of ><>. This answer doesn't really use that much o...

02:15
Oh yes, that answer.
It's... verbose.
you don't say
damn
nice one, wouldn't have thought of using a matrix product
I guess I should post it
Go ahead
02:32
codegolf.stackexchange.com/a/233671/3852 why did I type all that it's 4am
nice answer
ohh J>2 that is clever
On mobile, so I can't try it, but could you replace >2 with and C with vectorising logical not?
Or would that mess up the first row?
You mean J’¬;¥\Ḋḋ?
if you read the rows backwards, as binary numbers:
1, 110, 1001, 10110, 101001, 1010110, ...
1, 6, 9, 22, 41, 86, 169, ...

a formula generating those numbers is `floor(pow(2,k)/3) xor 3`
but J‘2*:3^3BUḊḋ is pretty long
@Dudecoinheringaahing I need the actual 1s because they are the right arguments to ; in the scan
@Lynn Which also happens to be the output for the fourth test case.
02:45
@Lynn :(
CMC: Create a Jelly program that never halts. You may not use any quicks. Shortest wins
Segfaults due to infinite recursion (e.g. no TCO) count as halting. You should hit the 60s timeout on TIO
i think 9!!! works lol
wait, you can do like ⁹!!
That will halt tho
@Dudecoinheringaahing I have a very boring 13 byter
oh wait, i misread it as just that it should hit 60s lol
@exedraj Eval as Python?
02:55
;p
Fair enough, but I bet there's a pure Jelly way :P
v keeps segfaulting on me
I got it down to 10 bytes with string compression
7 bytes kinda using quicks but not in the main program: “1 1¿”V
lol bruh
“ƬÄ¡ṾEı» for 10
no wait
I forgor the eval as python part
well if you can cheat with quicks like that then just do ӂV
02:59
lol
03:11
I really don't know why my school has five spanish teachers, a sign language teacher, and no french, german, italian, or japanese
Because Texas?
Sounds pretty reasonable for a U.S. state adjacent to Mexico IMO.
Seems like there could be slightly more options though :/
True. Maybe change out one or two of the Spanish teachers for something else.
@BrowncatPrograms budget funding issues?
I doubt it
03:27
Lack of specialisation?
Oh hey, I'm starting to get email spam from actually good colleges for once
Ooh nice
Top Ten Reasons You Should Attend MIT! Number Seven Will Shock You!
03:42
I'm aiming to go to a college somewhere around the top 20, since most of the ones higher than that that I've looked at don't accept many AP tests
 
1 hour later…
not funny didn't laugh
the video I linked is actually cursed
@exedraj yes it is
@exedraj well for me it was pretty funny
@exedraj wtf
@hyper-neutrino yes
04:50
i am going to go listen to the original song to attempt to clean my mind of this ungodly eldritch horror
oh hyper's back in his λ form
Me: Looks at ngn/k's implementation to learn how reshape works.
Also Me: Looks pretty readable: https://codeberg.org/ngn/k/src/branch/master/h.c
it looks liek an esolang; i cant understand anything except the include header
oof there is like 50 macros defined
This is the way of Arthur Whitney.
CMC: Given a list of 9 numbers, reshape it to 3 by 3 matrix. Don't use reshape builtins
Define builtins
05:00
Any builtins?
Jelly: s3, split into chunks of 3
(Jelly does not have reshape in the APL sense)
@PyGamer0 Vyxal: 3ẇ
(we don't have reshape in the APL sense either)
@exedraj split into 3 chunks?
chunks of 3
> `s` Split into chunks
`#` Reshape (APL/k)
^ which is more useful?
05:05
@PyGamer0 but if you want something more fun: 0 3"3 6"6 9"Wƛ?ni
@PyGamer0 both
@exedraj what does that do?
@exedraj nice
@PyGamer0 input[n] for n in [[0, 3], [3, 6], [6, 9]]
because indexing a list with a list treats the index as a python slice
yes I saw that
very cool
@exedraj i updated the flags
05:11
very good
05:32
CQ: CLike Structures in esolangs?
@PyGamer0 ⎕⊂⍨9⍴3↑1 in APL then?
When a language properly supports declaring and using C-like structures, it is no longer an esolang
If you remove the "declaring" part, it just becomes a tuple
> it is no longer an esolang

???
which can be simulated relatively easily in many esolangs
05:58
how do i implement (APL's) reshape in python?
ngn
ngn
@PyGamer0 k6 has that as (0N;n)# or (n;0N)#, in k9 it's n^
06:09
@PyGamer0 First adjust the length of the list of elements, then split into chunks from the last axis to the first
06:22
@Bubbler ^ gtp3 with my modifications
doesnt work like ⍴
also horribly breaks on higher axis
wdym breaks on higher axes it doesn't even work on your sample case
your list comp is definitely wrong; your loop should either have a step argument or you should be multiplying i by the interval size
> your list comp is definitely wrong; your loop should either have a step argument or you should be multiplying i by the interval size
not mine
that is generated by gtp3
in The Edge of Propinquity, 12 mins ago, by exedraj
def reshape(shape, l):
    if len(shape) == 1:
        return l
    else:
        return [reshape(shape[1:], l[i]) for i in range(shape[0])]
well that's impressive for something made up by a computer then
it's still totally wrong but like. it's sensible enough that it didn't look immediately blatantly dumb
It's the codex model
Trained on open source
Same stuff that powers copilot
06:30
aight i think this works? idk tho
Yeah, that's pretty impressive for machine generated code. It got the basic approach (almost) correct after all
@hyper-neutrino yes it does thx
lol, nice
to be clear there's almost certainly a much more intelligent way to do this
than to turn the list into a deque and just keep rotating it
but i am too lazy and it is 2:40 AM
its fine for now
06:47
@hyper-neutrino Sounds like itertools.cycle
 
1 hour later…
07:59
how do i make reduce_first(
as a complement to this
@PyGamer0 Your reduce is actually reduce_first I think
@Bubbler oh yeah
so how do i do reduce?
08:17
@PyGamer0 Recurse until you've got a list of numbers, then reduce on it
@PyGamer0 Implementing APL?
@Adám no
actually i might do that in the future
but not now
@Bubbler is this it?
now i need vectorise1( vectorise2( vectorise3(
i think i will copy that from vyxal or something
@exedraj why is there a custom vy_zip(?
where is jelly's generic vectorise function?
08:40
@PyGamer0 because normal zip doesn't pad shorter iterables with 0
@PyGamer0 Looks good
@exedraj you can use itertools.zip_longest
The wikia has someone called 'redwolf'. Who's that, never heard of them ;p
one 3 too many
LEEET
08:57
@emanresuA 1+3+3+3+7 = 17 which is prime
@emanresuA and oeis
@PyGamer0 and monadic also done
09:13
Good job
ty
Fun Fact: I made all the functions in tio.run first before copy pasting them.
That's actually quite a good idea :p
 
2 hours later…
11:32
Better than bogosort - gobosort!
11:43
@Bubbler It has mold, which is similar :P
> Jelly
> mold
@Dudecoinheringaahing is that deliberate? :Þ
No, Jelly's moldy.

« first day (3860 days earlier)      last day (1279 days later) »