« first day (1113 days earlier)      last day (1542 days later) » 

12:56 PM
Well, sorted the SEDE query by "most answers" hoping that will be an easy one, and codegolf.stackexchange.com/a/199379/571
 
1:41 PM
@TessellatingHeckler Amazing job for a first APL answer. Btw, there's really no reason to use Classic here, since you refer to my SBCS anyway. Also, I golfed you solution in a couple of places:
t←⎕AI
f←{3⊃⍵≠⊃a:⎕←'Fail'⋄'z'=a~←⍞←⊃a:⎕←3⊃⎕AI-t}
⎕DQ'Form'('Event' 'KeyPress' 'f')⎕WC⍨a←819⌶⎕A
I'll be happy to explain the tricks I used. Ping me if you want me to.
 
 
2 hours later…
3:35 PM
I think I am not understanding how ⊤ is supposed to work.
If I have 25 10 5 1 ⊤ SOMENUMBER, shouldn't the result be a vector of the number of quarters, dimes, nickels, and pennies that it takes to make up SOMENUMBER?
 
@JeffZeitlin It eNcodes the right argument numbers in to the mixed-base system given as left argument.
@JeffZeitlin Each base on the left represents how many of those you need to make one of the larger neighbour on its left.
 
@Adám Ummm... Can you explain that? That seems a bit confusing.
 
@JeffZeitlin 5 pennies to a nickel, 2 nickels to a dime, 5 dimes to a half-dollar, and 2 half-dollars to a dollar:
⍞←0 2 5 2 5⊤84
 
@Adám 0 1 3 0 4
 
So it says 1 half-dollar with 3 dimes, no nickels, but 4 pennies makes 84 cent.
 
3:47 PM
Oh, HO!
THAT is where my misinterpretation was happening!
 
@JeffZeitlin However, if you need to make change, then you can't really use since coin denominations do not form regular mixed-radix systems, rather:
⎕←25 10 5 1 ⎕SE.stamps 84
 
@Adám
25 25 25 5 1 1 1 1
 
What's ⎕SE.stamps?
 
@JeffZeitlin the stamps function from dfns.dws. You can import it with 'stamps' 'path'⎕CY'dfns'
⎕SE is a namespace which the bot uses to hold all of dfns.dws
 
Ah. So not really useful for golfing the problem, since I'd have to count the size of dfns.
And as soon as one of the radices is non-integral relative to the next smaller radix, you end up with weird results.
 
3:55 PM
@JeffZeitlin My Extended Dyalog APL has all of dfns built in. Just prefix each dfn name with . Try it online!
@JeffZeitlin ⎕CY'dfns' isn't that many bytes (you don't need to specify what to copy).
 
Actually, my understanding of the rules of code-golf was that if I explicitly imported anything, I'd have to count the size of whatever was imported - so I'd have to count the entire size of dfns if I used ⎕CY'DFNS' in Dyalog Unicode (but not if I used Dyalog Extended).
 
@JeffZeitlin I don't think that's right. You only have to count the size of the import statement:
11
A: On scoring imported functions

