All Questions

74 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
41 votes
0 answers
2k views

Topologically distinct ways of dissecting a square into rectangles

I was asked by OEIS contributor Andrew Howroyd to post a Code Golf Challenge to extend OEIS sequence A049021. Would be super great to get a couple more terms for [...] A049021. Kind of thing [...] ...
Peter Kagey's user avatar
  • 8,659
21 votes
0 answers
1k views

Find a Glider Synthesis (Game of Life)

Challenge Summary In summary, the challenge is to provide the glider synthesis for a Game of Life configuration, which is your input. What does this mean? Well, firstly, let me explain a few terms. ...
hyper-neutrino's user avatar
  • 41.3k
18 votes
0 answers
605 views

Play Thud! (Dwarf Edition)

Key links: Troll question Chat room Game Controller Interface Dwarf league table ...
AJFaraday's user avatar
  • 11.8k
17 votes
0 answers
748 views

How to golf string output in Chef

I'm attempting to solve a programming golf style programming puzzle. I need to write an 18 character phrase in Chef in less than 32 "lines" of code. In this case, a line counts as an ingredient or an ...
Jason Thompson's user avatar
15 votes
0 answers
555 views

Play Thud! (Troll Edition)

Key Links Dwarf question Chat room Game Controller Interface Troll league table ...
AJFaraday's user avatar
  • 11.8k
13 votes
0 answers
471 views

Tips for Golfing in SQLite?

I was looking for this page to help me enhance my first answer with SQLite, but I couldnt find one. So here we are! What general tips do you have for golfing in SQLite? I'm looking for ideas that can ...
aloisdg's user avatar
  • 2,037
12 votes
0 answers
437 views

Is it a legal atomic chess move?

Background and Rules There is a variant of chess called atomic chess, which follows essentially the same rules as normal chess, except that pieces explodes other pieces around them when captured. In ...
Aiden Chow's user avatar
  • 12.6k
12 votes
0 answers
671 views

Finding Radical Ideals

Sandbox Finding radicals of arbitrary ideals in rings is hard! However, it's a doable task in polynomial rings, since they are Noetherian (all ideals are finitely generated) Background A quick ...
Rushabh Mehta's user avatar
12 votes
0 answers
509 views

Simulate Alpha Decay

Alpha Decay is a kind of radiation decay where every time the atom "decays", it loses a helium nucleus (an alpha particle). This means that an atom loses 2 protons and 2 neutrons each time. ...
caird coinheringaahin g's user avatar
11 votes
0 answers
653 views

Lean golf: Balanced Bracket Sequence

Ungolfed, ugly, horrible proof to help you make progress on this challenge: https://gist.github.com/huynhtrankhanh/dff7036a45073735305caedc891dedf2 A bracket sequence is a string that consists of the ...
Huỳnh Trần Khanh's user avatar
11 votes
0 answers
218 views

NP-complete reduction: (grid-)Hamiltonian circuit

Background Hamiltonian circuit problem is a decision problem which asks whether a given graph has a Hamiltonian circuit, i.e. a cycle that visits every vertex exactly once. This problem is one of the ...
Bubbler's user avatar
  • 73.8k
11 votes
0 answers
459 views

Morpion solitaire

Morpion solitaire This is a game that I remember having learnt from my grandparents in my childhood. Initially I didn't know the name. G B has found it to be Join Five (or less ambiguously - Morpion ...
Sopel's user avatar
  • 331
11 votes
0 answers
913 views

Delivery Robots and Destroyer Drones

Program your robots to deliver packages in a warehouse infested with destroyer drones. Avoid the drones and get your packages to the right place as fast as you can. Delivery Robots There are ...
Logic Knight's user avatar
  • 6,762
10 votes
0 answers
205 views

Optimize for Bgil Midol's slicing scoring

In Bgil Midol's question, the score of a sequence of slice is defined as sumof|startslices|∗2+sumof|endslices|∗2+sumof|stepslices|∗3 Such scoring method makes multiple slices possibly take less ...
l4m2's user avatar
  • 20.3k
10 votes
0 answers
436 views

Jelly compression quine

The golfing language Jelly has a very complex and clever string compression system which I'm not going to go into depth about here. You can find a very good explanation here. Basically, Jelly's string ...
emanresu A's user avatar
  • 35.6k
10 votes
0 answers
262 views

Cover positions with snakes of same 'colour'

Imagine a grid where the origin square \$(0,0)\$ is at the top left of the screen, and positive \$x\$ is rightwards whereas positive \$y\$ is downwards. Coloured squares are at various positions on ...
lightlyheld's user avatar
10 votes
0 answers
594 views

