Please in order to save solutions and appear on the leaderboards.

Reversi Authors

Reversi

Details

Output the possible moves for O on a Reversi board.

In Reversi, X and O take turns placing tiles on empty squares on the board. To determine if a move is legal, draw a straight line in any direction (horizontal, vertical, or diagonal) starting from the square. If the line intersects another friendly tile, separated from the square by only opponent tiles, that square is a legal move.

For example, given:

......
.OXX!.
..X...
...!..

O can only place on squares marked with !.

Assume a board size of 8x8 and a position reachable on O's turn, from the following starting position:

........
........
........
...OX...
...XO...
........
........
........

X moves first, so you may assume an odd number of tiles on the board.

Your program should output the board with each possible legal O move replaced with !. Each output should be separated by a blank line.

0 bytes, 0 chars
Restore solution
All
Compiled from AT&T syntax to x86-64 Linux. Use syscalls to write output.
Arturo is an experimental language, no solutions will be saved. Please leave feedback on the GitHub issue.
Fennel is an experimental language, no solutions will be saved. Please leave feedback on the GitHub issue.
Uiua is an experimental language, no solutions will be saved. Please leave feedback on the GitHub issue.
ctrl + enter or

Delete Solution

Are you sure you want to delete your solution(s) for Reversi?

If you have separate bytes and chars solutions then both will be deleted.

This is irreversible, please backup any code you care about.

Type I understand and press confirm to continue.