# Questions tagged [game]

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

309 questions
Filter by
Sorted by
Tagged with
3k views

### How many cacti can I plant here?

Given a Minecraft terrain as a 2-dimensional array of integers or similar datastructure, determine the maximum number of cacti that can be planted on it. The integers represent the height (y) of the ...
• 479
3k views

In this challenge, you will play the iterated Prisoner's Dilemma, but with a twist: There's also an adversary trying to mess you up! The Prisoner's dilemma is a scenario in game theory where there are ...
• 42k
3k views

### Do you win a Numeric Mahjong?

Background Numeric Mahjong is a hypothetical variation of Japanese Mahjong, played with nonnegative integers instead of Mahjong tiles. Given a list of nonnegative integers, it is a winning hand if it ...
• 76k
3k views

### Play a game of memory

Playing the game of memory against a machine is highly unfair, because they play almost as good as small children. So let's make the machine play alone, but in a fair way: Input: 1...26 pairs of ...
• 2,501
1k views

### Optimal Duck Game Moves

How to play the duck game This is a 2-player game. First, we start with a line of blue rubber ducks (represented here as circles): 🔵🔵🔵🔵🔵🔵🔵 Now, in each ...
• 18k
964 views

### Critical Calculations

Background In the game stick ranger, there is an item which grants the character the ability to get critical hits. Each time a projectile hits an enemy, it has some probability to be a critical hit (...
• 4,257
2k views

### Calculate Bloons RBE

In Bloons Tower Defense 6, the strength of different bloons can be measured by their Red Bloon Equivalent (RBE), or the number of single pops it takes to completely defeat the bloon. The RBE for the ...
• 358
770 views

### On The Subject Of Simon Says

This challenge is from a game, Keep Talking And Nobody Explodes. This is like one of those toys you played with as a kid where you have to match the pattern that appears, except this one is a knockoff ...
• 5,941
620 views

### Generate all possible equations with 10 characters

Nerdle is a Wordle variant, in which instead of words, the answers are equations. Each equation entered in the game must be a valid one. Examples: 13³-1=2196, ...
• 151
3k views

### Create a bingo card generator

Bingo Bingo is a numbers game where players match randomly drawn numbers to the numbers on their cards. Each bingo card is a square grid with 25 spaces, and the columns of the grid are labeled with ...
• 46.3k
665 views

### CGAC2022 Day 19: I Made It Out Of Clay

Part of Code Golf Advent Calendar 2022 event. See the linked meta post for details. Happy Hanukkah! A beloved Hanukkah tradition for many, the game of Dreidel (s'vivon in Hebrew) is a betting game (...
• 1,585
1k views

### Rolling a 1x1x2 block

Rolling a 1x1x2 block This challenge is inspired by the game Bloxorz. Like that game, there is a 1x1x2 block, which may be moved on a square grid in any of the four cardinal directions. It moves by ...
2k views

### Does the sequence shut the box?

Determine whether a given sequence could be a winning sequence for the game shut the box. Background There are a few variants to this game, so I'll clarify the rules here. Play begins with 12 tiles (1 ...
• 4,257
1k views

### Count Futoshiki row solutions

Futoshiki is a logic puzzle where an $n×n$ Latin square must be completed based on given numbers and inequalities between adjacent cells. Each row and column must contain exactly one of each number ...
• 3,737
511 views

### Use a Finite Combo in Magic the Gathering to Produce Graham's Number

Produce Graham's Number in Magic the Gathering using the fewest number of cards and without using any infinite combos. Rules: Producing Graham's number means do anything that requires Graham's number ...
• 407
5k views

### Super Mario 64 RNG

Introduction Super Mario 64 has a heavily overcomplicated RNG, ably explained here by Pannenkoek. I thought it might be interesting to implement it. Challenge Implement the RNG function, except for ...
• 1,757
382 views

### Tile stacking with ■ and □

In this challenge you will receive as input a list of binary lists. The list represents a game board with each element representing a location on the board. The list at each location represents the ...
• 98.5k
834 views

### Count the Liberties - Advanced

Here's an advanced version of the Count the Liberties challenge. The definitions of the terms liberty and group are the same as the previous challenge, so have a look at the previous one for details, ...
• 2,365
475 views

### Resolve a Super Auto Pets Round

In Super Auto Pets, players build teams of animals that face off in battles to the death unconsciousness. Each animal has an Attack and Health value, and combat occurs in iterations of the following ...
• 1,513
544 views

### The maximum liberty of a group on a Go board

Bounty One of the convincing conjectures, by Loopy Walt is, ...
• 2,365
978 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 ...
• 2,365
485 views

### Score a curling end

Curling is a sport where two teams aim to place stones as close to the centre of a target as possible. The winner of a curling end is the team whose stone is closest to the centre – they score as many ...
• 3,737
564 views

### Mahjong Checker

Mahjong is a tabletop game played using tiles. It features three "number" suits (pins, sous, mans, represented as p, s ...
• 5,079
1k views

### Solve Rubik's Clock

Rubik's Clock is a round(ish) puzzle with two flat sides. On each side, front and back, there are 9 clock faces, arranged on a 3x3 grid. In addition, there are 4 pegs (switches) in between the clock ...
• 7,016
264 views

### Score a Scrabble Play

Background In Scrabble, players take turns placing tiles on a grid so that each contiguous set of (more than one) tiles in every row and column makes a word. In one play, tiles can be placed anywhere ...
• 1,513
7k views

### Highlight a Wordle guess

In Wordle, you try to guess a secret word, and some letters in your guess are highlighted to give you hints. If you guess a letter which matches the letter in the same position in the secret word, the ...
• 23.7k
3k views

### Play the Fruit Box Game

Play the Fruit Box Game Intro Fruit Box is a game consisting of a 10x17 grid of numbers, each between 1 and 9, where the goal is to clear as many numbers as possible in a two-minute time window. In ...
• 509
297 views

### AoCG2021 Leftover: Recursive Combat

This challenge is one of the two challenges which were planned for Advent of Code Golf 2021, but didn't fit into the 25-day schedule. Related to AoC2020 Day 22, Part 2. Combat is a simple two-player ...
• 76k
713 views

### Solve an Inglenook Sidings Puzzle

Solve an Inglenook Sidings Puzzle Background The Inglenook Sidings Puzzle is a shunting/switching yard puzzle by Alan Wright for model railroading. The rules for the puzzle are as follows: (Source) ...
• 9,348
262 views

### A rolling drop gathers all pearls?

Quell is a single-player grid-based puzzle game. Pearls are scattered across a 2D map and the aim is to collect them all by rolling a drop of water over them. For this challenge we will only consider ...
• 11.2k
5k views

### Is This Scrabble Board Valid?

Background Scrabble is a word game in which players collaboratively build a board consisting of letter tiles that spell words. Each word must be connected to another word, and players gain points ...
• 1,513
1k views

### Best response to the Evolution of Trust? - Part 1

Backstory I was fiddling around with the Evolution of Trust and thought of this.Warning: I recommend you go check it out first before attempting this challenge. Summary for people who haven’t played A ...
• 390
2k views

### How many Sets are there?

This is similar in concept to this challenge, but that is pretty restrictive on input and output and I think opening up these restrictions would lead to a completely different set of solutions that ...
• 1,513
354 views

### Will Alice win in this Stick Bomber game?

Background Stick Bomber is a two-player game I just made up. Initially, some sticks are placed in one or more groups, and the sticks in each group are laid out in a straight line. So a configuration ...
• 76k
409 views

### Will the hydra finally die? Part II

Background This is a follow up question to the question: Will the Hydra finally die? As before a dangerous A Medusa have released a dangerous Hydra which is revived unless the exact number of heads it ...
3k views

### Roll up a D&D character, with options

I'd like to roll up the ability scores for my Dungeons and Dragons character. But I'd also like them to be balanced (and slightly better than average). Typically, a character's stats are created by ...
• 159
593 views

### Play Thud! (Troll Edition)

Key Links Dwarf question Chat room Game Controller Interface Troll league table ...
• 11.8k
645 views

### Play Thud! (Dwarf Edition)

Key links: Troll question Chat room Game Controller Interface Dwarf league table ...
• 11.8k
2k views

### Will the Hydra finally die?

Background A Medusa have released a dangerous Hydra which is revived unless the exact number of heads it have is removed. The knights can remove a certain number of heads with each type of attack, and ...
234 views

### The Great Betting Game

Your task is to create either a console "app" or a function which allows the user to bet on certain numbers or retire / claim rounds. Bets Your program or function will prompt for a command ...
611 views

### KotH - Floating Point Prisoners Dilemma

Background So, nowadays the popular Prisoner's Dilemma variant is the Prisoner's Trilemma, where there are three options. I can easily see that being increased, so I figured Why settle for three ...
• 189
1k views

### A Cat’s Game to Claim

Intro You like cats. Naturally, you like cat’s games in tic-tac-toe. So, you’ve come up with a little party trick. You ask someone what square on the board they want you to make a move in. And you ask ...
• 2,111
316 views

### No More Jockeys - CodeGolf Version

This challenge is inspired by the game No More Jockeys. The input is a list of tuples of natural numbers (potentially including 0), in some appropriate input format. Starting with player 0 and ...
• 3,829
3k views

### Cooperative Counting

Final results 1st place goes to Follow! Honourable mentions to The diff predictor (2nd), and Simple Killer, Low Blow and High to Low (joint 3rd). Other winners: (score competition) 1st - Simple Killer ...
• 423
1k views

### Liars and Guessers

Github You have probably played, and may even have written a program to play, a simple number guessing game. If so, this probably looks familiar: ...
• 843
5k views

### Which Ninjutsu am I casting?

In the MMORPG Final Fantasy XIV, the Ninja class has the ability to use combinations of up to three handsigns (Ten, Chi and Jin) to perform a variety of ninjutsu skills. The skill you cast depends on ...
• 2,460
347 views

### Win a KQ vs K endgame

Win a K vs KQ endgame Summary The goal of this challenge is to create a program or function which will win a Chess game with a King and Queen against a lone King. The user will specify three squares, ...
• 2,999
1k views

### Validating a Battleship board

Do you know the game Battleship? Well, I want to play with my little brother, but before we can begin we need to set up our ships on the board. This is your input. Now, we need to check that the ships ...
• 113
3k views

### Which side should I serve on?

Introduction In Tennis, the server alternates serving on the left side or the right side of the court every point, starting on the right. It is possible to figure out which side to serve on for that ...
• 1,513