5 added 6 characters in body
source | link

Python 2, 143 131 107 Bytes

This doesn't use any real fancy tricks, except list transposition to make index access easier since we can print the board transposed. Definitely not done with this just yet. Moves are taken as 0-based numbers. Byte count comes before commenting.

Jonathan Allan had a better approach to building the board, mine is improved slightly since the slicing is a bit shorter [-j:] -> [:j] and the list comprehension helps shorten printing.

i,j,k=input()                                     # split up the input
t=0                                               # keep track of whose move it is
g=i*['']                                          # board init
for b in k:g[b]+='XO'[t%2];t+=1                   # read moves sequentially, place pieces
print'\n'.join(''.join((m+'.'*j)[:j])for m in g)  # build the board

Example Input: [7, 6, [3, 3, 4, 4, 5, 6, 2]]

Example Output:

.......
.......
..X.....
XO....
XO....
X...OO..
O..XXXXO...

Try it online or view all test cases.

Python 2, 143 131 107 Bytes

This doesn't use any real fancy tricks, except list transposition to make index access easier since we can print the board transposed. Definitely not done with this just yet. Moves are taken as 0-based numbers. Byte count comes before commenting.

Jonathan Allan had a better approach to building the board, mine is improved slightly since the slicing is a bit shorter [-j:] -> [:j] and the list comprehension helps shorten printing.

i,j,k=input()                                     # split up the input
t=0                                               # keep track of whose move it is
g=i*['']                                          # board init
for b in k:g[b]+='XO'[t%2];t+=1                   # read moves sequentially, place pieces
print'\n'.join(''.join((m+'.'*j)[:j])for m in g)  # build the board

Example Input: [7, 6, [3, 3, 4, 4, 5, 6, 2]]

Example Output:

.......
.......
.......
.......
...OO..
..XXXXO

Try it online or view all test cases.

Python 2, 143 131 107 Bytes

This doesn't use any real fancy tricks, except list transposition to make index access easier since we can print the board transposed. Definitely not done with this just yet. Moves are taken as 0-based numbers. Byte count comes before commenting.

Jonathan Allan had a better approach to building the board, mine is improved slightly since the slicing is a bit shorter [-j:] -> [:j] and the list comprehension helps shorten printing.

i,j,k=input()                                     # split up the input
t=0                                               # keep track of whose move it is
g=i*['']                                          # board init
for b in k:g[b]+='XO'[t%2];t+=1                   # read moves sequentially, place pieces
print'\n'.join(''.join((m+'.'*j)[:j])for m in g)  # build the board

Example Input: [7, 6, [3, 3, 4, 4, 5, 6, 2]]

Example Output:

......
......
X.....
XO....
XO....
X.....
O.....

Try it online or view all test cases.

4 added 203 characters in body
source | link

Python 2, 143 131131 107 Bytes

This doesn't use any real fancy tricks, except list transposition to make index access easier since we can print the board transposed. Definitely not done with this just yet. Moves are taken as 0-based numbers. Byte count comes before commenting.

Jonathan Allan had a better approach to building the board, mine is improved slightly since the slicing is a bit shorter [-j:] -> [:j] and the list comprehension helps shorten printing.

i,j,k=input()                                     # split up the input
t=0                                               # keep track of whose move it is
g=[j*['.']forg=i*[''] _ in range(i)]                                       # board init
for b in k:g[b][g[b].index('.')]='XO'[t%2];t+=1g[b]+='XO'[t%2];t+=1                   # read moves sequentially, place pieces
print'\n'.join(''.join(m(m+'.'*j)[:j])for m in g)              # build the board

Example Input: [7, 6, [3, 3, 4, 4, 5, 6, 2]]

Example Output:

.......
.......
.......
.......
...OO..
..XXXXO

Try it onlineTry it online or view all test casesview all test cases.

Python 2, 143 131 Bytes

