« first day (4824 days earlier)      last day (22 days later) » 

12:01 AM
Well most built-ins in a golflang only need to return 1 thing
Meaning the only time you're getting benefit from multiple return is with user defined functions
And when you're using those, typically you're using them in contexts where 1 return value is used
So I don't see how not having it is losing power
 
12:18 AM
maybe it’s not as useful in a golflang
@lyxal if you call a filter or something it could be useful to return two different booleans to make two lists each which was filtered by something slightly different, for example
 
why wouldn't you just dup filter1 swap filter2?
 
ofc but it could be shorter if they share logic
also on filter1 filter2 would be shorter
does vyxal have on?
 
divmod is one possible case for multiple returns
 
yeah neil suggested it above
 
I'd argue divmod should be a list
[div, mod]
 
12:25 AM
and doesn't 05ab1e get some mileage out of its uninterleave sometimes
 
that's just standard uninterleave
 
uninterleave should certainly give two separate lists
 
think there's also some stack language that has a single byte for dup reverse
 
that seems kinda useless tbh
 
@UnrelatedString bifuricate?
 
12:26 AM
there is a reason i didn't mention remembering seeing it do anything :P
 
you could do palindromise halve in vyxal right?
does halve give two lists or 1
 
@noodleman it has its benefits
like, for example, i do X to your source code, you do X to the output challenges
very helpful for those
in Vyxal
stole it from 05ab1e
which uses Â
@UnrelatedString 38 uses on the site in Vyxal 2 as of Jan 2023
which is more than something like discard (_) and join on (j)
 
@noodleman so would parallel-apply: filter1 filter2
@noodleman also, in the bytes you've used for applying two different conditions, you could have just used two separate filters
 
oh yeah
perhaps i’m not in the best position to speak on stack golfing languages considering i’ve only used vyxal and golfscript and my vyxal knowledge is limited : -
 
12:37 AM
tbh I think the power loss you're thinking of in most stack golflangs is a lack of a modifier system
which is something I think is a valid observation
modifiers + a function as stack values system does better than direct application functions
 
(well i also used thunno but we don’t talk about it)
 
lol
 
i don’t necessarily agree that vyxal really benefits from having first-class functions
modifiers definitely though
 
@noodleman means you can have built-ins that act as soft modifiers
while still giving normal built-in functionality
 
well i’m thinking of how uiua deals with it
which is to effectively have first class functions except that they don’t exist in the stack
 
12:42 AM
@noodleman I'm talking in terms of codepage utilisation and golfiness
 
i have personally never used a function object in vyxal
soft modifiers? like, only if top of stack is a function then modify it, else do something else?
 
@noodleman things that would otherwise (or should) be a modifier but codepage space restrictions make that not possible
 
ok yeah
 
ȯ for example
first n numbers where a condition is truthy
for example, that's a modifier (quick) in jelly
but in vyxal it's an element
and it takes a function object
 
yeah i get it
 
12:45 AM
I know you do but for the sake of other people :p
 
japt does it like that also
although japt first class functions are a whole mess
you can’t define a function and call it later, you can only do operations like run until true, run on first N integers, etx
 
also, first class functions make things like custom modifier definitions easier in vyxal 3
 
oh custom modifiers? cool
yeah it that would make parsing easier
 
my phone keeps autocorrecting “ig” to “it” and “if”
 
