Questions tagged [board-game]

for challenges involving board games.

Filter by
Sorted by
Tagged with
16 votes
5 answers
2k views

Play Wythoff's Nim perfectly

Your goal is to write a perfect player for the game of Wythoff's Nim. Rules of Wythoff's Nim Wythoff's Nim is a deterministic two-player game played with two piles of identical counters. Players ...
user avatar
  • 137k
19 votes
2 answers
9k views

Rotate a Chinese checkerboard

A Chinese checkerboard looks like this (based on this question, but this time it has a fixed size): ...
user avatar
  • 36.1k
21 votes
2 answers
2k views

Play Connect 4!

Write a program to play the game of Connect 4. You are given the state of the board as input and you must decide which column to place your piece in to either get 4 in a row (horizontally, vertically,...
user avatar
19 votes
12 answers
2k views

Connect-n time!

https://en.wikipedia.org/wiki/Connect_Four Does anyone remember the 2 player game connect 4? For those who don't it was a 6x7 board that stands vertical on a surface. The goal of connect 4 is to, ...
user avatar
  • 5,030
43 votes
52 answers
5k views

Scrabble scorer

Challenge: Take a string of upper or lower case letters as input (optional), and calculate the score that string would get in a game of Scrabble in English. Rules: The score of each letter is as ...
user avatar
25 votes
3 answers
2k views

Leonhard loves labyrinths

The background My son Leonhard (4 years old) loves labyrinths. I don't know where he knows labyrinths from, but he paints them and knows quite well how they work: Recently, he started making a game ...
user avatar
23 votes
5 answers
3k views

Score a game of Go

Scoring a Go game is a task that is not all too easy. In the past there have been several debates about how to design rules to cover all the strange corner cases that may occur. Luckily, in this task ...
user avatar
  • 9,960
23 votes
5 answers
2k views

Chinese checkerboard

The game of Chinese checkers is played on a board with spaces in the shape of a six-pointed star: Image from Wikipedia We can create an ASCII-art representation of this board, using ...
user avatar
  • 32.5k
24 votes
15 answers
4k views

Determine a string's Scrabble score and validity

Your task is to determine if a given string is of proper length and can be represented with Scrabble tiles and, if so, output the sum of each letter's score. If you don't know how to play Scrabble:, ...
user avatar
15 votes
3 answers
1k views

Make a move on a Go board

You are given a board position for a Go game and a move to play. You need to output whether the move is legal or not, and the new board position if it is legal. A brief explanation of Go moves: the ...
user avatar
16 votes
4 answers
1k views

Can you win with two more moves at Three Men's Morris?

Bounties No. 1 (awarded) I'll throw in 50 rep for the first valid answer No. 2 (awarded) I'll throw in another 100 rep for the shortest valid answer. No. 3 (open for submissions) I'll ...
user avatar
15 votes
9 answers
901 views

Count the Liberties

Background This challenge is about the game of Go. Go is a game played on a board with a square grid N x N. You don't have to know how to play the game to do this ...
user avatar
  • 2,213
17 votes
0 answers
461 views

Play Thud! (Dwarf Edition)

Key links: Troll question Chat room Game Controller Interface Dwarf league table ...
user avatar
  • 11.1k
15 votes
17 answers
3k views

Tic-Tac-Toe - X or O?

Background Skip to "Task" if you are familiar with Tic-Tac-Toe (I think most are!) Tic-Tac-Toe is a famous two-player game. It consists of a 3x3 board that is filled gradually by two players ...
user avatar
  • 41.4k
14 votes
0 answers
425 views

Play Thud! (Troll Edition)

Key Links Dwarf question Chat room Game Controller Interface Troll league table ...
user avatar
  • 11.1k
7 votes
1 answer
3k views

Snakes and Ladders probability of winning

(This is my first Q here, and I don't know much about code golfing.) Your aim is to predict the winner of an ongoing Snakes and Ladders game. INPUT A single number (2-1000) indicating the number of ...
user avatar
6 votes
3 answers
2k views

Solving a "Ubongo"-puzzle

Some time ago I came across a game called Ubongo. The player got four shapes and has to put them together in a way, that the shapes form the shape of the board. One example is this: Note that the ...
user avatar
  • 193