This doesn't use any real fancy tricks, except list transposition to make index access easier since we can print the board transposed. Definitely not done with this just yet. Moves are taken as 0-based numbers. Byte count comes before commenting.

i,j,k=input()                                     # split up the input
t=0                                               # keep track of whose move it is
g=[j*['.']for _ in range(i)]                      # board init
for b in k:g[b][g[b].index('.')]='XO'[t%2];t+=1   # read moves sequentially, place pieces
print'\n'.join(''.join(m)for m in g)              # build the board

Example Input: [7, 6, [3, 3, 4, 4, 5, 6, 2]]

Example Output:

.......
.......
.......
.......
...OO..
..XXXXO

Try it online or view all test cases.

Python 2, 143 131 107 Bytes

This doesn't use any real fancy tricks, except list transposition to make index access easier since we can print the board transposed. Definitely not done with this just yet. Moves are taken as 0-based numbers. Byte count comes before commenting.

Jonathan Allan had a better approach to building the board, mine is improved slightly since the slicing is a bit shorter [-j:] -> [:j] and the list comprehension helps shorten printing.

i,j,k=input()                                     # split up the input
t=0                                               # keep track of whose move it is
g=i*['']                                          # board init
for b in k:g[b]+='XO'[t%2];t+=1                   # read moves sequentially, place pieces
print'\n'.join(''.join((m+'.'*j)[:j])for m in g)  # build the board

Example Input: [7, 6, [3, 3, 4, 4, 5, 6, 2]]

Example Output:

.......
.......
.......
.......
...OO..
..XXXXO

Try it online or view all test cases.

3 added 114 characters in body
source | link

Python 2, 143143 131 Bytes

This doesn't use any real fancy tricks, except list transposition to make index access easierexcept list transposition to make index access easier since we can print the board transposed. Definitely not done with this just yet. Moves are taken as 0-based numbers. Byte count comes before commenting.

i,j,k=input()                                     # split up the input
t=0                                               # keep track of whose move it is
g=[j*['.']for _ in range(i)]                      # board init
for b in k:g[b][g[b].index('.')]='XO'[t%2];t+=1   # read moves sequentially, place pieces
print'\n'.join(''.join(m)for m in zip(*g)[::-1]g)              # build the board

Example Input: [7, 6, [3, 3, 4, 4, 5, 6, 2]]

Example Output:

.......
.......
.......
.......
...OO..
..XXXXO

Try it onlineTry it online or view all test casesview all test cases.

Python 2, 143 Bytes

This doesn't use any real fancy tricks, except list transposition to make index access easier. Definitely not done with this just yet. Moves are taken as 0-based numbers. Byte count comes before commenting.

i,j,k=input()                                     # split up the input
t=0                                               # keep track of whose move it is
g=[j*['.']for _ in range(i)]                      # board init
for b in k:g[b][g[b].index('.')]='XO'[t%2];t+=1   # read moves sequentially, place pieces
print'\n'.join(''.join(m)for m in zip(*g)[::-1])  # build the board

Example Input: [7, 6, [3, 3, 4, 4, 5, 6, 2]]

Example Output:

.......
.......
.......
.......
...OO..
..XXXXO

Try it online or view all test cases.

Python 2, 143 131 Bytes

This doesn't use any real fancy tricks, except list transposition to make index access easier since we can print the board transposed. Definitely not done with this just yet. Moves are taken as 0-based numbers. Byte count comes before commenting.

i,j,k=input()                                     # split up the input
t=0                                               # keep track of whose move it is
g=[j*['.']for _ in range(i)]                      # board init
for b in k:g[b][g[b].index('.')]='XO'[t%2];t+=1   # read moves sequentially, place pieces
print'\n'.join(''.join(m)for m in g)              # build the board

Example Input: [7, 6, [3, 3, 4, 4, 5, 6, 2]]

Example Output:

.......
.......
.......
.......
...OO..
..XXXXO

Try it online or view all test cases.

2 added 114 characters in body
source | link
1
source | link