This hole is experimental, no solutions will be saved. Please leave feedback on the GitHub issue.

Reversi

Details

Output the possible moves for O on a Reversi board.

In Reversi, you can only place a tile in a free spot such that there are one or more opponents tiles between the spot and a friendly tile in at least one direction. Directions are either horizontal, vertical, or diagonal.

For example, given:

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

O can only place on spots 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 can assume an odd number of tiles on the board.

Your program should output the board with valid position replaced with !. Each output should be seperated 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.
Fennel 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 seperate 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.