File download
- File size:
- 16 565 bytes (16.18K)
- File date:
- 2025-01-04 05:45:02
- Download count:
- all-time: 8
Preview
- APL_22b.txt 30B
- code.png 9.98K
- file_id.diz 1.64K
- result.png 7.84K
file_id.diz
Christmesh APL 22b
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=∘.+⍨19⍴|4-⍳6]
Length:
22 chars (stored with unicode it takes 30 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
∘.+⍨19⍴|4-⍳6 .. 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=∘.+⍨19⍴|4-⍳6 .. 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=∘.+⍨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)