Questions tagged [game]
This challenge is generally based upon, related to, or simulates a game or some portion of one.
308
questions
20
votes
8
answers
2k
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 ...
13
votes
12
answers
2k
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 ...
11
votes
4
answers
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 ...
6
votes
6
answers
957
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 (...
10
votes
12
answers
1k
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 ...
9
votes
5
answers
732
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
votes
1
answer
492
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, ...
13
votes
16
answers
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 ...
11
votes
5
answers
641
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 (...
23
votes
8
answers
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 ...
22
votes
12
answers
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 ...
15
votes
10
answers
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 ...
7
votes
1
answer
427
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 ...
19
votes
9
answers
4k
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 ...
10
votes
3
answers
377
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 ...
12
votes
8
answers
819
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, ...
12
votes
5
answers
365
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 ...
9
votes
2
answers
541
views
The maximum liberty of a group on a Go board
Bounty
One of the convincing conjectures, by Loopy Walt is,
...
15
votes
9
answers
956
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 ...
17
votes
7
answers
482
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 ...
5
votes
3
answers
419
views
Mahjong Checker
Mahjong is a tabletop game played using tiles. It features three "number" suits (pins, sous, mans, represented as p, s ...
17
votes
3
answers
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 ...
9
votes
4
answers
261
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 ...
48
votes
22
answers
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
votes
6
answers
2k
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 ...
5
votes
6
answers
292
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 ...
11
votes
2
answers
573
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
votes
2
answers
258
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 ...
20
votes
7
answers
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 ...
8
votes
7
answers
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 ...
14
votes
12
answers
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 ...
8
votes
5
answers
351
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 ...
4
votes
3
answers
408
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 ...
15
votes
15
answers
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 ...
15
votes
0
answers
547
views
Play Thud! (Troll Edition)
Key Links
Dwarf question
Chat room
Game
Controller Interface
Troll league table
...
18
votes
0
answers
588
views
Play Thud! (Dwarf Edition)
Key links:
Troll question
Chat room
Game
Controller Interface
Dwarf league table
...
4
votes
9
answers
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 ...
5
votes
2
answers
231
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 ...
7
votes
5
answers
482
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 ...
13
votes
7
answers
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 ...
13
votes
5
answers
314
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 ...
28
votes
20
answers
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
...
16
votes
17
answers
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:
...
20
votes
12
answers
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 ...
9
votes
1
answer
340
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, ...
9
votes
3
answers
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 ...
28
votes
17
answers
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 ...
12
votes
12
answers
4k
views
Is this a robbery?
Backstory
You own a tiny jewellery shop in the suburbs of the city. The suburbs are too much overpopulated, so your shop has a thickness of only one character to fit in the busy streets.
Recently, ...
18
votes
12
answers
3k
views
Are These Scores Possible?
Background
In the sport of Table Tennis (aka Ping-Pong or Whiff Whaff), two opponents play a sequence of rounds, where each round consists of players hitting a ball back and forth until one player (...
26
votes
4
answers
1k
views
Baba is golf, flag is win
If you haven't played the game Baba is You, I think you really should. Whether you’ve played it or not, have a go at implementing it as a code golf.
The idea behind this challenge is to have a bit ...