Skip to main content
Commonmark migration
Source Link

#Dyalog APL, 72 bytes

Dyalog APL, 72 bytes

(6=|×/t,-/t←↑j[a⍳⊂⍞]-j←⊃,/i,¨¨↓∘i¨i-6)/a←⊃,/(11⍴⎕a~'J'),∘⍕¨¨⍳¨5+i⌊⌽i←⍳11 

try

builds a list a of all valid cells: 'A1' 'A2' ... 'L6'

a is used for both input and output

builds a list j of the corresponding coordinates to a in a system where the x axis is along A6-L1 and y along F1-F11

an imaginary third coordinate is the difference of the first two

if the input cell is translated to coords 0 0 0, a knight can move to those cells whose product of coords is 6 or -6

#Dyalog APL, 72 bytes

(6=|×/t,-/t←↑j[a⍳⊂⍞]-j←⊃,/i,¨¨↓∘i¨i-6)/a←⊃,/(11⍴⎕a~'J'),∘⍕¨¨⍳¨5+i⌊⌽i←⍳11 

try

builds a list a of all valid cells: 'A1' 'A2' ... 'L6'

a is used for both input and output

builds a list j of the corresponding coordinates to a in a system where the x axis is along A6-L1 and y along F1-F11

an imaginary third coordinate is the difference of the first two

if the input cell is translated to coords 0 0 0, a knight can move to those cells whose product of coords is 6 or -6

Dyalog APL, 72 bytes

(6=|×/t,-/t←↑j[a⍳⊂⍞]-j←⊃,/i,¨¨↓∘i¨i-6)/a←⊃,/(11⍴⎕a~'J'),∘⍕¨¨⍳¨5+i⌊⌽i←⍳11 

try

builds a list a of all valid cells: 'A1' 'A2' ... 'L6'

a is used for both input and output

builds a list j of the corresponding coordinates to a in a system where the x axis is along A6-L1 and y along F1-F11

an imaginary third coordinate is the difference of the first two

if the input cell is translated to coords 0 0 0, a knight can move to those cells whose product of coords is 6 or -6

added 423 characters in body
Source Link
ngn
  • 15.6k
  • 2
  • 45
  • 90

#Dyalog APL, 72 bytes

(6=|×/t,-/t←↑j[a⍳⊂⍞]-j←⊃,/i,¨¨↓∘i¨i-6)/a←⊃,/(11⍴⎕a~'J'),∘⍕¨¨⍳¨5+i⌊⌽i←⍳11 

try

builds a list a of all valid cells: 'A1' 'A2' ... 'L6'

a is used for both input and output

builds a list j of the corresponding coordinates to a in a system where the x axis is along A6-L1 and y along F1-F11

an imaginary third coordinate is the difference of the first two

if the input cell is translated to coords 0 0 0, a knight can move to those cells whose product of coords is 6 or -6

#Dyalog APL, 72 bytes

(6=|×/t,-/t←↑j[a⍳⊂⍞]-j←⊃,/i,¨¨↓∘i¨i-6)/a←⊃,/(11⍴⎕a~'J'),∘⍕¨¨⍳¨5+i⌊⌽i←⍳11 

try

#Dyalog APL, 72 bytes

(6=|×/t,-/t←↑j[a⍳⊂⍞]-j←⊃,/i,¨¨↓∘i¨i-6)/a←⊃,/(11⍴⎕a~'J'),∘⍕¨¨⍳¨5+i⌊⌽i←⍳11 

try

builds a list a of all valid cells: 'A1' 'A2' ... 'L6'

a is used for both input and output

builds a list j of the corresponding coordinates to a in a system where the x axis is along A6-L1 and y along F1-F11

an imaginary third coordinate is the difference of the first two

if the input cell is translated to coords 0 0 0, a knight can move to those cells whose product of coords is 6 or -6

Bounty Awarded with 250 reputation awarded by AdmBorkBork
Source Link
ngn
  • 15.6k
  • 2
  • 45
  • 90

#Dyalog APL, 72 bytes

(6=|×/t,-/t←↑j[a⍳⊂⍞]-j←⊃,/i,¨¨↓∘i¨i-6)/a←⊃,/(11⍴⎕a~'J'),∘⍕¨¨⍳¨5+i⌊⌽i←⍳11 

try