# Questions tagged [atomic-code-golf]

Atomic code golf is scored by the number of operations in a specific fragment of a language you define.

84 questions
Filter by
Sorted by
Tagged with
266 views

### Fewest Instructions for Mihály Quine

https://mihaly.barasz.com/compressed-loop/game.html You have a simple, line-oriented “compression” language. The language works as follows: The document must start with the ...
• 193
444 views

### Stably sort N elements in this restricted "cmov" language

The following problem is taken from the real world — but indubitably code-golf! In this puzzle, the programming language is fixed, and your job is to write the most ...
• 797
565 views

### Count the number of disjoint 11 blocks

The task is to count the number of disjoint 11 blocks in a 64-bit word, using the minimum number of straight-line instructions. That is, how many nonoverlapping ...
• 253
522 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 ...
• 407
2k views

### Implement a very simple ALU using only NAND gates

Note: This challenge was inspired by Joe Z's many excellent questions surrounding NAND golfing. Description Your goal in this challenge, should you choose to accept it, is to implement a very simple ...
• 1,623
645 views

### Branchless (MIPS) assembly code for median of 3

I was trying to write a short MIPS32 code for computing the median of three registers. The rules: Assume that some values are pre-loaded into \$t0, ...
• 221
432 views

### Build the stove controller (physically)

Challenge Build the Wheat Wizard's stove using 2-input NAND gates. The solution with the fewest NAND gates wins. Externally, it works in the following way: (the first line is added from the original ...
• 76.9k
1k views

### SKI calculus golf: Hello, World!

Background SKI combinator calculus, or simply SKI calculus, is a system similar to lambda calculus, except that SKI calculus uses a small set of combinators, namely ...
• 76.9k
838 views

### Crack the Lost Numbers

The Lost Numbers are 4, 8, 15, 16, 23, 42. Your goal is to create an expression to output them all. Your allowed characters are 0123456789, ^+-*/, (), % for modulo and n as the single variable allowed....
• 3,849
802 views

### Programming Less-Than, Greater-Than and Equal-To functions using Restricted Source [closed]

I'm currently working with a branchless language which does not have native Less-Than, Greater-Than or Equal-To functions. I do however have min, ...
• 7,521
456 views

### Write a fast-growing assembly function

Synopsis Your goal is to implement the (asymptotically) fastest growing function within bounded code on a fictional CPU utilizing a quite limited, yet (probably) turing-complete instruction set. ...
• 1,649
541 views

### Efficient table-lookup computation

The challenge: compute the day of the week from a MM-DD representation of a day in this year (2021). However, you have to write your program in the following subset ...
• 17.3k
4k views

### Shortest "arithmetic" formula to output 1000 primes

Write a formula using only the digits 0-9, +, *, -, <...
2k views

### Final tribute to John Conway: FRACTRAN self-interpreter

It's time to conclude the series of John Conway challenges of mine. Background A FRACTRAN program consists of an ordered list of fractions. The program starts by taking a single integer as input. Each ...
• 76.9k
5k views

### Make 1s using a bunch of 1s

Your task is to form an expression equaling $11111111111 \text{ (11 ones)}$ using only the following characters: 1+(). Keep in mind that the result is in base ...
• 22.7k
4k views

### Tribute to John Conway: Collatz in FRACTRAN

