Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [game]

This challenge is generally based upon, related to, or simulates a game or some portion of one.

Filter by
Sorted by
Tagged with
996
votes
6answers
210k views

Build a working game of Tetris in Conway's Game of Life

Here is a theoretical question - one that doesn't afford an easy answer in any case, not even the trivial one. In Conway's Game of Life, there exist constructs such as the metapixel which allow the ...
133
votes
22answers
11k views

Red vs. Blue - Pixel Team Battlebots

This contest is officially over. The Blue Team won! I autoran two sets of 50 battles and amazingly, Blue won all 100 of them. Looking at the stats, it is clear that the cooperative entries of ...
104
votes
32answers
11k views

Formic Functions - Ant Queen of the Hill Contest

Watch live | Active answers | Add new answer | Chat room | Source code | Leaderboard New tournaments whenever needed. New players and new updates very welcome. Not actual game footage. Each player ...
70
votes
50answers
7k views

Score rock-paper-scissors

Given two string inputs of "Rock", "Paper", or "Scissors", determine the outcome of the RPS round. Output 1 if the first player wins, -1 if the second player wins, or 0 for a tie. ...
68
votes
10answers
6k views

Rock, Polyglot, Scissors

Write a program that is a polyglot in three languages that plays rock–paper–scissors. The input for any version of the program is always one of the strings rock or ...
67
votes
47answers
9k views

Magic the Gathering: Friends or Foes?

