Skip to main content
deleted 827 characters in body
Source Link
Yousername
  • 4.1k
  • 4
  • 5

All Possible Ties in Tic-Tac-ToeAll Possible Ties in Tic-Tac-Toe

Your task is to output all possible ways to end a game with a tie (all rows, columns, and diagonals are completely filled and do not have 3 X's or 3 O's) in Tic-Tac-Toe (assuming X goes first):

OXO  XXO  XOX  OXX
XOX  OOX  XOX  XOO
XOX  XXO  OXO  OXX

XOX  XOX  OXX  XXO
OOX  XOO  XOO  OOX
XXO  OXX  XOX  XOX

XOX  OXX  OXO  XOO
XXO  XXO  OXX  OXX
OXO  OOX  XOX  XXO

OXO  XXO  XOX  OOX
XXO  OXX  OXX  XXO
XOX  XOO  OXO  OXX

(It does not need to be arranged in the above way.)

Rules

  • Output can be in any convenient format.
  • You may use different characters to represent X and O as long as they are distinct.
  • Standard loopholes are forbidden.
  • This is , so the shortest code in bytes wins.

All Possible Ties in Tic-Tac-Toe

Your task is to output all possible ways to end a game with a tie (all rows, columns, and diagonals are completely filled and do not have 3 X's or 3 O's) in Tic-Tac-Toe (assuming X goes first):

OXO  XXO  XOX  OXX
XOX  OOX  XOX  XOO
XOX  XXO  OXO  OXX

XOX  XOX  OXX  XXO
OOX  XOO  XOO  OOX
XXO  OXX  XOX  XOX

XOX  OXX  OXO  XOO
XXO  XXO  OXX  OXX
OXO  OOX  XOX  XXO

OXO  XXO  XOX  OOX
XXO  OXX  OXX  XXO
XOX  XOO  OXO  OXX

(It does not need to be arranged in the above way.)

Rules

  • Output can be in any convenient format.
  • You may use different characters to represent X and O as long as they are distinct.
  • Standard loopholes are forbidden.
  • This is , so the shortest code in bytes wins.
Source Link
Yousername
  • 4.1k
  • 4
  • 5

All Possible Ties in Tic-Tac-Toe

Your task is to output all possible ways to end a game with a tie (all rows, columns, and diagonals are completely filled and do not have 3 X's or 3 O's) in Tic-Tac-Toe (assuming X goes first):

OXO  XXO  XOX  OXX
XOX  OOX  XOX  XOO
XOX  XXO  OXO  OXX

XOX  XOX  OXX  XXO
OOX  XOO  XOO  OOX
XXO  OXX  XOX  XOX

XOX  OXX  OXO  XOO
XXO  XXO  OXX  OXX
OXO  OOX  XOX  XXO

OXO  XXO  XOX  OOX
XXO  OXX  OXX  XXO
XOX  XOO  OXO  OXX

(It does not need to be arranged in the above way.)

Rules

  • Output can be in any convenient format.
  • You may use different characters to represent X and O as long as they are distinct.
  • Standard loopholes are forbidden.
  • This is , so the shortest code in bytes wins.