Tic-tac-toe winner · tic-tac-toe 승자 확인
Tic-tac-toe winner
Decide a game of noughts and crosses from the board.
There are eight lines to check: three rows, three columns and two diagonals. board[r][c] is the square in row r and column c, so a column is board[0][c] + board[1][c] + board[2][c]. Collect all eight lines as three-letter strings, then look for "XXX" or "OOO".
tic-tac-toe 승자
보드를 통해 크로스나이트 게임을 결정합니다.
확인해야 할 8개의 선이 있습니다: 3개의 행, 3개의 열, 2개의 대각선. board[r][c]은 행 r과 열 c의 사각형이므로, 한 열은 board[0][c] + board[1][c] + board[2][c]입니다. 8개의 선을 모두 3글자 문자열로 수집한 후, "XXX" 또는 "OOO"을 검색합니다.
Write winner(board). board is a list of three strings, one per row, using X, O, and . for an empty square. Return "X" or "O" if that player has three in a row, column or diagonal, otherwise "". · winner(board)을 작성하십시오. board은 공백을 나타내는 X, O, .을 사용하는 3개의 문자열로 이루어진 list이며 각각 한 줄씩입니다. 해당 플레이어가 줄, 열, 대각선 중 하나에 세 개를 연결했다면 "X" 또는 "O"을, 그렇지 않다면 ""을 반환하십시오.
Click Run to see the output here. · 출력을 보려면 '실행'을 클릭하세요.