« first day (1 day earlier)      last day (2368 days later) » 

1:31 AM
@HyperNeutrino you need a quick
Also, the generation of the array can be done much more golfily.
 
user165474
Oh alright. I don't like the idea of using so many increment/decrements.
 
user165474
I think it could be much shorter.
 
user165474
Can you give me a hint for the array generation? I might be missing an atom that I can't find, perhaps.
 
Generate the flattened array first.
 
user165474
Ohhhh...
 
user165474
1:36 AM
Whoops.
 
user165474
Right, I made a 5-byte program to squarify a matrix >_>
 
user165474
Thanks!
 
user165474
@LeakyNun ²R$s lol
 
The $ is extraneous
 
user165474
Hm. I forgot to test without it.
 
user165474
1:42 AM
Even better :P
 
[monad][monad][dyad] is always sequential
 
user165474
Oh okay, I see. Thanks.
 
user165474
lol 13 bytes -> 3 bytes what was I thinking? :P
 
that happens
 
user165474
though the arrays are now in the opposite direction. shouldn't cause issues though
 
1:43 AM
3
A: Generate all Brain-Flak Snippets

SvetlanaPyth - 83 74 71 64 bytes K("\[]""{}""\(\)""<>")Fd{.psm*:@Kd*\\2k@QdU4JdVldFHK=J:JHk))I!Jd Try It

I golfed down a 64-byte answer by half
(and why still hasn't s/he used my version?)
 
user165474
Oh, wow! Beautiful.
 
user165474
Nice :)
 
user165474
@LeakyNun I'm guessing that I will need ¦.
 
That is a good guess.
 
user165474
Alright. Thanks. (I was looking for something like that but I missed it the first time ???)
 
user165474
3:47 AM
@LeakyNun So, right now I have the following code:
 
user165474
RḂÐf
²Rs
 
user165474
The first link will give the indices that don't need to be reversed (though I can easily do it the other way around)
 
user165474
The second (main) link gives the square matrix
 
ok.
 
user165474
But I can't seem to figure out how to do the last part (before formatting)
 
user165474
3:49 AM
RḂÐf
²RsµU³Ç$¦
 
user165474
This is what I have
 
user165474
but it gives an error saying that ints are not iterable
 
user165474
What I want it to do is apply "reverse" to the indices given by the first link
 
4:01 AM
@HyperNeutrino instead of $, you should use ¤.
 
user165474
Oh hm. I need to look at what that does. Thanks.
 
I believe $ will link U³Ç together instead, but I am not sure.
 
user165474
Alright.
 
user165474
Perhaps.
 
user165474
Turns out I need the filter-in not filter-out. :P
 
4:03 AM
lol
 
user165474
Well this works (without the output formatting):
 
user165474
RḂÐḟ
²RsµU³Ç¤¦
 
indeed it does
 
user165474
I think I get how the square box thingy works, but I'll wait for Dennis to reply to you to see what the $ actually does
 
The formatting is just a monad.
 
user165474
4:05 AM
A single monad?
 
user165474
G
 
user165474
RḂÐḟ
²RsµU³Ç¤¦G
 
congratulations
 
user165474
Yay :D Thanks!
 
user165474
Apparently it could be one byte shorter. Hm. (I think)
 
4:06 AM
how?
 
You shouldn't look at the answers.
 
user165474
Oh true. Sorry.
 
user165474
I'm going to do this challenge without looking at the Jelly answer (if one exists).
 
user165474
4:19 AM
Oh yup, you have an answer. (userscript to tell me the winner)
 
user165474
Ooh, 5 bytes. Hm. Interesting.
 
can you link to the userscript?
 
user165474
 
thanks
wow
 
user165474
No problem
 
user165474
4:38 AM
@LeakyNun I got this for 10 bytes... badly golfed; this is my first attempt using a pretty straightforward method.
 
user165474
Oh. Hm.
 
user165474
Whoops, forgot to consider duplicate elements.
 
user165474
@LeakyNun So, my next method is to somehow get rid of one instance of the current number. I thought of an old method I used to get a desired value to the front, which was good for Python but maybe not for Jelly, was to slice the array up until that point and move the slice to the back (kind of like linking the array to itself in a loop and cutting it at a different point). I did this with Python using list splicing; I could theoretically do that with Jelly, but it might be too long.
 
@HyperNeutrino you would like to search the documentation
 
