We’re rewarding the question askers & reputations are being recalculated! Read more.

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
22
votes
9answers
2k views

Name the poker hand

Name the poker hand Given five cards, output the name of the poker hand, which will be one of: ...
1004
votes
6answers
211k 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 ...
42
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 ...
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
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
8answers
25k 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 ...
21
votes
32answers
5k views

Rock Paper Scissors

Implement the classic rock paper scissors. Conditions: user will input 'r', 'p' or 's' program will output 'r', 'p' or 's' and the result program choice ('r', 'p' or 's') has to be pseudo random (I'...
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 ...
24
votes
17answers
6k views

Alice and Bob have a fight

Alice (A) and Bob (B) decided to have a battle. Each combatant has 10 health. They take turns to roll a 6 sided die for damage. That damage is removed from their opponent's health. In the end either ...
27
votes
2answers
3k views

Implement a Non-Guessing Sudoku Solver

Implement the shortest Sudoku solver. Sudoku Puzzle: ...
16
votes
5answers
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 ...
10
votes
14answers
2k views

Guess the number

Description Create a fully working "Guess the number" game. The game is played by two players as follows: player one chooses a number (A) between 1 and N player two tries to guess A choosing a ...
20
votes
13answers
4k views

Implement a Brute Force Sudoku Solver

Implement the shortest Sudoku solver using guessing. Since I have received a few request I have added this as an alternative question for those wishing to implement a brute force sudoku solver. ...
19
votes
29answers
5k views

Determine win in Tictactoe

Let's play some code golf! Given a tic-tac-toe board state (Example:) |x|x|o| |x|o|x| |o|o|x| Determine whether a game is a ...
13
votes
1answer
839 views

Solitaire Dreams - Creating a winnable solitaire starting hand

It's me. Cave Johnson. It's May 21st. You are working at Aperture Science, finest company on Earth, and tomorrow we're releasing Version 3.0 of our flagship windowing system (or WindowS): CavOS. ...
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 ...
13
votes
2answers
4k views

Frogger-ish game

How about giving the good ol' arcade game Frogger a revival, Code Golf-style! Your task is to create a version of this classic game, with as few characters of code as possible. Use the language of ...
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 ...
25
votes
3answers
1k 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 ...
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 ...
14
votes
10answers
3k views

Hangman wordgame golf

Inspired by reddit. Write a program which plays Hangman. The program chooses a random word from a list of N words, where N > 2. The word list can be provided to the program in any way you choose. ...
8
votes
5answers
1k views

Let's play Hangman?

According to this page, the best strategy to guess English hangman words is to calculate the odds of each letter in a word list that meet our conditions. But, as I'm really lazy, I don't really want ...
13
votes
1answer
776 views

Become the Hydra Slayer

You are the best and most famous hero of the area. Lately there have been rumors that a Hydra has been hanging out in a nearby ravine. Being the brave and virtuous hero that you are you figure you'll ...
13
votes
2answers
1k views

A BlackJack KOTH contest

BlackJack As I had a blast working on the original KOTH challenge, I wanted to come up with another one. For me, the fun of these AI challenges is in refining a comparatively simple bot ...
13
votes
2answers
1k views

What are you waiting for? (A mahjong solver)

Idea thanks to @MartinBüttner from a discussion in chat Mahjong is a tile game that is immensely popular in Asia. It is typically played with four players, and the goal of the game is to be the first ...
10
votes
5answers
1k views

Name the poker hand - 7 cards edition

The Challenge: In this question: Name the poker hand you had to take a five card poker hand and identify it. This question is similar, with two twists: First, the output will be in all lower case. ...
8
votes
4answers
1k views

Build a Simple Roguelike

This challenge is based on one proposed on the usenet group rec.games.roguelike.development a few years ago. I can't find the original newsgroup post, but you can have a look a the Github repo of ...
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 ...
14
votes
11answers
988 views

The game of Sevens! Who said what?

The game of Sevens is played as follows: n players sit in a circle, and start counting up from 1, passing to the left (or from player ...
14
votes
4answers
2k views

Compare two poker hands

Challenge: Given two five-card hands, determine which one wins by the standard ranking of poker hands. Input: Ten cards separated by spaces from stdin or as command line arguments, whichever you ...
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 ...
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? ...
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 ...
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. ...
33
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 ...
19
votes
2answers
3k views

Mastermind strategy

I could only find code-golf challenges for Mastermind, so here's a code-challenge version that I would have liked to take on myself. An optimal strategy for the normal Mastermind game, MM(4,6), was ...
19
votes
5answers
4k views

2048 Bot Challenge

We have been cloning 2048, analyzing 2048, but why haven't we played it yet? Write a 555 byte javascript snippet to play 2048 automatically, the best score after an hour will count (see scoring below)....
16
votes
4answers
6k views

Best Scoring Boggle Board

I was interested in seeing the answers to this (now defunct) question, but it has never been corrected/improved. Given a set of 6-sided Boggle dice (configuration stolen from this question), ...
68
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 (...
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. ...
25
votes
9answers
9k views

Recreate a 'Snake' game in a console/terminal

Games are fun this codegolf here was so fun I had to make a version for other classic games similar in complexity. Shortest Way of creating a basic Space Invaders Game in Python This time, however, ...
13
votes
3answers
4k views

Guess the word (aka Lingo)

The goal of this challenge is to write a program able to guess a word in the smallest possible number of attempts. It is based on the concept of the Lingo TV show (http://en.wikipedia.org/wiki/Lingo_(...
34
votes
43answers
5k 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 ...
20
votes
7answers
3k views

Take It or Leave It II: A Game Show for Computers

This is the second in a series of puzzles that I will be posting every Monday at Midnight PST. The first puzzle is located Here. Context: A reclusive billionaire has created a game show to attract ...
9
votes
0answers
1k views

Minimal Sudoku Generator [closed]

Ask questions if you need to, I'll elaborate on anything that needs clarified. My challenge is to unsolve a sudoku to a minimal state. Basically take a supplied, solved, sudoku board and unsolve it ...
27
votes
1answer
967 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 ...
26
votes
3answers
9k views

Google's doodle on kids coding: shortest program solving all the levels

Today's Google doodle is about Celebrating 50 years of Kids Coding: The goal is program the path of a little bunny so that it can eat all the carrots. There are 4 types of blocks (see pictures below): ...
21
votes
20answers
2k views

Prisoner's Dilemma with access to opponent

In this challenge, you will write a bot that play's the prisoner's dilemma. Here's the catch: you will not have access to the history of previous games. Instead, you will have access to the opponent ...
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 ...