In the card game Magic: the Gathering there are five different colours, which represent loose affiliations of cards, White (W), Blue (...
58
votes
49answers
10k views

A game of dice, but avoid number 6 [closed]

Tournament over! The tournament is now over! The final simulation was run during the night, a total of \$3*10^8\$ games. The winner is Christian Sievers with his bot OptFor2X. Christian Sievers also ...
58
votes
27answers
8k views

Honest Rock, Paper, Scissors

Many people consider RPS to be a game of chance. If both players play unpredictably, the best strategy is to play randomly. However, let's introduce a bit of predictability to it. Each bot will have ...
55
votes
9answers
5k views

Codémon, I choose you!

Your kindly neighbour, Doctor Tree, just gave you three magical creatures called Codémon. There's a battle tournament in the nearby town of Colorville. Are you the very best, like no one ever was? ...
54
votes
1answer
3k views

Build a fewest-moves freecell solver

In the game of Freecell, you are tasked with building four foundation piles in suit from ace to king, on a layout where you build downward in alternating colours. However, you can only build one card ...
53
votes
9answers
33k views

Create a simple 2048 game clone

2048 is an incredibly fun and addictive game in which the goal is to create a tile with 2048 on it. Here's a short description of the game: Pressing an arrow key will slide all the blocks in the ...
49
votes
7answers
4k views

Create a User-Profile Mini-Game

Yesterday, I stumbled on a very clever thing. Yes, that's a working implementation of Tic-Tac-Toe on a user profile page, from @minitech. Of course, the moment I ...
45
votes
47answers
5k views

Count without 3

Background When I was in elementary school, we used to play a game in math class that goes as follows. All kids sit in a big circle and take turns counting, starting from 1. However, the following ...
42
votes
50answers
4k 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 ...
42
votes
6answers
2k views

Let's Play Mafia!

Mafia (also known as Werewolf) is a party game that plays roughly like this: The game begins on day 0. After every day n comes a night ...
41
votes
5answers
3k views

Block Building Bot Flocks!

The contest is over! Intro This is an interactive king-of-the-hill contest where the controller is fully contained in a Stack Snippet at the bottom of the question. The controller automatically ...
40
votes
4answers
1k views

Dungeon Crawler

Input A binary matrix \$M\$ representing the walls of a dungeon. The position \$(x,y)\$ of the player within the dungeon. The direction \$d\$ that the player is currently facing (0 = North, 1 = East, ...
39
votes
8answers
6k views

Hunt the Wumpus

When I was a lad, kids would wander into computer stores and play Hunt the Wumpus until the staff kicked us out. It was a simple game, programmable on the home computers of the mid-1970s, machines so ...
39
votes
3answers
851 views

Tool-Assisted Code Golf

TAS Golf In the style of a tool-assisted speedrun with a code-golf twist, the goal of this challenge is to complete World 1-1 of the original Super Mario Bros game for the NES in your chosen ...
38
votes
4answers
1k views

Let's play Meta tic-tac-toe!

Lets play a game of Meta tic-tac-toe! This is a king-of-the-hill tournament of Meta tic-tac-toe. The rules of Meta tic-tac-toe are as follows: All of the regular rules of tic-tac-toe apply. There ...
37
votes
41answers
4k views

The Cake Cutting Contest

It's my 17th birthday and you're invited to my party! And as always at parties, there will be cake. One cake... And you need as much of it as possible. As this is a fair party, each of us will ...
35
votes
23answers
4k views

Noisy Iterated Prisoner's Dilemma

In this challenge, you will play the noisy iterated prisoner's dilemma. The Prisoner's dilemma is a scenario in game theory where there are two players, each with two options: cooperate, or defect. ...
35
votes
24answers
3k views

Draw me a domino

Challenge Given two digits 0-9 as input, output a domino (from the double-nine domino set) with these number of pips (dots) on the two faces. The ten possible faces look like this (separated by pipes)...
34
votes
43answers
4k views

Yahtzee Small Straight Detection

In the game Yahtzee, players roll five six-sided dice, and attempt to create certain hands to score points. One such hand is a small straight: four consecutive numbers, not necessarily in order. The ...
34
votes
28answers
6k views

Choose The Powerball Numbers!

Powerball is an American lottery that has recently gained attention because the current jackpot (as of January 11, 2016) is the largest lotto prize in history, at about $1.5 billion (USD). Powerball ...
34
votes
1answer
2k views

Minesweeper Solver

We already generated Minesweeper fields, but someone really has to sweep those generated mines before PCG blows up! Your task is to write a Minesweeper Solver that is compatible with a slightly ...
33
votes
15answers
5k views

How much Mana do I need?

Dungeon Master was one of the first ever real-time role-playing games, originally released in 1987 on the Atari ST. Among other exciting things for the time, it offered a rather sophisticated spell ...
33
votes
10answers
2k views

Verify a Minesweeper board

Your goal is to check whether a completed Minesweeper board is valid. This means that each number is a correct count of mines in cells adjacent to it, including diagonals. The board does not wrap ...
33
votes
15answers
5k views

Let's play Mölkky!

Mölkky Mölkky is a Finnish throwing game. The players use a wooden pin (also called "mölkky") to try to knock over wooden pins of almost similar dimensions with the throwing pin, marked with numbers ...
32
votes
34answers
5k views

First-price sealed-bid auction

Final Result The competition is over. Congratulations to hard_coded! Some interesting facts: In 31600 out of 40920 auctions (77.2%), the winner of the first ...
32
votes
29answers
7k views

Dollar Bill Auction

This is a KOTH challenge for the dollar bill auction game in game theory. In it, a dollar is being sold to the highest bidder. Bids go up in increments of 5¢, and the loser also pays their bid. The ...
32
votes
32answers
4k views

Russian Roulette, Reloaded

Let's play Russian Roulette! Normally, this would be a race to write the shortest MOD 6 program, but that's not very realistic, as the chance of winning decreases with each click. Here are the rules: ...
32
votes
4answers
3k views

Invert a Minesweeper Board

Minesweeper is a popular computer game that you have probably wasted time playing where you try to reveal the cells that are mines in a rectangular grid based on hints of how many neighboring mines ...
31
votes
2answers
2k views

Optimal Games of Tic Tac Torus

This challenge is about the game Tic Tac Toe, but it's played on a torus. How to play To create the necessary game board, you start out with a regular Tic Tac Toe game board. First fold it into a ...
30
votes
29answers
2k views

The Lucky House

There's a minigame in Super Mario 3D World known as the Lucky House. It consists of a slot machine with 4 blocks. Each block may be one of 5 different icons (Flower, Leaf, Bell, Cherry or Boomerang) ...
30
votes
1answer
2k views

Magic: the Gathering Combat Golf

Magic: the Gathering is a trading card game where, among other things, players play cards representing creatures, which can then attack the other player, or defend against the other player's attacks ...
29
votes
6answers
2k views

Can I sweep the mines?

Minesweeper is a popular puzzle game where you must discover which tiles are "mines" without clicking on those tiles. Instead, you click on nearby tiles to reveal the number of adjacent mines. One ...
29
votes
11answers
2k views

Which wire to cut

This task is about compressing and processing a sequence of conditionals. In the game Keep Talking and Nobody Explodes, a bomb defuser must disarm a bomb with the help of instructions relayed by ...
28
votes
8answers
24k views

Pong in the shortest code

The challenge is simple. Give the shortest code possible to reproduce the classic 2-player game of pong http://en.wikipedia.org/wiki/Pong . The level of graphics and functionality should be as close ...
28
votes
21answers
4k views

Morra, the Noble Game of Kings

Background The game of Morra is a simple game. In the "original" version, several players simultaneously throw out a number 0-5 with their hands while guessing the total sum of everyone's hands. ...
28
votes
12answers
1k views

Letter Boxed validator

The New York Times has a daily online game called Letter Boxed (the link is behind a paywall; the game is also described here), presented on a square as follows: You are given 4 groups of 3 letters (...
28
votes
12answers
2k views

Terra Mystica: Cycling Power

The boardgame Terra Mystica has some very interesting mechanics for one of the primary resources, power. Instead of gaining and spending units of power from a bank, each player starts the game with ...
28
votes
8answers
9k views

Write a Hangman Solver

You are required to write a Hangman solver. Testing against this English word list[1], the solver that solves the most number of words wins, with the number of total incorrect guesses being the tie-...
28
votes
5answers
2k views

Take It or Leave It: A Game Show for Computers

Context: A reclusive billionaire has created a game show to attract the world's best and brightest programmers. On Mondays at the stroke of midnight, he chooses one person from a pool of applicants ...
28
votes
7answers
3k views

Score a Cribbage Hand

This challenge is to score a Cribbage hand. If you don't play Cribbage, you've got some learning to do. We play with a standard poker deck, and a hand consists of four cards plus the "up card". ...
28
votes
13answers
1k views

Adventurers in the Ruins

Test Driver • Challenge Discussion • Submit Adventurer (Image Source) Several rival adventurers are raiding the ruins for treasure, but they can only carry so much at a time and have their ...
27
votes
9answers
1k views

“You must construct additional pylons!”

Introduction In the strategy game Starcraft 2, there are three "races" to choose from: Terran, Zerg, and Protoss. In this challenge we will be focusing on the Protoss and the iconic phrase "You must ...
27
votes
6answers
1k views

Team of The Hill!

This challenge was inspired by @HelkaHomba's excellent challenge Red vs. Blue - Pixel Team Battlebots. That challenge was probably the best one I've seen on this site. Ever. My challenge is still a ...
27
votes
1answer
966 views

Find Diffy Games

A fun game to play if you are bored is the Diffy Game. It is a one player game that is pretty simple and can consume a good deal of your time. The Diffy game works like as follows: You start with a ...
27
votes
2answers
3k views

Implement a Non-Guessing Sudoku Solver

Implement the shortest Sudoku solver. Sudoku Puzzle: ...