Skip to main content

Questions tagged [code-golf]

Code-golf is a competition to solve a particular problem in the fewest bytes of source code.

46 questions with no upvoted or accepted answers
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
  • 42.5k
13 votes
0 answers
538 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,077
12 votes
0 answers
516 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
  • 13.7k
12 votes
0 answers
699 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
11 votes
0 answers
695 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
240 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
  • 77.5k
11 votes
0 answers
286 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
223 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
  • 25k
9 votes
0 answers
291 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
  • 4,167
8 votes
0 answers
481 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
335 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
406 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
257 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
282 views

Solve the word problem*

In this challenge you will receive a list of positive integers \$W\$ called a word, and a square symmetric matrix \$M\$. Your task is to determine if the word can be turned into the empty list by ...
Wheat Wizard's user avatar
  • 99k
6 votes
0 answers
279 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

15 30 50 per page