Skip to main content
replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link
Tweeted twitter.com/StackCodeGolf/status/762775484262387712
added 19 characters in body
Source Link
lynn
  • 69.7k
  • 11
  • 137
  • 285
  • 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. Depending on this choice, you are guaranteed the

  • The input will always match the regexis always a single string like a1 or T19, 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 to STDOUT, 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 . The shortest answer in bytes wins.

  • 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. Depending on this choice, you are guaranteed the input will always match the regex

  • 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 to STDOUT, 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 . The shortest answer in bytes wins.

  • 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 or T19, 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 to STDOUT, 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 . The shortest answer in bytes wins.

Source Link
lynn
  • 69.7k
  • 11
  • 137
  • 285

Place a stone on an empty Go board

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:

       go coordinates

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. Depending on this choice, you are guaranteed the input will always match the regex

  • 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 to STDOUT, 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 . The shortest answer in bytes wins.