# All Questions

11,037 questions
Filter by
Sorted by
Tagged with
4k views

### Floating Point XOR

Your task is pretty simple. Given two floats, bitwise xor the binary representation of them, and output that as a float. For example, ...
761 views

### Output Distinct Factor Cuboids

Output Distinct Factor Cuboids Today's task is very simple: given a positive integer, output a representative of each cuboid formable by its factors. Explanations A cuboid's volume is the product ...
709 views

### Olympic game scoring [closed]

The challenge is to write a golf-code program that, given n positive real numbers from 0 to 10 (format x.y, y only can be 0 or 5: 0, 0.5, 1, 1.5, 2, 2.5 … 9.5 and 10), discard the lowest and highest ...
1k views

### Permutations in Disguise

Given a $n$-dimensional vector $v$ with real entries, find a closest permutation $p$ of $(1,2,...,n)$ with respect to the $l_1$-distance. Details If it is more convenient, you can use ...
6k views

### Output a Super Mario Image

This is a problem on Luogu OJ. I decided to post it here because on Luogu OJ, many people, including me and my friend, are interested about how to solve this problem within the fewest characters. ...
1k views

### Some Prime Peerage

(Randomly inspired by https://mathoverflow.net/q/339890) (Related: 1, 2) Given an input list of distinct prime numbers (e.g., [2, 5, 7]), and a integer ...
1k views

### Write a function that returns an iterable object of all valid points 4-directionally adjacent to (x, y)

A very common need in algorithms classes and computer science in general is to iterate 4-directionally over a grid or matrix (such as in BFS or DFS). This seems to often result in a lot of clunky and ...
3k views

### Parallel resistance in electric circuits

Introduction: Two resistors, R1 and R2, in parallel (denoted R1 || R2) have a combined ...
310 views

### Find minimal set of rows to retain all unique values in each column

Given a matrix, the goal is to ensure all the values in each column occur at least once, while at the same time doing so requiring the least possible amount of rows. Fastest solution wins. Note: a ...
5k views

### Double it your way

There have been a couple of challenges involving doubling source code: here and here. The task we have here is a bit harder, but should be doable in almost every language. In this challenge, you will ...
135 views

### Wrong keyboard position [duplicate]

You are in fact writing an interpreter for the language "Wrong keyboard position". You can pretend that you are not doing this and just follow the instructions below. I typr re;atively accuratrly, ...
630 views

### Interpret Volatile

Interpret Volatile Volatile is a stack-based esolang made by A_ that only has 8 instructions and is turing complete. However, it is also non-deterministic... meaning that programs don't always give ...
236 views

### Write an interpreter for simplified 33

33 is a simple esolang I created. You may have seen me use it in a few questions. You're not going to be writing a full interpreter. The interpreter you will be writing is for a simplified version of ...
579 views

### Space Cleaners!

A space cleaner is a special character which removes all spaces between it and the first non space character to its left and it is represented by a '!' character. If it reaches the beginning of the ...
1k views

1k views

### Dividing Divisive Divisors

Given a positive integer $n$ you can always find a tuple $(k_1,k_2,...,k_m)$ of integers $k_i \geqslant 2$ such that $k_1 \cdot k_2 \cdot ... \cdot k_m = n$ and k_1 | k_2 \text{ , } k_2 | ...
6k views

### Random point on a sphere

The Challenge Write a program or function that takes no input and outputs a vector of length $1$ in a theoretically uniform random direction. This is equivalent to a random point on the sphere ...
2k views

### I see your BIDMAS and raise you a BADMIS

I see your BIDMAS and raise you a BADMIS Challenge Given a set of numbers with operators between them: "5 + 4 * 9 / 3 - 8", return all the possible results of the expression for every permutation of ...
115 views

### “Know Thyself” Program [duplicate]

Challenge Write a program that takes as input a text and output "That's me!" if the input is equal to the program own source code, and "That's not me!" otherwise. Notes This is codegolf, in each ...
176 views

### Return the nth element of an array even if its out of bound [closed]

The challenge Write a function that returns the nth element of an array even if its out of bound. ...
469 views

### 43 quintillion permutations

We can represent a Rubik's Cube as a net as follows (when solved): WWW WWW WWW GGGRRRBBBOOO GGGRRRBBBOOO GGGRRRBBBOOO YYY YYY YYY Each letter ...
3k views

### I multiply the source, you (probably) multiply the output!

Task The task is to write a program that outputs a consistent but otherwise arbitrary positive integer $x$ (so strictly greater than 0). Here's the catch: when the source is repeated $N$ times (...
2k views

### Bit floating sequence

A bit floats from the LSB to the MSB moving one position each time until it floats to the top of the container: 0000 0001 0010 0100 1000 Once one bit floats to ...
4k views