Introduction
This is how a chessboard looks like.
You can see that a1
is a dark square. However, b1
is a light square.
The Task
The challenge is, given dark
, light
or both
, output all the dark, light or all squares with a separator (like a whitespace or a newline). The order of all the squares does not matter.
Test cases
Input: dark
Output: a1 a3 a5 a7 b2 b4 b6 b8
c1 c3 c5 c7 d2 d4 d6 d8
e1 e3 e5 e7 f2 f4 f6 f8
g1 g3 g5 g7 h2 h4 h6 h8
Input: light
Output: a2 a4 a6 a8 b1 b3 b5 b7
c2 c4 c6 c8 d1 d3 d5 d7
e2 e4 e6 e8 f1 f3 f5 f7
g2 g4 g6 g8 h1 h3 h5 h7
Input: both
Output: a1 a2 a3 a4 a5 a6 a7 a8
b1 b2 b3 b4 b5 b6 b7 b8
c1 c2 c3 c4 c5 c6 c7 c8
d1 d2 d3 d4 d5 d6 d7 d8
e1 e2 e3 e4 e5 e6 e7 e8
f1 f2 f3 f4 f5 f6 f7 f8
g1 g2 g3 g4 g5 g6 g7 g8
h1 h2 h3 h4 h5 h6 h7 h8
Note: I have prettified the output but this is not necessary.
This is code-golf, so the submission with the least amount of bytes wins!
a2a4a6...
would be okay? \$\endgroup\$[[a2,a4,a6,a8],[...]...]
\$\endgroup\$light
,dark
andboth
have to be input asString
s or can they be represented via any data type? \$\endgroup\$