Radiation is Painful

A radiation-hardened quine can take a hit and stay standing, but nobody ever said that the quine can't be a wuss about it. For this challenge, you should write a quine that: If no characters are ...
Nissa's user avatar
  • 3,606
9 votes
0 answers
272 views

Tips for golfing in Chef

What general tips do you have for golfing in Chef? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to Chef (e.g. "remove unnecessary ...
Fmbalbuena's user avatar
  • 3,085
9 votes
0 answers
372 views

Chess Squad March

Find the moves that bring a chess squad to a given destination. You control a chess squad consisting of a king and several other pieces, on a larger chess board. Your army is placed so that no piece ...
Valentin Brasso's user avatar
9 votes
0 answers
389 views

Leave a wake of dead cells behind you

Conway's Game of Life is a well known cellular automaton "played" on an infinite grid, filled with cells that are either alive or dead. Once given an initial state, the board evolves ...
caird coinheringaahin g's user avatar
9 votes
0 answers
262 views

Fastest way to iterate over sublattice of discrete lattice

I need to construct a functor that iterates over the linear representation of a sub-lattice of size \$d_x,d_y,d_z,d_q\$ embedded in a lattice of size \$n_x,n_y,n_z,n_q\$. The sub-lattice corner is ...
user3646557's user avatar
9 votes
0 answers
462 views

The N Queens Problem, but with Fairy Chess Pieces

Fairy Chess is a sort of generalized chess that allows unconventional pieces. The eight queens puzzle is a classic problem where you have to put 8 queens on a chess board such that no two queens ...
Beefster's user avatar
  • 9,881
8 votes
0 answers
405 views

Turing Machine that outputs pi

Turing Machine Preliminaries A Turing machine is specified by the following data A finite set of symbols S = \$\{s_1,s_2,...\}\$ A finite set of states M = \$\{m_1,m_2,...\}\$ A partially defined ...
QCD_IS_GOOD's user avatar
8 votes
0 answers
531 views

Goldbach's Comet

Back to back challenges I guess. Hopefully this one is more clear than the last. Background I was playing around with Goldbach's conjecture, and decided to plot evens (on the x-axis) vs the number ...
Rushabh Mehta's user avatar
8 votes
0 answers
470 views

Get ERC-20 token balance

Ethereum is a blockchain platform. It has its own native cryptocurrency, ether, but in this challenge, we'll be focusing on its ability to run smart contracts. The ERC-20 standard describes an ...
Nick Clifford's user avatar
7 votes
0 answers
212 views

Find the linear transformation

Given a set of bit vectors \$A\$ and a binary matrix \$M\$, we can define the set \$MA = \{ Mx : x \in A \}\$, where \$ M x \$ is the result of the matrix multiplication of \$ M \$ by \$ x \$ over \$\...
Command Master's user avatar
7 votes
0 answers
325 views

Count the length of head movement

Once upon a time I wanted to order custom tokens for a board game. They say they can do it, and then they present me their price list. I was confused because they charge per inch of head movement, and ...
CuttingChipset's user avatar
7 votes
0 answers
377 views

Code Golf: BlackJack - best moves

The Challenge I was looking into small code examples for a specific language as a small tutorial and came accross a simplified Blackjack that should be implemented. In this Challenge you will have to ...
PlatinTato's user avatar
7 votes
0 answers
245 views

Decompose the domain

In scientific computing, it is often desirable to decompose some large domain into smaller "subdomains", then parallelize the computation by performing the work on each subdomain in parallel and the ...
helloworld922's user avatar
6 votes
0 answers
241 views

Shortest CSS selector to select ALL html elements, without using asterisk *

What is the shortest selector (by character count) to select ALL html elements on a web page, without using asterisk (*)? Some examples are the following: ...
user3163495's user avatar
6 votes
0 answers
251 views

Write a proof checker for first order logic

This originally came from Give the best Chaitin incompleteness bound, but I realized that there was a fragment of this problem which still potentially gives a good coding challenge. First Order Logic ...
Charles Wang's user avatar
6 votes
0 answers
195 views

Give the best Chaitin incompleteness bound

This was originally a pure mathematics question, but I think I've got the best chance for an answer here. The Challenge For concreteness, consider Peano Arithmetic (PA). For some language L of your ...
Charles Wang's user avatar
6 votes
0 answers
305 views

Crazyhouse chess KoTH

What is Crazyhouse Chess? Crazyhouse Chess is a chess variant that is basically normal chess except you can place a piece you previously captured back on the board instead of a regular turn. Bot ...
user avatar
6 votes
0 answers
317 views

Minimum cost of solving the Eni-Puzzle

You're tasked with writing an algorithm to efficiently estimate cost of solving an Eni-Puzzle from a scrambled state as follows: You're given m lists of containing n elements each(representing the ...
Conor James Thomas Warford Hen's user avatar
6 votes
1 answer
394 views

Further golfing this C# code from Scramble words while preserving their outlines

I'll start off by saying I checked and checked again that this question should be on topic. I will also clearly state that this is a tips question about further golfing a certain set of code not a ...
TheLethalCoder's user avatar
6 votes
0 answers
2k views

Probability to win a hand of poker (Texas hold 'em)

Challenge: In the last stage of a two players Texas hold 'em, given a two-card hand and five cards on table, determine your probability to win versus an opponent by the standard ranking of poker ...
Cœur's user avatar
  • 421
5 votes
0 answers
238 views

Find the best character arrangement

You want to write your English essay. However, all characters on your keyboard broke other than the arrow keys and the enter key. You want to find out how to place the characters so you can write your ...
Command Master's user avatar
5 votes
0 answers
406 views

Hamming distance traveling salesman problem

The Hamming distance between two strings is the number of positions they differ at. You are given a set of binary strings. The task is to find the length of the shortest route that visits all of them ...
the default.'s user avatar
  • 8,415
5 votes
0 answers
263 views

Simulate the isotropic non-totalistic cellular automaton

There are many generalizations of Conway's Game of Life. One of them is the isotropic non-totalistic rulespace, in which the state of a cell in the next generation depends not just on its state and ...
Baaing Cow's user avatar
5 votes
0 answers
225 views

Construct the suffix automaton

In computer science, a suffix automaton is the smallest partial deterministic finite automaton that recognizes the set of suffixes of a given string. (Wikipedia) Given a string \$S\$ consisting of ...
Baaing Cow's user avatar
5 votes
0 answers
367 views

Another version of "The Bridge and Torch Problem"

The idea for this code golf puzzle is from link: The Bridge and Torch Problem The inspiration for this code golf puzzle is the Bridge and Torch problem, in which d people at the start of a bridge ...
Felix Ha's user avatar
  • 169
5 votes
0 answers
292 views

Tips for golfing in TeaScript

TeaScript is a powerful JavaScript golfing language created by StackExchange, PPCG, user Downgoat. TeaScript compiles to JavaScript and contains many helpful features for golfing This question is to ...
Luis felipe De jesus Munoz's user avatar
5 votes
0 answers
359 views

Tetris overlooked move counter

Playing tetris is fun. Watching an AI play tetris is also fun. Some tetris AIs will always ignore the possibility of maneuvering a piece under an overhang, which makes me sad. It means that the ...
BenGoldberg's user avatar
5 votes
0 answers
747 views

Chess Light Solver

Challenge Write a solver for the Chess Light puzzle game, in the smallest amount of code. The input will be a representation of a chessboard, how in yours is up to you. My examples below is textual, ...
Adam Speight's user avatar
  • 1,314
4 votes
0 answers
267 views

Convert To Shorthand Part 2

Part 1 of the challenge revolved around converting the letters into specific unicode characters. Lore In this part we receive the output from the function made in Part 1, which now has to be arranged ...
Saphereye's user avatar
  • 507
4 votes
0 answers
210 views

Tips for golfing in Seriously

I am looking for tips to code in this golfing language Seriously, and was wondering what some of the ways for golfing this language is. "Remove comments" is not a tip. Actually is also ...
DialFrost's user avatar
  • 5,045
4 votes
0 answers
157 views

Tips for golfing in Objective C

Although on codingame.com, Objective C and C are two of the best golfing languages there, so I would like to know some of the best golfing methods (although I am a python person, I am currently trying ...
DialFrost's user avatar
  • 5,045
4 votes
0 answers
282 views

2017 SCRAM Finder

Background The nuclear industry has term, SCRAM, used to describe a quick shutdown of the reactor. There's a fun myth that it stands for "Safety Control Rod Ax Man," the role which served ...
wnnmaw's user avatar
  • 1,628
4 votes
0 answers
240 views

Golfing Delayed Expansion Variables in Batch

Enabling delayed expansion variables in Batch chews up a lot of bytes. The shortest I have managed to make it is: @!! 2>nul||cmd/q/v/c%0&&exit/b ...
unclemeat's user avatar
  • 2,344
3 votes
0 answers
193 views

Custom Games of Life

There's a lot of questions about Conway's Game of Life, but nothing about customization (Related: 2-Player Life). Given an input, determine the result on a 100x100 grid after some iterations. The ...
Infigon's user avatar
  • 561

15 30 50 per page