Questions tagged [apl]

APL is an array-oriented programming language. Its powerful, concise syntax lets you develop shorter programs that enable you to think more about the problem you're trying to solve than how to express it to a computer.

Filter by
Sorted by
Tagged with
3 votes
1 answer
68 views

Dyalog APL dyadic operator deriving ambivalent function to pair two function results

I'm writing a small utility operator which applies two functions to an argument pair and strands the results. The pair can either be given as two arguments or as a single argument with two elements. ...
Adám's user avatar
  • 656
6 votes
2 answers
105 views

String unescaping in Dyalog APL

I am adapting the following existing python parser: ...
ohAitch's user avatar
  • 61
3 votes
2 answers
445 views

Print square numbers from 1 to 9999 (non-tradfn)

I'm making a simple program that outputs the squares. I have a question: Is there a way to improve the speed but make the Code readable? Code ...
Fmbalbuena's user avatar
4 votes
0 answers
71 views

Compute the optimized palette for RGB image

...
LdBeth's user avatar
  • 213
5 votes
1 answer
356 views

Image processing using Dyalog APL

I've started to write my first APL project, so I would like to have general feedbacks on coding style, file organization, error handling and defensive programming, performance improvements, etc. The ...
LdBeth's user avatar
  • 213
2 votes
1 answer
103 views

A TradFn for loading an image from a URL in Dyalog APL

Wrote this for getting the content of image from the given URL. It accepts a URL and returns an array of shape number_of_channels image_height image_width. Each &...
leo3065's user avatar
  • 123
3 votes
1 answer
119 views

Solving the game of 24 recursively in APL

The "game of 24" as I called it in the title is a maths game in which you are given four numbers and have to combine them in an expression using only the four basic arithmetic operations <...
RGS's user avatar
  • 1,058
3 votes
1 answer
215 views

Implementing basic graph theory functions in APL with matrices

I had to solve three problems on graph theory that I solved by implementing a utility function and 3 functions, one for each of the problems. The problem set defines the input for all my functions as ...
RGS's user avatar
  • 1,058
3 votes
1 answer
57 views

Abbreviating and expanding IP v6 addresses with APL

Recently I solved a challenge (problem 1 of the 3rd easy problem set of phase 2 of the '19 APL Competition) on abbreviating and expanding IP v6 addresses. For that matter, I had to write two functions,...
RGS's user avatar
  • 1,058
2 votes
2 answers
376 views

Simplified Pig Latin translator in APL

I wrote a simplified pig latin translator in APL and I would like some feedback on it, as I am not sure my implementation is neat enough. The simplified pig latin translation follows the following ...
RGS's user avatar
  • 1,058
5 votes
2 answers
155 views

Leftist Tree in Dyalog APL -- can it be made more compact/idiomatic?

Following great feedback given in response to my previous question, I was encouraged to consider a different type of heap structure, the Leftist Tree. It lends itself better to a functional ...
xpqz's user avatar
  • 195
2 votes
1 answer
75 views

Decoding a telephone number that was masked with letters from the respective keys with APL

Legend says phones used to have keyscitation needed and in those times, a person could "encode" a phone number by creating a word from the letters in the keys with the given numbers. Below is the ...
RGS's user avatar
  • 1,058
6 votes
4 answers
303 views

Finding legal knight moves in a chessboard in APL (follow-up)

This question is a follow-up to this previous question of mine. Assuming I understood correctly what is outlined in this meta post. I wrote (and now, re-wrote) a function that takes as input a vector ...
RGS's user avatar
  • 1,058
4 votes
1 answer
139 views

A heap queue in Dyalog APL

I am learning Dyalog APL. I implemented a binary heap, which seems to work. How could I make it look more like APL (and less like Python)? ...
xpqz's user avatar
  • 195
3 votes
1 answer
66 views

XML attribute analysis

To begin, I have an XML file at /Users/gaze/lab/lab/gpib_lib/out.xml that contains lines like... ...
Evan's user avatar
  • 163
18 votes
2 answers
896 views

Finding legal knight moves in a chessboard in APL

I wrote a function that takes as input a vector with two integers between 1 and 8 representing a position in a chessboard and ...
RGS's user avatar
  • 1,058