some of the examples are not copy-paste-able, e.g. there's a hard to notice extra space in NumNumNum ' 10713223141516271819'; MakeMines' and CountMines' output is split vertically and gets copied as multiple matrices
"the argument to the functions you will write will a character array" - missing "be"?
how do i #.Submit if i use .dyalog instead of .dws?
in Romberg: "$R^n_n$should be computed at most once for each m and n" (that's an R with subscript n and superscript n) - the superscript should probably be m
Simple code puzzle, "Add 1 to each digit of a number, but no carrying, nines just become tens, e.g. 449944 becomes 55101055". APL 3 days, PowerShell 30 seconds. But I'm quite pleased I could solve without a loop of modulo/remainder; tio.run/##SyzI0U2pTMzJT///PyUzPbOk@FHbhOpHvVsfdS151LvC0OBR7xYg/…
@Adám Thank you; I had to stare hard at (,1,⍨⍪10=n) to parse it and work out that it wasn't doing a catenate-selfie, the only bit I can't follow now is how you came up with it, and I guess that's just a lot of experience
@TessellatingHeckler Think about it: first we find the digits by expression in base-10, then we increment, then we find the digits of those numbers in two-digit base-10, but this inserts leading zeros, so we just filter those out. The second digit is always kept, so we can hard-code that. The first digit will be 0 or 1 in the two-digit base-10 representation, so we can use that as-is.
@Adám "then we find the digits of those numbers in two-digit base-10", and that's brilliant! At least I didn't carry on down the approach of replicating the 9s twice to add another column
maybe there's something in Dyalog or IEEE 754 that disallows that to give an incorrect result, but my philosophy with floats is to always assume a ±0.00000000001
@Adám i use dyalog v15 (i hope i'm still allowed to) and it can't load the newer dws. i think "(optional)" after the first mention of #.SubmitMe would do
^ SubmitMe is required for the Dyalog version, and since you can't even load the dws file, the whole tab that contains SubmitMe is unrelated to what you'll have to do
this passage in the pdf left me with the impression that i must run #.SubmitMe from the dws:
The Contest2019 workspace contains: [...] • #.SubmitMe – a function used to package your solution for submission. [...] On non-Windows platforms, you'll be presented with a character-based prompt and response interaction.
further it says: "#.SubmitMe will create a file called Contest2019.dyalog which will contain any code or data you placed in the #.Problems namespace. You will then upload the Contest2019.dyalog file using the contest website."
so, if i put my code directly in the .dyalog file, it's already considered "packaged"?
@ngn Above that, it says Develop your solutions using either the workspace or the template. and then there are two headers, Using the Contest2019.dws workspace and Using the Contest2019.dyalog template file but the latter is on the next page, and the formatting isn't very suggestive. The way it looks on the site is probably clearer.
@ngn Actually, the best may be having stub files rather than a scripted namespace of them. Of course, that'd require zipping to upload in one go, but really, so what?
further it says: "#.SubmitMe will create a file called Contest2019.dyalog which will contain any code or data you placed in the #.Problems namespace. You will then upload the Contest2019.dyalog file using the contest website."
^ SubmitMe is required for the Dyalog version, and since you can't even load the dws file, the whole tab that contains SubmitMe is unrelated to what you'll have to do
probably meaning that submitting the dws file is not allowed
@Adám file per problem? wouldn't that be overkill? i expect most solutions to be oneliners
what i really miss is an automated way to test my solutions. i had to write one myself and manually copied the example inputs and outputs, which was frustrating due to pdf issues
@Adám that'd make using other functions from one very annoying as all would have to be loaded individually (unless there's some way to load the entire folder). one file per domain would be somewhat understandable, but still annoying
@dzaima Yeah, we're working on the new way to load an entire directory tree with one file per item. So you'd get a single dir for the entire contest, and it'd have subdirs with stub files. And a single ]Import path/dir would load it all in.
APL (named after the book A Programming Language) is a programming language developed in the 1960s by Kenneth E. Iverson. Its central datatype is the multidimensional array. It uses a large range of special graphic symbols to represent most functions and operators, leading to very concise code. It has been an important influence on the development of concept modeling, spreadsheets, functional programming, and computer math packages. It has also inspired several other programming languages.
== History ==
=== Mathematical notation ===
A mathematical notation for manipulating arrays was developed by...
CMP: We're designing a proper system function to replace 819⌶ (half-hearted) "case map" which will do both (simple, but complete) Unicode case mapping (prep for display) and Unicode case folding (prep for case-insensitive comparison). What should it be called?
@Adám i'd think that depends on it's usage - is it an operator or function, in what format are the options taken (numbers, strings, or do you plan to have multiple functions for different cases)
@dzaima It is very early in development, but the current proposal is an ambivalent function: 1⎕nnn Y for upper-map, ¯1⎕nnn Y for lower-map, ⎕nnn Y for case-fold.
@Adám i don't like that idea - imo it feels like a hack to not need to choose specific data, and when there is both data to uppercase & leave alone you'll have to pick too
@Adám you hopefully wouldn't be using ⌊ & ⌈ on an array containing both numbers & chars (i wouldn't be opposed to ⌈'a'3 erroring), and the properties can live on staying number specific
@dzaima Because then it can't just traverse and convert on the fly, as it has to keep a table of which types it has seen so far. Also, should ⌈⍬'' be allowed, etc?
@dzaima traversing ≢ having mixed types. traversing ≡ having nested arrays, and ⌈'john' 'doe' must work.
@Adám yeah, it probably would be better for consistency & speed to allow ⌈'a'3, i was just saying that as in anyone actually using that, shouldn't be
@Adám and that should work. what's a case when you can't extremely easily (≡ doing a simple n⊃) separate numbers from strings, and there aren't many mixed type arrays (or an array of arrays)?
e.g. ('ab' 1.3)('cd' 2.6)('ef' 3.9) is a bad format to store data, and imo shouldn't be helped to be usable easily (besides converting away from it)
and what if i had the data ('ab' 1 'ms') ('cd' 2 'Ms') and wanted to uppercase the 'ab' and 'cd' but not 'ms' & 'Ms'?
@dzaima If ⌈'abc' 'def' is allowed and ⌈(1 2)(3 4) is allowed, then it would be too costly to disallow ⌈'abc' (3 4). In fact, in principle, ⍋ disallows refs, but it doesn't actually check:
@dzaima Remember that the main goal here is case folding for case-insensitive comparison. It is unlikely (but possible, e.g. username password) that you want partial case-insensitivity.