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. ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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:
...