user165474
4:48 AM
Yes. I'm assuming there's a built-in to move a bunch of elements from one side to the other.
 
how would you name that built-in?
 
user165474
Well, let's see.
 
user165474
I'm going back to the loop thingy I described.
 
user165474
Rather than cutting it off at a different point...
 
user165474
What if I moved the elements?
 
user165474
4:49 AM
Would that be called translating?
 
guess again
 
user165474
Hm.
 
user165474
Since it's on a loop.
 
user165474
So...
 
user165474
Rotate?
 
user165474
4:52 AM
?
 
user165474
That looks promising.
 
user165474
@LeakyNun So just doing doesn't work because it's rotating by the current element, so I need to rotate by the index, but I feel like using enumerate would be too long.
 
you need a Jelly mindset
 
user165474
Yes. I suppose that's probably mostly what I'm training for right now.
 
you don't need enumerate
A Jelly mindset involves vectorization and parallel
 
user165474
4:57 AM
Oh, since the indices are just a list of increasing consecutive numbers, I could just use LR to get the length and get a range from that.
 
user165474
Or apparently I could use J because there's a single atom to get a range up to the length of another array.
 
user165474
ṙJ rotates it into the right place.
 
user165474
@LeakyNun my thought for removing the first element in every array was to zip, take out the first array altogether, and then zip again.
 
user165474
But it looks like the first zip is unnecessary, because it gives the same thing back (which makes sense)
 
user165474
Oh wait, because J starts at 1, I need to get rid of the last array.
 
user165474
5:10 AM
@LeakyNun ṙJṖZ gives me the arrays, and I just take the minimum of each of them I guess.
 
user165474
@LeakyNun this appears to work for 6 bytes.
 
congratulations!
 
user165474
Thanks! :D Now I need to figure out where that one byte can come off.
 
user165474
5:29 AM
It appears that operations seem to go column-wise between arrays.
 
user165474
So I don't need to zip.
 
a good direction
 
user165474
But ṙJṖṂ won't work because will just compare the sub-arrays individually...
 
user165474
Wait, lemme see what's equivalent to but requires vectorization
 
user165474
Well I guess there are two ways of finding the minimum.
 
user165474
5:34 AM
The first is to run through them all, replacing the variable value if the current value's smaller
 
user165474
but that doesn't sound very Jelly-ish
 
user165474
because it has variables and those don't exist per se in Jelly
 
user165474
Or, keep chucking out any element that is higher than another element.
 
user165474
So assuming there's a built-in to take the minimum of two values, just reduce over that? maybe?
 
user165474
@LeakyNun ṙJṖ«/
 
5:40 AM
check my answer
 
user165474
Alright.
 
user165474
Oh hey, they're identical. Hm.
 
@HyperNeutrino do my challenge? (don't read the answers though)
 
user165474
Which one? The totient?
 
yes, and what is your timezone?
 
user165474
5:48 AM
EDT (don't ask why i'm up this late; I typically don't sleep til 2)
 
user165474
Which means I will be going soon, in probably less than half an hour.
 
I will also be away soon
 
user165474
Alright.
 
user165474
Hm. I will probably need to think of this challenge from a mathematical perspective first.
 
user165474
Well obviously totient(n) < n
 
user165474
5:53 AM
So if totient(x) == n then x > n.
 
user165474
I could map over a generator and stop when I get the right value in Python, but I don't think Jelly has generators, so I need to figure out what the maximum of x will be.
 
user165474
Well if we have x = n**2 + 1, then all multiples of n up to x are in the list of coprimes, so we have totient(x) >= n. I conjecture that we will never need to go over this number, but I don't have rigid proof.
 
user165474
@LeakyNun Assuming that my conjecture is correct (which I will attempt to prove when it's not 2am), then ²RÆṪi: should work; square, range, map using totient, find the index, and divide it by itself to get 1 or 0 because the value has to be consistent.
 
did you test it?
you can read the answer now, and I'll be away now. See you.
 
user165474
I tested it with a few of your cases, but I will add 3 bytes to run through all cases on the OEIS.
 
user165474
6:02 AM
Alright. Thanks, see you later!
 
user165474
2:59 PM
I ran through the tests and from what I can tell, it works perfectly. I checked the answer, and it's pretty much identical (square, range, map to totient), but Dennis uses the function to check if it's in the array and I divide the index by the argument which seems to work, but actually might not work for certain values.
 

« first day (1 day earlier)      last day (2368 days later) »