12:50 AM
:(
 
different topic, but boy i sure love the hyper sensitive scroll speed of visio
because I find myself once again using visio
to document the control flow of the Java BigInteger compareTo method
and boy did the BigInteger implementors love ternaries
 
@lyxal google drawings
 
I have a visio subscription from the uni I'm gonna make the most of it gosh dang it
even if it means suffering through the $1000 program that's surprisingly less stable than word
and less intuitive than other sites like diagrams.net
 
my brother has used google drawings to make actual art lol
granted, not particularly visually appealing art
 
okay visio has slightly redeemed itself
you can add custom connection points to shapes
which makes things slightly better
 
1:04 AM
excalidraw is also really cool for making diagrams but it's probably a different use-case than you have
 
but does excalidraw ask the important questions?
where are the shapes?
 
 
1 hour later…
2:19 AM
copilot probably knows
 
Many tasks so if locked, go to handle a new task rather than wait, so that everything is in user mode. What is it named?
 
 
3 hours later…
att
5:29 AM
@emanresuA is that for arbitrarily many primes
 
I was thinking of all primes but I'm not sure if that exists
 
Tbw
I've been thinking about it for a while now.
Definitely works for 3 primes, but there seems to be many possible structures, much less constricted than 2.
For all primes, if our solution is symmetric between the primes, it amounts to finding a certain coloring of Young's lattice, where for every node, it or one of its direct successors is colored
 
att
I think you can inductively build a structure
for +1 in a new dimension shift the solution in the lower dimensions by 1
hm, but it will go back to 1
 
Tbw
for 2,3,5 the simplest solution is 2^a*3^b*5^c * k where a = b = c mod 2
whereas the structure for the 2,3 case is a=b mod 3, and neither of these really work for 4 primes
 
For 2,3,5,7 I think 2^a*3^b*5^c*7^d where a+b+c+d mod 5 = 0 works? And that appears to generalise?
 
Tbw
5:43 AM
but then none of 2,4,6,10,or 14 are included
 
Ah, I see
 
6:03 AM
2^a3^b5^c7^d,a+2b+3c+4d=0(mod 5) any fault?
Should be correct
and pattern go
@Tbw This maps [0,1]a+[1,0]b+[1,1]c=0(on F_2^2)
 
Tbw
@l4m2 yeah this works for any number of primes
 
Now consider composites. 1-2-4 is possible(0/1/2), 1-2-3-4(0/1/3/2), 1-2-3-4-5-6(0/1/3/2/5/4)
 
att
oh that's cool
 
Tbw
1-2-3-4 is the same as 1-2-3
 
@Tbw How?
 
Tbw
6:18 AM
any 1-2-3 sequence is a 1-2-3-4 sequence
 
att
can we generalize to 1,-1,2,-2,...?
 
Tbw
oh wait im wrong
there are no 1-2-3-4 sequences
Since any 1-2-3 sequence has n implies 6n = 3*2n, and 8n = 4*2n
 
1-2-8 is impossible. If X is chosen, then X/8..8X(6 elements) can't
 
Tbw
that only outputs 1s
 
6:30 AM
@Tbw The 1s count for each n
Does ratio converge at 0.47252747?
 
Tbw
i'm still confused. what are the first terms of the sequence?
 
Why does the fs.writeFileSync fail?
 
att
can't you console.error?
 
Tbw
@att ok now that we know it's possible, i'll post the challenge
 
att
hopefully that's not overlooking something
 
Tbw
6:43 AM
no i definitely works. as long as you map each prime and 1 to the elements of a group bijectively, (with 1 as identity) it works
 
att
ah of course
 
Is the all primes version 1-2-3-5-7-.. impossible?
 
Tbw
att's solution solves the all prime problem
 
What does it do?
 
att
filter a-b+2c-2d+3e-3f+...=0
 
Tbw
6:49 AM
for 2^a 3^b 5^c 7^e...
 
See, modulo on F_2^inf
 
Tbw
Well this is actually on (Z,+). Any countably infinity group works
 
F_inf^inf
 
att
so any bijection and any sum
 
0
Q: Output a 1-2-3-5-7... sequence

TbwFollow-up of my previous challenge, inspired by @emanresu A's question, and proven possible by @att (Mathematica solution linked) For the purposes of this challenge, a 1-2-3-5-7... sequence is an infinite sequence of increasing positive integers such that for any positive integer \$n\$, exactly o...

 
7:02 AM
@Tbw Seems 1,2,3,4,... would fail, what's the other rule?
 
Tbw
That's not a group
has no negatives
 
so -1,1,2,3,... is fine?
 
Tbw
Every element has to have an inverse, something that you can add to it to get 0, its negative
 
Do ±1,±3,±5,... work?
If no then there's only one choice
Seem no
 
att
no, 1+3 doesn't have a negative
 
Tbw
7:12 AM
@l4m2 no because you need 0, and even if you add 0, then it's still not closed under addition. There are still many ways to do it because there are many countably infinite groups and uncountably many bijections from the primes to each of those groups
Correction: it must be an abelian group
 
Does Pxeger's solution extend here?(choose x, then remove x*p^k)
 
att
assign every number a value v(n) such that v(mn)=v(m)+v(n)
if v(n)=0 then it's in the set, if not then v(n p) is iff v(p)=-v(n)
also need v(prime)!=0
 
 
2 hours later…
9:00 AM
@NewPosts Seems like the answer to #2 (natural density) is 0? I don't have a formal proof, but the proportion of elements under some N converges to 0 as N grows arbitrarily large
 
att
9:27 AM
I wonder where/if the greedy algorithm breaks
 
If the greedy algorithm becomes too fat, their stomach explodes. When that happens, it’s probably broken.
 
att
10:18 AM
i think the greedy algorithm might actually work
 
room topic changed to The Nineteenth Byte: The Nineteenth Byte: General discussion for codegolf.stackexchange.com | Guidelines: cgcc-se.github.io/chatiquette | Use The Sand Trap (chat.stackexchange.com/transcript/136286/the-sand-trap) for off-topic discussion (no tags)
I must say, this last week of chat has been some of the best fun I've had here in a long time
 
11:36 AM
@lyxal will you answer your own meta post?
 
eventually
 
 
1 hour later…
12:48 PM
I might let a few other people answer first
 
Forgot to turn off ratio computer of 272546, it's now 0.4725274725
 
1:19 PM
0
Q: Print all legal chess moves

anatolygThe game of chess has moves. Lots of moves. But how many, exactly? In this challenge, you must print all possible chess moves for a single player (black or white — you choose). Moves are distinguished by the piece, the starting square and the ending square. Also, if the move is a promotion, moves...

 
 
3 hours later…
3:58 PM
I finally have it
 
4:20 PM
@NewPosts bah, @Arnauld FGITW'd me by 58 seconds
 
@NewPosts I couldn't be active enough in TNB the past weeks to post a separate answer, but I do feel like the chat was better than before
 
 
1 hour later…
5:24 PM
If I have a to the power x, then x is the exponent but what is a called?
 
5:40 PM
the base?
 
@mathscat yes
it is called the base
But that was already answered in the Math.SE chat
 
 
5 hours later…
11:06 PM
CMC: given a printable ASCII character, output another printable ASCII character such that the XOR of their codepoints is a third printable ASCII character
i/o can of course be with the codepoints themselves
i was so close to sandboxing this to post on main, until i stuck with it for another two minutes and found a solution that's juuuuust a bit too simple :P
 
@UnrelatedString x=>x<96?96:32
 
...okay so even my trivial solution was overthinking it lmao
but it's also two bytes shorter
correction: my solution ported to js beats yours by two bytes, but your solution ported to jelly beats mine by one :P
 
11:33 PM
oh wait they're straight up complementary
(my original solution was &-65+32)
 

« first day (4824 days earlier)      last day (22 days later) »