See also: Make a move on a Go board.
Task
Go is a board game where two players (Black and White) place stones on the intersections of grid lines on a 19×19 board. Black moves first — for example, on D4:
In this challenge, you must take a Go board coordinate like D4
as input, and output an ASCII representation of a board with the first move played at the given point.
Note that there is no column I. This is, historically, to reduce confusion with J and L.
This output consists of 19 lines, each containing 19 characters. The point with the stone on it is marked O
. Empty points on the board are shown as .
, except for the nine star points (at D4
, D10
, D16
, K4
, K10
, K16
, Q4
, Q10
, and Q16
), which are marked *
.
For example, given F5
as an input, your answer’s output must be:
...................
...................
...................
...*.....*.....*...
...................
...................
...................
...................
...................
...*.....*.....*...
...................
...................
...................
...................
.....O.............
...*.....*.....*...
...................
...................
...................
And given Q16
as input, your output must be:
...................
...................
...................
...*.....*.....O...
...................
...................
...................
...................
...................
...*.....*.....*...
...................
...................
...................
...................
...................
...*.....*.....*...
...................
...................
...................
Rules
You may write a function that takes the coordinate as an argument, or a program that reads the coordinate from the command line or from
STDIN
.You may choose to accept input either in lower-case or upper-case, but your answer doesn’t need to handle both.
The input is always a single string like
a1
orT19
, never a string + number or two strings.If you write a full program, your answer must be printed to
STDOUT
as a string, optionally followed by a trailing newline. If your answer is a function, you may print toSTDOUT
, or return a string, or return an array/list of strings (rows), or return a two-dimensional array or nested list of characters.This is code-golf. The shortest answer in bytes wins.
f("G", 14)
, correct? \$\endgroup\$