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,
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 ) = "?" ) |