John Horton Conway was a brilliant mathematician. Among his contributions were three Turing-complete esolangs: Game of Life (esolangs wiki), FRACTRAN (esolangs wiki), and Collatz function (esolangs ...
• 76.9k
424 views

### The shortest way of getting rid of these numbers

This is a simple game of getting rid of those damn numbers. You start with the numbers from 1 to 19, written in a grid of 9 by 3: 1 2 3 4 5 6 7 8 9 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 You may ...
2k views

### SKI calculus golf: Half of a Church numeral

Background SKI combinator calculus, or simply SKI calculus, is a system similar to lambda calculus, except that SKI calculus uses a small set of combinators, namely ...
• 76.9k
4k views

### Construct a pentagon avoiding compass use

Rules You will start with only two elements: Points $A$ and $B$ such that $A \neq B$. These points occupy a plane that is infinite in all directions. At any step in the process you may do any ...
• 98.8k
9k views

### Machine Learning Golf: Multiplication

I'd like to propose a different kind of golfing challenge to this community: (Artificial) Neural Networks are very popular machine learning models that can be designed and trained to approximate any ...
843 views

### Densely packed decimal (DPD) to decimal, with logic gates

Inspired by recent popularity of nandgame on TNB, and my own previous challenge. Background Densely packed decimal (DPD) is a way to efficiently store decimal digits in binary. It stores three ...
• 76.9k
449 views

### Generate an expression yielding near-equidistributed result

Create a program (any language) which, given positive integer m, outputs a valid C expression that: Uses a single variable x ...
• 615
553 views

### Egg hunting in Collatz style

Inspired by The Great API Easter Egg Hunt! Summary Your task is to search for a predetermined integer in the "Collatz space" (to be explained later) using the fewest step possible. ...
• 3,647
581 views

### Get Two from One

As we saw in this question complex logical statements can be expressed in terms of the simple connectives of generalized Minesweeper. However Generalized minesweeper still has redundancies. In order ...
• 98.8k
2k views

### Hexcellent Minesweeping

Hexcells is a game based off of Minesweeper played on hexagons. (Full disclosure: I have nothing to do with Hexcells. In fact I don't really like the game.) Most of Hexcells rules can be pretty ...
• 98.8k
869 views

### Write it into number theory style

Write a mathematical statement, using the symbols: There exists at least one non-negative integer (written as E, existential ...
• 24.5k
2k views

On December 4, 2017, the Google Doodle was a graphical programming game featuring a bunny. The later levels were nicely non-trivial and they seemed like a great candidate for an atomic-golf challenge. ...
30k views

### Google's doodle on kids coding: shortest program solving all the levels

Today's Google doodle is about Celebrating 50 years of Kids Coding: The goal is program the path of a little bunny so that it can eat all the carrots. There are 4 types of blocks (see pictures below): ...
• 441
938 views

An ordinary N-digit combination lock consists of N rotating discs. Each disc has digits 0-9 inscribed in order, and you need to turn them to the correct password to open it. Obviously, if you don't ...
• 2,421
14k views

### (-a) × (-a) = a × a

We all know that $(-a) \times (-a) = a \times a$ (hopefully), but can you prove it? Your task is to prove this fact using the ring axioms. What are the ring axioms? The ring axioms are a list of ...
• 98.8k
983 views

Imagine you have two boxes B(x) and B(y), each containing an unknown bit - 0 or 1, and a machine ...
• 15.3k
2k views

### Regular expression parser

This task is a classic programming task: Implement a regular expression parser. That is, write a program or function which takes a string describing a regular expression and a candidate string, and ...
• 4,680
441 views

### Solve this uHerbert challenge

TL;DR: Solve this particular challenge, a robot simulation, by stepping on all of the white pads, and avoiding the gray pads. You can step on a white pad any number of times, as long as you step on ...
• 183
1 vote
158 views

### Rewrite the Tiny BASIC IL program to support 7 changes to BASIC [closed]

Circa 1976. With the success of the Tiny BASIC Design Note, a variety of Tiny BASIC IL implementations now span a range of microcomputers. The time has come to expand the Tiny BASIC standard. Grammar ...
624 views

### Tetration: (Very) Hard Mode [closed]

This question is inspired by this one Your task Make a program or function that calculates the Tetration of 2 numbers. Tetration is what "comes next after addition, multiplication, and exponents". ...
5k views

### Is this number an exact power of -2: (Very) Hard Mode

This is a version of the recent challenge Is this number an integer power of -2? with a different set of criteria designed to highlight the interesting nature of the problem and make the challenge ...
• 6,482
1 vote
327 views

### Converting rational numbers to an “alien” data format

For a story I'm writing, I needed to convert 101⅐ (101 + 1/7 if that doesn’t show up for you) into base 47. Expressing an integer in some base brings back memories of first learning how to program ...
• 119
369 views

### Your very own "for" instruction, redux [closed]

Inspired by Sygmei's question, I'm interested in finding out what languages can "do this properly". Your task is to write a "for loop" function / macro / instruction. The arguments should be: an ...
• 129
2k views

### Abstract Syntax Tree Golfing: FizzBuzz, Python

Summary Implement FizzBuzz in Python, with the fewest possible tokens. Challenge Write a program that prints the decimal numbers from 1 to 100 inclusive. But for multiples of three print “Fizz” ...
• 42k
970 views

### Prove DeMorgan's laws

Using the the ten inferences of the Natural Deduction System prove DeMorgan's laws. The Rules of Natural Deduction Negation Introduction: {(P → Q), (P → ¬Q)} ⊢ ¬P ...
• 98.8k
1k views

### Box-256 Assembly - BIG SQUARE II

I'd like to start a series of challenges for http://box-256.com/ starting with the first challenge, “BIG SQUARE II”. After this one I'll add another for "CHECKERBOARD" and so on. Rules: Complete the ...
• 261
672 views

### Build a 4-vertex Connectedness Tester using NAND gates

A connected graph is a graph that contains a path between any two vertices. Challenge Build a [2-input NAND-gate] circuit that determines whether a 4-vertex graph is connected. (A gate's 2 inputs can ...
311 views

### What is the shortest LOOP program that outputs 2016? [closed]

LOOP This challenge is based around a modified version of the programming language LOOP. A program may be of any of the following forms: P;Q, where ...
323 views

### Robot optimization

Your task is to program a robot so that it reaches the hole in the ground on each of the maps within reasonable time. If the robot reaches the hole, it falls down into it and thus victory is assured, ...
• 1,859
1 vote
169 views

### Define map in the fewest tokens [closed]

map is a very basic yet important function in functional programming. All FP programming languages have it built-in but it is always fun to see how shortly you can ...
• 2,338
1k views

### Sort a list of numbers on the λ-calculus

Write a term on the pure untyped lambda calculus that, when applied to a church-encoded list of numbers, returns it with its numbers sorted in ascending or descending order. Church lists and numbers ...
• 371
1k views

### Brainf*** code golf challenge - write a Brainf*** program that searches for the first non-zero cell

The challenge is to write a brainf*** program that searches sequentially through memory for the first NON-zero cell. The program should start somewhere in fairly low memory (there will probably be ...
• 69
328 views

### Copy Memory Only Using Store And Subtraction

A peer of mine approached me with this challenge and I wasn't able to come up with an elegant solution. After discussing my approach, we began to wonder what the people at Code Golf would come up with....
• 73