scene.org File Archive

File download

<root>­/­parties­/­2023­/­vccc23­/­christmas-diamonds/logiker_pc_apl_vc3-2023.zip

File size:
11 963 bytes (11.68K)
File date:
2024-01-03 14:15:18
Download count:
all-time: 42

Preview

  • APL_24b.txt 32B
  • code.png 3.18K
  • file_id.diz 1.64K
  • result.png 8.82K

file_id.diz

Christmesh APL 24b

Author: Logiker
Language: APL
Usage:
Use https://tryapl.org/ to execute the code.
Or https://norbertkehrer.github.io/ibm_5110/emu5110.html.
Code:
' *'[1+3=v∘.+v←19⍴|4-⍳6]
Length: 
24 chars (stored with unicode it takes 32 chars)
Description:
⍳6 .. numbers from 1 to 6: 1 2 3 4 5 6
4-⍳6 .. numbers from 3 to ¯2: 3 2 1 0 ¯1 ¯2
|4-⍳6 .. absolute value, so from 3 to 0 to 2: 3 2 1 0 1 2
19⍴|4-⍳6 .. 19 numbers like above alternating: 3 2 1 0 1 2 3 2 1 0 1 2 3 2 1 0 1 2 3
v← .. store in v
v∘.+v .. add each value with each other, resulting in a 2-dim matrix
6 5 4 3 4 5 6 5 4 3 4 5 6 5 4 3 4 5 6
5 4 3 2 3 4 5 4 3 2 3 4 5 4 3 2 3 4 5
4 3 2 1 2 3 4 3 2 1 2 3 4 3 2 1 2 3 4
3 2 1 0 1 2 3 2 1 0 1 2 3 2 1 0 1 2 3
4 3 2 1 2 3 4 3 2 1 2 3 4 3 2 1 2 3 4
5 4 3 2 3 4 5 4 3 2 3 4 5 4 3 2 3 4 5
6 5 4 3 4 5 6 5 4 3 4 5 6 5 4 3 4 5 6
5 4 3 2 3 4 5 4 3 2 3 4 5 4 3 2 3 4 5
4 3 2 1 2 3 4 3 2 1 2 3 4 3 2 1 2 3 4
3 2 1 0 1 2 3 2 1 0 1 2 3 2 1 0 1 2 3
4 3 2 1 2 3 4 3 2 1 2 3 4 3 2 1 2 3 4
5 4 3 2 3 4 5 4 3 2 3 4 5 4 3 2 3 4 5
6 5 4 3 4 5 6 5 4 3 4 5 6 5 4 3 4 5 6
5 4 3 2 3 4 5 4 3 2 3 4 5 4 3 2 3 4 5
4 3 2 1 2 3 4 3 2 1 2 3 4 3 2 1 2 3 4
3 2 1 0 1 2 3 2 1 0 1 2 3 2 1 0 1 2 3
4 3 2 1 2 3 4 3 2 1 2 3 4 3 2 1 2 3 4
5 4 3 2 3 4 5 4 3 2 3 4 5 4 3 2 3 4 5
6 5 4 3 4 5 6 5 4 3 4 5 6 5 4 3 4 5 6
3=v∘.+v .. the value of 3 is what we look for and become 1, the rest becomes zero
1+ .. add 1, so we can use the number 1 and 2 as index
Finally:
' *'[1+3=v∘.+v←19⍴|4-⍳6] .. the string stores space and *, with our calculation we chose space with 1, and * with 2 (string is seen as zero based array)