All Questions
68
questions with no upvoted or accepted answers
40
votes
0
answers
1k
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 [...] ...
18
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. ...
18
votes
0
answers
1k
views
Better way to read multiple int in C than scanf
I'm trying to read 4 ints in C in a golfing challenge and I'm bothered by the length of the code that I need to solve it:
...
17
votes
0
answers
470
views
Play Thud! (Dwarf Edition)
Key links:
Troll question
Chat room
Game
Controller Interface
Dwarf league table
...
17
votes
0
answers
642
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 ...
14
votes
0
answers
438
views
Play Thud! (Troll Edition)
Key Links
Dwarf question
Chat room
Game
Controller Interface
Troll league table
...
13
votes
0
answers
481
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 ...
13
votes
0
answers
607
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 ...
12
votes
0
answers
401
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
321
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. ...
11
votes
0
answers
498
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 ...
11
votes
0
answers
852
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 ...
10
votes
0
answers
173
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 ...
10
votes
0
answers
146
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 ...
10
votes
0
answers
338
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 ...
10
votes
0
answers
214
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
387
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 ...
9
votes
0
answers
254
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 ...
9
votes
0
answers
312
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 ...
9
votes
0
answers
337
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 ...
9
votes
0
answers
316
views
Yet another digit insertion problem
Given a positive number \$n\$ we call another (not same as n) positive number \$m\$ good if we insert same digits in both n and m and the resulting fractional value is same.
$$m/n = m_{\text{...
9
votes
0
answers
246
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 ...
9
votes
0
answers
420
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 ...
9
votes
0
answers
1k
views
Simple chess bot
Inspired by this
Implement simple chess bot (with console or GUI) that has following features:
[Pseudo-]graphically showing the board;
Accepting user moves and making their own moves;
Playing by ...
8
votes
0
answers
267
views
Counting overlapping objects
Consider a NxN pixel grid with up to M objects drawn on it, either squares or diamonds:
square
diamond
The objects may overlap, so recognition is hard. The task is to give the minimal possible ...
8
votes
0
answers
486
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 ...
8
votes
0
answers
440
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 ...
8
votes
0
answers
525
views
Chaining autograms
Write a program that takes one integer input n and one format letter and outputs n autograms in the format This sentence contains ? "A"s, ? "B"s ... and ? "Z"s.
...
7
votes
0
answers
303
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
339
views
What is the simplest reversible circuit that computes conjugacy of transpositions?
Reversible computation refers to computation in which little or no information is deleted. Reversible computation a major component of quantum computation, and reversible computation is potentially ...
7
votes
0
answers
349
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
225
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
281
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 ...
6
votes
0
answers
387
views
Find the pattern
I feel tired to do "find the pattern" exercise such as
1 2 3 4 (5)
1 2 4 8 (16)
1 2 3 5 8 (13)
Please write a program that finds the pattern for me.
Here, we ...
6
votes
1
answer
311
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 ...
5
votes
0
answers
174
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 ...
5
votes
0
answers
69
views
Tips for golfing in J-uby
J-uby is the Language of the Month for June 2022, so I'm looking for tips for golfing in it. As usual, please post one tip per answer, and avoid general tips such as "remove whitespace" or &...
5
votes
1
answer
411
views
NxM List Combination Closest to Target
Given a list of N lists, each containing M positive integers, and a separate list of M positive integers (target values), return a list of N scalars (integers with a value of 0 or more) that ...
5
votes
0
answers
338
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 ...
5
votes
0
answers
212
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 ...
5
votes
0
answers
198
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 ...
5
votes
0
answers
338
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 ...
5
votes
0
answers
283
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 ...
5
votes
0
answers
338
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 ...
5
votes
0
answers
700
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, ...
4
votes
0
answers
233
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 ...
4
votes
0
answers
114
views
Tips for golfing in Objective C
Surprisingly, I do not think this question has been asked before
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 ...
4
votes
0
answers
184
views
Tips for Golfing the Lambda Calculus & Friends
This includes tips for all related derivatives, as coding in these langs often primarily consists of writing the function in the lambda calculus and then compiling it down at the end.
Among others, ...
4
votes
0
answers
265
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 ...
4
votes
0
answers
285
views
Code Golf Pro Golfer Least Swings Calculator
Your Challenge:
For a golf Course Of Inputted 'n' length to hole where:
...