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
25
votes
10answers
2k views

Score a game of Bowling

Your task is to sum up and output one player's score in a game of 10-pin bowling after up to 21 rolls. The rolls are represented as a sequence of integers in your preferred method of input. Each ...
24
votes
7answers
5k views

Who will win a Rock, Paper, Scissors, Lizard, Spock game?

There are several questions regarding this game, even a king-of-the-hill contest here. But I think all those challenges and contests need a way to automatically determine the winner of a game. So: ...
23
votes
5answers
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 ...
22
votes
2answers
795 views

Can you cast the spell?

In Magic: the Gathering, mages (known as "planeswalkers") battle each other by casting spells. Spells cost mana. Five colors of mana exist: White, Blue, Black, Red, and Green, represented as {W}, {U}, ...
20
votes
4answers
653 views

Plant trees in a park - As fast as you can!

This challenge is inspired by this app. The test cases are borrowed from that app. This is a fastest-code challenge, where the objective is to solve the largest test cases in the least amount of time....
19
votes
3answers
2k views

aHHHH! The Beasts are HHHHere!

As we learned from the IBM PC AT, YouTube (see video), Wikipedia (see article), and Sesame Street: The letter H is the most merciless letter of the alphabet! (...
5
votes
1answer
3k views

Shortest Way of creating a basic Space Invaders Game in Python

Your challenge is to create a basic version of Space Invaders in Python Rules Program must be not written in Py3K All levels must be randomly generated There must be a HUD showing the players score ...
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 ...
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 (...
21
votes
3answers
1k views

Solve Hitori Puzzles

Introduction Write a solver for the Hitori puzzles using least bytes. Challenge Your task is write a solver for the Hitori (ひとり, the word for "alone" in Japanese; the meaning of the game name is "...
16
votes
7answers
642 views

Magic: The Gathering Combat with Abilities

Related Goal: Given two creatures with optional combat abilities, return unique but consistent values that represent which creatures died, if any. Input: ...
13
votes
4answers
694 views

Return of the Hydra Slayer

Its been a while since you killed that hydra, you basked in the glory for years, but now people are calling you washed up, a has been. Well its time you prove them wrong, you've heard the whereabouts ...
12
votes
1answer
912 views

I want to watch you die of thirst

You are a traveller crossing the desert between two towns. You cannot carry enough water to get across without stopping. This is a variation of a classic puzzle. The Rules A desert looks like this: ...
10
votes
1answer
369 views

Crosses, no Noughts

Everyone realizes that Tic Tac Toe is a solved game. However, the Misère version of only-Xs provides an interesting alternative. In this version of the game, both players play Xs onto the board and ...
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 ...
25
votes
8answers
2k views

Golf a golf-scorer

As a kid, I used to play the card game "golf" a lot. Your challenge, should you choose to accept it, is to calculate the score of a golf hand. Since there are over 9000 variations on this card game1, ...
16
votes
4answers
969 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 ...
15
votes
3answers
841 views

Simulate a 'battle' in the playing card game 'Oorlog'

Let's build a simulation for an aspect in the card game, which I personally know by the Dutch name 'Oorlog' (translates to 'War'). How does 'Oorlog' work? Two decks of cards (each including two ...
14
votes
2answers
2k views

Play a perfect game of Mu Torere

Background Mu Torere is a game that is one of only two known to be played by the Maori people of New Zealand before European influence. This makes it a very unique game in that it has an "objective ...
11
votes
1answer
750 views

Frogger Champion

The Game Most of us know about Frogger, the 80's era arcade game where the objective is to hop a frog safely across a busy highway and a hazard-filled pond to arrive safely at home. A challenge was ...
11
votes
4answers
498 views

Name the Brag Hand

Background Brag is a card game similar in concept to, but simpler than, poker. A hand in brag consists of three cards and is ranked as follows from highest to lowest: Three of a kind - all three ...
10
votes
3answers
866 views

Binary Puzzle Solver

Introduction Rules of the puzzle: The puzzle Binary (also known as Takuzu or Subiku) is very simple to understand, and has only a few rules: Since the name of the game is binary it's pretty obvious, ...
10
votes
2answers
301 views

Plant trees on a golf course!

This challenge is inspired by this app. This is a much easier version of this challenge. This challenge is code-golf, while the other one is fastest-code. You'll be given a square input grid, of ...
4
votes
2answers
432 views

Simple One Game Blackjack

This is a very stripped down version of A BlackJack KOTH contest... This is the goal: Upon the execution: There are two inputs, "H" to hit (have the code deal a card), "S" to stand (Stop getting ...
1
vote
0answers
76 views

Solving Des Chiffres Et Des Lettres - The total is right [duplicate]

One of the games of the French TV show Des chiffres et des lettres, called Le compte est bon ('The total is right'), consists of the following : You get a number A between 101 and 999 as well as six ...
1
vote
1answer
444 views

Run a game of Flood

This is a Code Golf challenge. Flood is a game in which the player is presented with a game board such as this: On each turn, you choose a colour (on the link above, by clicking a square containing ...
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 ...
20
votes
2answers
1k views

The Combinatorics of Transistor

The video game Transistor features a very interesting ability system. You collect 16 "Functions" which you can use in 16 different slots. What's interesting is that there are 3 types of slots and ...
18
votes
2answers
795 views

Play a game of Yahtzee

In the game Yahtzee, players take turns rolling 5 6-sided dice up to three times per turn, possibly saving dice between rolls, and then selecting a category they wish to use for their roll. This ...
18
votes
4answers
867 views

Roll my D&D character's ability scores

In Dungeons and Dragons, some of the most important atributes of a character are the ability scores. There are 6 ability scores, for the six abilities. The abilities are Strength, Dexterity, ...
15
votes
30answers
2k views

Even or odd: three player

It's a three players game, play with one hand. At same time, each player show his hand with 0 to 5 fingers extended. If all player show same kind of (even or odd) number, there is no winner. But ...
13
votes
3answers
2k views

Hexcellent Minesweeping

Hexcells is a game based off of Minesweeper played on hexagons. (Full disclosure: I have nothing to do with Hexcells. In fact I don't really like the game.) Most of Hexcells rules can be pretty ...
13
votes
2answers
955 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 ...
12
votes
3answers
2k views

Help me Shut the Box

The inspiration for this challenge should be ridiculously obvious at the time of posting. The Task You must create a Shut the Box style program (not function, program). The basics of shut the box ...
12
votes
6answers
1k views

Score a game of Yahtzee

For each of the 13 rows of a Yahtzee scoresheet you are given (from stdin) a space separated list of 5 numbers (dice). Your task is to calculate the score for each line and output the Grand Total of ...
11
votes
4answers
547 views

Score a game of Load, Defend and Shoot

When I was a child, I used to play this game a lot. Rules There are two players (let's call them A and B), and each player uses his hands as guns. There are three possible moves: Hands up to load ...
10
votes
7answers
2k views

Bingo card generator

A Bingo card is five columns of five squares each, with the middle square designated "FREE". Numbers cannot duplicate. The five columns are populated with the following range of numbers: B:1-15 I:...
7
votes
4answers
435 views

1326 starting hold'em combos

The goal is to get all combinations of hold'em starting hands (every two card combination) in the shortest amount of code. A hold'em hand is two distinct cards dealt from a standard deck of 52 cards, ...
7
votes
1answer
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 ...
5
votes
1answer
464 views

Bot: Outsnake the game!

So, I wrote a simple Javascript game (as yet unnamed) and naturally I wanted to write an API so I could write a bot to play it for me, and naturally I wanted to let the PPCG community have a go for ...
-1
votes
1answer
207 views

Solitaire no-win states [duplicate]

NOTE: SIMILIAR TO Solitaire Dreams - Creating a winnable solitaire starting hand Find a minimum of 5 deck orders where if the cards were dealt out would create a game of Klondike Solitaire where ...

1
2