Questions tagged [game]

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

5
votes
1answer
117 views

Letter Boxed, part 2: this time, solve it

This challenge is a sequel to 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 ...
27
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 (...
23
votes
17answers
3k views

Who won a Game of Bar Dice?

Challenge Bar Dice is a simple game played in a Bar with Dice (hence the name). You roll 5 six-sided dice and attempt to make the best hand. Scoring is based on amassing the largest number of ...
23
votes
9answers
8k 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, ...
12
votes
2answers
373 views

Who can escape the Nonary Game?

The Nonary Game is a fictional game played in the video game trilogy of the same name. Your goal is to find how many players (at best) can escape a given game, in as few bytes of code as possible. ...
18
votes
13answers
3k views

Evaluate a Dice 10,000 roll

Introduction Dice 10,000 is a dice game which can be played with 6 dice and something to write. Players roll the dice multiple times a turn and gain a score at the end of it. The player who reaches ...
18
votes
11answers
868 views

Simulate a game of Craps

Craps is a fairly simple dice game often played in casinos. Even if you aren't a gambler (which I'm not), it's still a fairly interesting game. Here's the rules: At the start of a game of Craps there'...
42
votes
49answers
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 ...
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): ...
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 ...
15
votes
3answers
4k views

Dobble/SpotIt card generator

Introduction Dobble/SpotIt is a card game, where people have to spot same symbol on pair of cards in shortest time, indicate it and move to next pair. Each card has multiple symbols (8 in normal ...
25
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 ...
12
votes
1answer
537 views

Make a Frogger Solver

🐸🐸 You must make the shortest program to always find the optimal solution to a simplified Frogger game on a 9x9 grid. Course Elements: L - Log (Length: 3-4). ...
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 ...
19
votes
10answers
1k views

Connect Four Validator

Introduction Connect Four is a game where you attempt to get four in a row: horizontally, vertically, or diagonally. In this code golf, we will be trying to find who won, given a game board. There ...
23
votes
3answers
2k views

Place a Carcassonne tile

The board game In the board game "Carcassonne" players place tiles by matching their edges and earn the highest scores through creating large contiguous areas of terrain. The following are (roughly) ...
38
votes
3answers
780 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 ...
11
votes
4answers
3k views

Recreate the classic snake Game

The challenge is to create the classic Snake game using as few bytes as possible. Here are the requirements: The game must be implemented in a typical 2-dimensional layout. The snake should be able ...
22
votes
1answer
663 views

Automatic price-identification of scrolls in Nethack

OH GODS NO!! You can't leave us here with Doorknob! It'll be nethack everywhere! - 1d ago by Geobits Well, couldn't disappoint... Introduction (you can skip this section if you don't care about ...
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 ...
58
votes
49answers
10k views

A game of dice, but avoid number 6

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 ...
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 ...
10
votes
11answers
954 views

Playing Pickomino

In the game Pickomino, there are several tiles lying in the middle of the table, each with a different positive integer on them. Each turn, the players roll dices in a certain way and get a score, ...
22
votes
8answers
2k views

Score a single dart

Introduction Write a program or function that, given the coordinates of where a dart lands on a dartboard, return the score of that dart. Dart coordinates are given as two integers, ...
11
votes
9answers
1k views

Mid-Autumn Festival gambling game

Tomorrow is the Mid-Autumn festival, and in the spirit of that holiday, I will introduce a gambling game that we (people from Xiamen) play during the holiday! Rules The game is played with six 6-...
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 ...
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 ...
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, ...
8
votes
6answers
829 views

Find the optimal nim move

The game Nim is a mathematical strategy game, where 2 players take turns taking items from distinct heaps. On your turn, you must take at least one item, and you may take as many as you want, ...
20
votes
18answers
1k 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 ...
9
votes
7answers
325 views

Magic: The Gathering, Paying for Spells

For more MtG-goodness: Magic: The Gathering Combat with Abilities Premise: In Magic: the Gathering, you cast spells by paying their mana cost by tapping lands for the required amount. These lands ...
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 ...
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-...
11
votes
21answers
679 views

Minecraft Language Files Updater

In 1.13, Minecraft language files were switched from being a simple multi-line key=value format to JSON. Challenge Write a program converting from the original format returning a JSON string. Input ...
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 ...
16
votes
7answers
581 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: ...
1
vote
2answers
153 views

Accordion Solitaire: Which First Moves Can I Make?

Introduction: Unfortunately an Accordion Solitaire Solver challenge already exists (Solve a game of Accordion), so instead this easier related challenge. Let's start by explaining how Accordion ...
10
votes
5answers
335 views

Amidakuji (阿弥陀籤) simplification

If you have ever had any exposure to Japanese or East Asian culture you will have surely encountered the Amidakuji game: As Wikipedia explains, it is a type of lottery drawn on paper and used to ...
964
votes
6answers
199k 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 ...
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 ...
103
votes
31answers
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 ...
16
votes
15answers
2k views

Convert Japanese Mario titles to American titles

The naming conventions for games in the Super Mario series is very strange, and don't match up between regions. ...
16
votes
10answers
558 views

Risk Battle: Going Down

Given two lists of dice rolls for a battle in Risk, your program or function must output how many troops each player loses. Background You do not have to read this, for it is merely background. ...
24
votes
7answers
3k views

Flappy Bird Clones :)

Everyone's been freaking out about that stupid "Flappy Bird" game being removed. So, your task is to crate a Flappy Bird Clone game. Its really simple. Here are the guide lines: It can use either ...
6
votes
5answers
404 views

Watch the bookie win

When you roll a die, you have a 6:1 chance of any given option. There's a bookmaker taking bets on die rolls. He owns £20 at the start of the game. The bookmaker offers odds of 4:1, but gamblers ...
5
votes
5answers
501 views

Role-Playing Game Dice-Rolling

Background When playing an RPG such as Dungeons & Dragons, Pathfinder, or Paranoia, players each need a set of dice. You are hosting one such game this weekend, and some of the friends you ...
11
votes
9answers
762 views

Let's practice the scoring rules of 421!

421 is a rather popular dice game in France and some other European countries. It is mostly played in bars and pubs to determine who's going to buy the next round of drinks. The full game is usually ...
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". ...
12
votes
2answers
373 views

Play a game of Dice Cricket

Dice Cricket is a game I was introduced to as a child and have used as a way to pass time for years since. I couldn't find a Wikipedia page so I'll explain the rules below. Dice Cricket Rules ...