MegoScore is the length of the import plus the length of the function name This seems to be the standard around here. If there exists a built-in function (we'll call it foo) that solves the task, and built-ins are not forbidden, then, for a challenge that accepts functions and not just full programs...

 
OK, I stand corrected on that.
It does make it easier when dealing with standard libraries (which I presume dfns is considered as with Dyalog APL).
Hmmm... Looks like dfns.stamps is actually the core of the solution to that golf challenge. Feels like cheating, somehow...
 
4:12 PM
@JeffZeitlin Meh, sometimes there's a built-in for it:
5
A: Trivial Brainf**k Substitution Interpreter

AdámAPL (Dyalog), 49 bytes Prompts for program as text, then for a list of eight PCRE patterns. Note that this allows for substitutions of differing lengths, and even mapping multiple substitutions to each BF command, at the cost of having to escape some characters. Outputs to STDERR. ⎕CY'dfns' b...

 
⎕←+/25 10 5 1 ∘.= 25 10 5 1 ⎕SE.stamps 84
 
@JeffZeitlin
3 0 1 4
 
OK, now gotta figure out how to insert words between each of the elements of that vector...
 
@JeffZeitlin Do you need the 0 there?
 
Actually, no; the challenge says I shouldn't have it.
 
4:15 PM
@JeffZeitlin Btw:
 
That is, the desired result for 84 cents would be 3 quarter 1 nickel 4 penny
 
⎕←¯1+25 10 5 1(⊢∘≢⌸⊣,⎕SE.stamps)84
 
@Adám
3 0 1 4
 
@JeffZeitlin "quarter" not "quarters"?
 
Pluralization was acceptable but not mandatory. I could just as easily make it ... 1 nickels ...
and use the plurals throughout
 
4:17 PM
@JeffZeitlin How about you begin with
⎕←,∘≢⌸25 10 5 1 ⎕SE.stamps 84
 
@Adám
25 3
 5 1
 1 4
 
and then replace the values with words?
 
Gah. I'm on Chrome, so that ≢ messed up the quad-whatever (I can't make it out because of the tally).
 
@JeffZeitlin
 
Why does Chrome mess that tally up?
 
4:21 PM
@JeffZeitlin Long story.
 
That also implicitly means that the new Edge is also going to mess it up, since it's built on Chromium.
 
@JeffZeitlin OK, I have a solution, but I'll hold off if you want time to experiment.
@JeffZeitlin Yes, indeed.
 
Yeah, I want to see if I can get this myself.
The jot-dot-equals modification was my second thought toward getting the counts; my first was just doing the +/ four times
 
 
4 hours later…
8:46 PM
Is there a way to take a session from Dyalog and print it out?
 
@JeffZeitlin What do you mean by session? The log of everything you did?
 
More or less... I've saved a session, but I've decided that I want to be able to print it out, or better still view it in a text editor, so that I can take notes and/or annotate it while I work in a 'live' session.
I can load the session back into Dyalog and scroll up and down, but that's a bit inconvenient, and doesn't allow annotations
 
@JeffZeitlin OK, so you do mean the log. ⎕SE⎕WG'Log' returns the log as plain text so you can do with it whatever you want, including saving it to file with ⎕NPUT.
 
OK, thanks.
 
E.g. '/tmp/mylog.txt'⎕NPUT⍨⊂⎕SE⎕WG'Log' will save directly.
 
8:54 PM
(Oh, wow... [some of] the positively ancient )-command actually still work!)
 
@JeffZeitlin It should be pretty much all of them. You can even use the line editor with the commands designed for type write terminals, i.e. without the ability to erase anything.
 
I do remember starting to write a function with ∇Z←A FUNC B ... :)
Was a bit surprised when it put me into a visual editor.
OK, time for me to head home for the day... Tomorrow at 0930 US Eastern is the next cultivation, right? ⍣ with a function right operand?
 
Dyalog doesn't. Good old del-editor is still there. You can even type characters on top of each other to form overstrikes, e.g. S with | forms $. In fact, you can even do so under program control:
⋄ bs←⎕ucs 8 ⋄ ⎕fmt 'S',bs,'|'
 
@Adám
$
 
9:00 PM
@JeffZeitlin That's right.
 
Great! I'll be here! Have a good evening!
 
Thanks!
 
 
2 hours later…
RGS
11:16 PM
Hey guys! What is the APL Cultivation event? @Adám?
 
11:27 PM
@RGS It's a regular lesson on the APL language, held in this chatroom. You can access past lessons here.
 
RGS
That is really cool! I can't attend tomorrow
But I will check the past lessons
Are those in order of difficulty and/or appropriate for a complete beginner? I know almost nothing about APL
 

« first day (1113 days earlier)      last day (1542 days later) »