« first day (411 days earlier)      last day (2246 days later) » 

10:05 AM
The APL Germany Spring Conference will take place on 16th -17th April 2018 at ergo / DKV in Cologne - for details see https://apl-germany.de/apl-germany-fruehjahrstagung-16-17-april-2018/
 
 
2 hours later…
11:57 AM
@ngn uh, I've been painstakingly trying to golf my solution since yesterday, but there is no combination which can make it shorter, maybe yours uses a completely different approach?
 
12:07 PM
in fact, every other combination makes it longer
 
12:23 PM
bleh, I have a fully tacit solution at 25 (i.e. one more) bytes: f←(⊂⍳3)(⊢∊((-@3∘⌽⌽)/,))⍨⌽
 
 
1 hour later…
ngn
1:37 PM
@EriktheOutgolfer I'm not sure how to judge "completely different". What one person sees as permutations of ⍳3, another may see as a parities and mod-3 operations, and mathematically those would be representations of the same group.
 
That subtle hint though :p
 
@J.Sallé you mean where it says "parities and mod-3 operations"? no, that's not a hint at all, just a different POV of my already existing approach
 
@EriktheOutgolfer if you say so.
 
@ngn it's not exactly permutations of ⍳3, the (-@3∘⌽⌽)/ part executes the moves
 
ngn
@EriktheOutgolfer so, rotations of 1 2 3 with varying +- signs before each of them?
 
1:52 PM
@ngn if you go left, the transformation is {(a b c) -> (a c -b)}, if you go right, the transformation is {(a b c) -> (c b -a)}
|(a b c) is a permutation of ⍳3, yes
 
ngn
@EriktheOutgolfer ah, right, permutations, not rotations... I misread one of the ⌽
 
@ngn yeah the left is reverse
 
ngn
2:07 PM
@EriktheOutgolfer To be honest, when I tried to solve this problem, I didn't imagine permutations. I hope this isn't too much of a spoiler: I thought about how the axis changes as the ant travels from edge to edge, and also about the parity of the number of times the ant has been on each axis. And, as you might have guessed, my solution does make use of a cumulative reduction somewhere in it :)
 
@ngn cumulative? only you can manage to make those practical in such a problem...
 
2:33 PM
@ngn hm, that looks like it would be longer, but, in fact, it doesn't work at all
 
ngn
@EriktheOutgolfer I don't understand what you're trying to do there
@EriktheOutgolfer mod 4??
 
@ngn well, a cube has three axes, of which two rotate
let's assume these are the faces of the cube
   ¯2
¯3  1  3 ¯1
    2
then axis x crosses through faces 1 and -1, axis y crosses through faces 2 and -2, and axis z crosses through faces 3 and -3
@ngn now, if the ant goes left, axis x rotates:
   ¯2
¯3  1  3 ¯1
    2

   ¯3
 2  1 ¯2 ¯1
    3

    2
 3  1 ¯3 ¯1
   ¯2

    3
¯2  1  2 ¯1
   ¯3

   ¯2
¯3  1  3 ¯1
    2
@ngn as you can see, after 4 rotations, the cube comes back to original
that's why I modulo by 4
 
ngn
@EriktheOutgolfer I see. But you seem to assume that those rotations are independent - e.g. that "turn x, turn y" would take you to the same edge as "turn y, turn x"
 
however, let's suppose the ant goes right
@ngn no, that's what I'm trying to explain
 
ngn
@EriktheOutgolfer ah, sorry, go on
 
2:49 PM
   ¯2
 1  3 ¯1 ¯3
    2
now, try turning x again
   ¯1
¯2  3  2 ¯3
    1
nope, the other axes don't move according to your needs
that's why you have to pick the appropriate axis each time
@ngn and therefore, the code becomes longer
 
ngn
hm... why don't you try to solve a simpler problem first? - which axis (x, y, or z) will the ant be walking along at the end of its route
after that you'll have to solve another simpler problem: will it be on the + or - side of the other two axes
2 easier problems are better than 1 hard :)
 
3:12 PM
@ngn that can be done with simple indexing/rotating, but costs a heck lot of bytes
 
ngn
@EriktheOutgolfer it can be simplified, once you see through it
 
@ngn the layout should be similar to what my posted answer currently has
(which is a heck lot of bytes)
 
3:41 PM
For what its worth, I found a fairly short solution earlier today. I am on mobile so I can't golf/test fully yet though
 
 
2 hours later…
5:39 PM
0
Q: How can I generate a random array using 0-9 and a-z, in APL

Richard Adams?5 5⍴CHARS where CHARS is a variable containing 0-z. The roll operator won't accept CHARS since it contains non-negative integers, namely the letters a-z.

 
@EriktheOutgolfer I have a 21 byte solution with a different method (although it looks quite similar to yours), I'm still looking to golf it into a train, but I will post it later
 
6:40 PM
@Adám if you could take a look at my answer to @Feeds I'd appreciate it :)
 
6:58 PM
@J.Sallé Looks good to me. You made some assumptions which I made differently, and that's a good thing!
 
tbf I've flagged that question as unclear
 
@Adám I totally forgot about ⎕D :p
Other than that I think I did quite okay for the first answer I ever gave on SO
 
@J.Sallé Well, you literally give the users numbers, which is a valid assumption.
@J.Sallé Yes, absolutely, and OP can combine parts of our answers to get exactly what he wants. One issue (with both of our answers) is that we assume he uses Dyalog APL. He never wrote that or indicated that with .
 
 
2 hours later…
8:36 PM
0
Q: How can I keep track of a single variable in a vector, in APL

Richard AdamsFor example I have a vector H2DH2DH, is there a way to count the number of 'H' variables that appear?

 
8:54 PM
@ngn 21 bytes:
0
A: An Ant on a Cube

H.PWizAPL (Dyalog), 21 bytes f←{x≡(↓∪⊢∘⌽)/⍵,x←⊂⍳4} Try it online! (Using the testing environment from Erik the Outgolfer's answer I take left and right as 1 and 2. This uses the following permutations of abcd: 1 : bcda 2 : cdba I apply the permutations corresponding to 1 and 2 to ⍳4 : 1 2 3 4,...

 
ngn
9:21 PM
@H.PWiz very nice :) still above the target, though
 
Hmm, I might take a look at your conversation with Erik for tips
 
ngn
@H.PWiz your input and output formats are a bit dodgy...
 
@ngn Yes, I misread that section, and took it to mean anything that isn't too cheesy, I'll delete for now
I might be able to get something similar with ¯1, 1 though
 

« first day (411 days earlier)      last day (2246 days later) »