Skip to main content
edited body
Source Link

Tic-Tac-Latin!

This is a true story, so names have been altered.

My latin teacher, Mr. Latin, created his own proprietary (no joke) tic tac toe variant. Let's call it tic-tac-latin. The game is simple, it is essentially tic tac toe played on a four by four grid.

Formal rule declaration

A line is either a row, column or a diagonal. There are two symbols, 'X' and 'O', but one or both may be substituted for a different symbol.
You score one point when you have three of your symbol and one of the other character.

These arrangements score:
X---O
OO-O--
XXXO
XOOX

O-XX -O-- --X- ---O

These do not score:

----
XXXX
----
OOOO

----
XXX-
----
OOO-

The game is won whenever one player has more points then another. The game is a draw only if the board gets filled up.

Challenge

Solve this game. Your job is to provide a way to guarantee a win or tie, whichever is the optimal result.

Your solution may choose to either start first or second (and may therefore choose it's symbol). It is not mandatory to implement an interactive game where the user inputs moves and the corresponding display changes. It may also be a function or program which takes input as a game state, and outputs a new board or a description of their move. Either option must run within approximately ten seconds per move made.


Playing your player against any sequence of moves must give the optimal result. This means that you may assume the input position is one that it reachable from play with your player. Submissions must be deterministic, and do not necessarily need to supply a proof of optimality, but if they get cracked (by being beaten) your submissions will be considered invalid (you may leave it up, but add (cracked) in the headline).
This is a non-trivial task, so any valid submission is impressive and is worthy of an accepted tick, but I will make code golf the primary winning criterion.

The winner is chosen by going down this list till one winner is chosen.

  • Shortest solved implemenation which always wins
  • Shortest implementation

Tic-Tac-Latin!

This is a true story, so names have been altered.

My latin teacher, Mr. Latin, created his own proprietary (no joke) tic tac toe variant. Let's call it tic-tac-latin. The game is simple, it is essentially tic tac toe played on a four by four grid.

Formal rule declaration

A line is either a row, column or a diagonal. There are two symbols, 'X' and 'O', but one or both may be substituted for a different symbol.
You score one point when you have three of your symbol and one of the other character.

These arrangements score:
X--O
OO--
XXXO
XOOX

O-XX -O-- --X- ---O

These do not score:

----
XXXX
----
OOOO

----
XXX-
----
OOO-

The game is won whenever one player has more points then another. The game is a draw only if the board gets filled up.

Challenge

Solve this game. Your job is to provide a way to guarantee a win or tie, whichever is the optimal result.

Your solution may choose to either start first or second (and may therefore choose it's symbol). It is not mandatory to implement an interactive game where the user inputs moves and the corresponding display changes. It may also be a function or program which takes input as a game state, and outputs a new board or a description of their move. Either option must run within approximately ten seconds per move made.


Playing your player against any sequence of moves must give the optimal result. This means that you may assume the input position is one that it reachable from play with your player. Submissions must be deterministic, and do not necessarily need to supply a proof of optimality, but if they get cracked (by being beaten) your submissions will be considered invalid (you may leave it up, but add (cracked) in the headline).
This is a non-trivial task, so any valid submission is impressive and is worthy of an accepted tick, but I will make code golf the primary winning criterion.

The winner is chosen by going down this list till one winner is chosen.

  • Shortest solved implemenation which always wins
  • Shortest implementation

Tic-Tac-Latin!

This is a true story, so names have been altered.

My latin teacher, Mr. Latin, created his own proprietary (no joke) tic tac toe variant. Let's call it tic-tac-latin. The game is simple, it is essentially tic tac toe played on a four by four grid.

Formal rule declaration

A line is either a row, column or a diagonal. There are two symbols, 'X' and 'O', but one or both may be substituted for a different symbol.
You score one point when you have three of your symbol and one of the other character.

These arrangements score:
---O
-O--
XXXO
XOOX

O-XX -O-- --X- ---O

These do not score:

----
XXXX
----
OOOO

----
XXX-
----
OOO-

The game is won whenever one player has more points then another. The game is a draw only if the board gets filled up.

Challenge

Solve this game. Your job is to provide a way to guarantee a win or tie, whichever is the optimal result.

Your solution may choose to either start first or second (and may therefore choose it's symbol). It is not mandatory to implement an interactive game where the user inputs moves and the corresponding display changes. It may also be a function or program which takes input as a game state, and outputs a new board or a description of their move. Either option must run within approximately ten seconds per move made.


Playing your player against any sequence of moves must give the optimal result. This means that you may assume the input position is one that it reachable from play with your player. Submissions must be deterministic, and do not necessarily need to supply a proof of optimality, but if they get cracked (by being beaten) your submissions will be considered invalid (you may leave it up, but add (cracked) in the headline).
This is a non-trivial task, so any valid submission is impressive and is worthy of an accepted tick, but I will make code golf the primary winning criterion.

The winner is chosen by going down this list till one winner is chosen.

  • Shortest solved implemenation which always wins
  • Shortest implementation
added 48 characters in body
Source Link

Tic-Tac-Latin!

This is a true story, so names have been altered.

My latin teacher, Mr. Latin, created his own proprietary (no joke) tic tac toe variant. Let's call it tic-tac-latin. The game is simple, it is essentially tic tac toe played on a four by four grid.

Formal rule declaration

A line is either a row, column or a diagonal. There are two symbols, 'X' and 'O', but one or both may be substituted for a different symbol.
You score one point when you have three of your symbol and one of the other character.

These arrangements score:
X--O
OO--
XXXO
XOOX

O-XX -O-- --X- ---O

These do not score:

----
XXXX
----
OOOO

----
XXX-
----
OOO-

You win theThe game is won whenever one player has more points then another. The game is a draw only if you score and in the process do not score for your opponentboard gets filled up.

Challenge

Solve this game. Your job is to provide a way to guarantee a win or tie, whichever is the optimal result.

Your solution may choose to either start first or second (and may therefore choose it's symbol). It is not mandatory to implement an interactive game where the user inputs moves and the corresponding display changes. It may also be a function or program which takes input as a game state, and outputs a new board or a description of their move. Either option must run within approximately ten seconds per move made.


Playing your player against any sequence of moves must give the optimal result. This means that you may assume the input position is one that it reachable from play with your player. Submissions must be deterministic, and do not necessarily need to supply a proof of optimality, but if they get cracked (by being beaten) your submissions will be considered invalid (you may leave it up, but add (cracked) in the headline).
This is a non-trivial task, so any valid submission is impressive and is worthy of an accepted tick, but I will make code golf the primary winning criterion.

The winner is chosen by going down this list till one winner is chosen.

  • Shortest solved implemenation which always wins
  • Shortest implementation

Tic-Tac-Latin!

This is a true story, so names have been altered.

My latin teacher, Mr. Latin, created his own proprietary (no joke) tic tac toe variant. Let's call it tic-tac-latin. The game is simple, it is essentially tic tac toe played on a four by four grid.

Formal rule declaration

A line is either a row, column or a diagonal. There are two symbols, 'X' and 'O', but one or both may be substituted for a different symbol.
You score when you have three of your symbol and one of the other character.

These arrangements score:
X--O
OO--
XXXO
XOOX

O-XX -O-- --X- ---O

These do not score:

----
XXXX
----
OOOO

----
XXX-
----
OOO-

You win the game if you score and in the process do not score for your opponent.

Challenge

Solve this game. Your job is to provide a way to guarantee a win or tie, whichever is the optimal result.

Your solution may choose to either start first or second (and may therefore choose it's symbol). It is not mandatory to implement an interactive game where the user inputs moves and the corresponding display changes. It may also be a function or program which takes input as a game state, and outputs a new board or a description of their move. Either option must run within approximately ten seconds per move made.


Playing your player against any sequence of moves must give the optimal result. This means that you may assume the input position is one that it reachable from play with your player. Submissions must be deterministic, and do not necessarily need to supply a proof of optimality, but if they get cracked (by being beaten) your submissions will be considered invalid (you may leave it up, but add (cracked) in the headline).
This is a non-trivial task, so any valid submission is impressive and is worthy of an accepted tick, but I will make code golf the primary winning criterion.

The winner is chosen by going down this list till one winner is chosen.

  • Shortest solved implemenation which always wins
  • Shortest implementation

Tic-Tac-Latin!

This is a true story, so names have been altered.

My latin teacher, Mr. Latin, created his own proprietary (no joke) tic tac toe variant. Let's call it tic-tac-latin. The game is simple, it is essentially tic tac toe played on a four by four grid.

Formal rule declaration

A line is either a row, column or a diagonal. There are two symbols, 'X' and 'O', but one or both may be substituted for a different symbol.
You score one point when you have three of your symbol and one of the other character.

These arrangements score:
X--O
OO--
XXXO
XOOX

O-XX -O-- --X- ---O

These do not score:

----
XXXX
----
OOOO

----
XXX-
----
OOO-

The game is won whenever one player has more points then another. The game is a draw only if the board gets filled up.

Challenge

Solve this game. Your job is to provide a way to guarantee a win or tie, whichever is the optimal result.

Your solution may choose to either start first or second (and may therefore choose it's symbol). It is not mandatory to implement an interactive game where the user inputs moves and the corresponding display changes. It may also be a function or program which takes input as a game state, and outputs a new board or a description of their move. Either option must run within approximately ten seconds per move made.


Playing your player against any sequence of moves must give the optimal result. This means that you may assume the input position is one that it reachable from play with your player. Submissions must be deterministic, and do not necessarily need to supply a proof of optimality, but if they get cracked (by being beaten) your submissions will be considered invalid (you may leave it up, but add (cracked) in the headline).
This is a non-trivial task, so any valid submission is impressive and is worthy of an accepted tick, but I will make code golf the primary winning criterion.

The winner is chosen by going down this list till one winner is chosen.

  • Shortest solved implemenation which always wins
  • Shortest implementation
Tweeted twitter.com/StackCodeGolf/status/779708928418521090
Post Reopened by Rohan Jhunjhunwala, TuxCrafting, a spaghetto, Timtech, Suever
Post Closed as "Needs details or clarity" by Peter Taylor, ASCII-only, user53406, manatwork, ericw31415
deleted 81 characters in body
Source Link

Tic-Tac-Latin!

This is a true story, so names have been altered.

My latin teacher, Mr. Latin, created his own proprietary (no joke) tic tac toe variant. Let's call it tic-tac-latin. The game is simple, it is essentially tic tac toe played on a four by four grid.

Formal rule declaration

A line is either a row, column or a diagonal. There are two symbols, 'X' and 'O', but one or both may be substituted for a different symbol.
You score when you have three of your symbol and one of the other character.

These arrangements score:
X--O
OO--
XXXO
XOOX

O-XX -O-- --X- ---O

These do not score:

----
XXXX
----
OOOO

----
XXX-
----
OOO-

You win the game if you score and in the process do not score for your opponent.

Challenge

Solve this game. Your job is to provide a way to guarantee a win or tie, whichever is the optimal result.

Your solution may choose to either start first or second (and may therefore choose it's symbol). It is not mandatory to implement an interactive game where the user inputs moves and the corresponding display changes. It may also be a function or program which takes input as a game state, and outputs a new board or a description of their move. Either option must run within approximately ten seconds per move made.


Playing your player against any sequence of moves must give the optimal result. This means that you may assume the input position is one that it reachable from play with your player. Submissions must be deterministic, and do not necessarily need to supply a proof of optimality, but if they get cracked (by being beaten) your submissions will be considered invalid (you may leave it up, but add (cracked) in the headline).
This is a non-trivial task, so any valid submission is impressive and is worthy of an accepted tick, but I will make code golf the primary winning criterion.

The winner is chosen by going down this list till one winner is chosen.

  • Only solved implementation which always wins
  • Shortest solved implemenation which always wins
  • Only implementation
  • Shortest implementation

Tic-Tac-Latin!

This is a true story, so names have been altered.

My latin teacher, Mr. Latin, created his own proprietary (no joke) tic tac toe variant. Let's call it tic-tac-latin. The game is simple, it is essentially tic tac toe played on a four by four grid.

Formal rule declaration

A line is either a row, column or a diagonal. There are two symbols, 'X' and 'O', but one or both may be substituted for a different symbol.
You score when you have three of your symbol and one of the other character.

These arrangements score:
X--O
OO--
XXXO
XOOX

O-XX -O-- --X- ---O

These do not score:

----
XXXX
----
OOOO

----
XXX-
----
OOO-

You win the game if you score and in the process do not score for your opponent.

Challenge

Solve this game. Your job is to provide a way to guarantee a win or tie, whichever is the optimal result.

Your solution may choose to either start first or second (and may therefore choose it's symbol). It is not mandatory to implement an interactive game where the user inputs moves and the corresponding display changes. It may also be a function or program which takes input as a game state, and outputs a new board or a description of their move. Either option must run within approximately ten seconds per move made.


Playing your player against any sequence of moves must give the optimal result. This means that you may assume the input position is one that it reachable from play with your player. Submissions must be deterministic, and do not necessarily need to supply a proof of optimality, but if they get cracked (by being beaten) your submissions will be considered invalid (you may leave it up, but add (cracked) in the headline).
This is a non-trivial task, so any valid submission is impressive and is worthy of an accepted tick, but I will make code golf the primary winning criterion.

The winner is chosen by going down this list till one winner is chosen.

  • Only solved implementation which always wins
  • Shortest solved implemenation which always wins
  • Only implementation
  • Shortest implementation

Tic-Tac-Latin!

This is a true story, so names have been altered.

My latin teacher, Mr. Latin, created his own proprietary (no joke) tic tac toe variant. Let's call it tic-tac-latin. The game is simple, it is essentially tic tac toe played on a four by four grid.

Formal rule declaration

A line is either a row, column or a diagonal. There are two symbols, 'X' and 'O', but one or both may be substituted for a different symbol.
You score when you have three of your symbol and one of the other character.

These arrangements score:
X--O
OO--
XXXO
XOOX

O-XX -O-- --X- ---O

These do not score:

----
XXXX
----
OOOO

----
XXX-
----
OOO-

You win the game if you score and in the process do not score for your opponent.

Challenge

Solve this game. Your job is to provide a way to guarantee a win or tie, whichever is the optimal result.

Your solution may choose to either start first or second (and may therefore choose it's symbol). It is not mandatory to implement an interactive game where the user inputs moves and the corresponding display changes. It may also be a function or program which takes input as a game state, and outputs a new board or a description of their move. Either option must run within approximately ten seconds per move made.


Playing your player against any sequence of moves must give the optimal result. This means that you may assume the input position is one that it reachable from play with your player. Submissions must be deterministic, and do not necessarily need to supply a proof of optimality, but if they get cracked (by being beaten) your submissions will be considered invalid (you may leave it up, but add (cracked) in the headline).
This is a non-trivial task, so any valid submission is impressive and is worthy of an accepted tick, but I will make code golf the primary winning criterion.

The winner is chosen by going down this list till one winner is chosen.

  • Shortest solved implemenation which always wins
  • Shortest implementation
added 1 character in body
Source Link
R. Kap
  • 4.9k
  • 2
  • 15
  • 37
Loading
added 215 characters in body
Source Link
xnor
  • 146.6k
  • 26
  • 279
  • 652
Loading
added 98 characters in body
Source Link
Loading
added 71 characters in body
Source Link
Loading
deleted 216 characters in body
Source Link
Loading
Fixed some stuff up.
Source Link
clismique
  • 7k
  • 27
  • 72
Loading
Source Link
Loading