Skip to content

Instantly share code, notes, and snippets.

View steveAllen0112's full-sized avatar
💭
Systemize ALL THE THINGS!

Steve Allen steveAllen0112

💭
Systemize ALL THE THINGS!
View GitHub Profile
@mlliarm
mlliarm / oldtimer_APL_code.md
Last active February 25, 2022 23:01
An oldtimer's APL code

An oldtimer's APL code

What

Some pretty cool code from the 70s'-80s' that a Reddit user shared at this question.

Here's what u/snarkuzoid wrote:

5x5 Knight's Tour in APL

It puts an A in the middle, then randomly does a knight's tour,

// JSON.ArraySlice ( data ; start ; numberOfValues )
// Orignally done by Steve Allen (GitHub: @steveAllen0112) of Richard Carlton Consulting (RCC) 05/2018
// With some "polishing" suggestions from Michael Wallace (GitHub: @mw777rcc), also of RCC
Case (
/* Check if it's even trying to be an array */
Left ( Trim ( data ) ; 1 ) <> "["
; "? Invalid input; this function only accepts arrays."
/ * Check if it's valid JSON */
; Let ( $check = JSONGetElement ( data ; 0 ) ; Left ( $check ; 1 ) = "?" )