All Questions

Filter by
Sorted by
Tagged with
14 votes
14 answers
2k views

Print all Polynomials

The set of all polynomials with integer coefficients is countable. This means that there is a sequence that contains each polynomial with integer coefficients exactly once. Your goal is it to write a ...
bsoelch's user avatar
  • 5,677
2 votes
0 answers
84 views

Tips for golfing in Thue

Anyone got tips for golfing in Thue. One tip per answer, and no tips aplicable to all languages (like remove comments)
Dadsdy's user avatar
  • 2,035
21 votes
23 answers
4k views

"Print this diamond" gone beautifully wrong

Write a function (or a whole program) that outputs (or prints) the following ASCII art: Output: ...
Fhuvi's user avatar
  • 1,548
11 votes
22 answers
2k views

Generate the Crystal Maze™ time matrix

Behold! The Crystal Maze™ Time Matrix! ...
AJFaraday's user avatar
  • 11.8k
1 vote
1 answer
158 views

Start a program so that /proc/self/cmdline contains a binary representation of the input number

I am sorry for the very long description. But i think some information of how /proc/self/cmdline works and how it can be used to get a integer input was necessary. ...
12431234123412341234123's user avatar
11 votes
11 answers
1k views

(Robbers) Fast and Golfiest Season 1: The Lord of the Strings

Fast and Golfiest Robbers Thread Welcome to the first season of Fast and Golfiest, a cops-and-robbers challenge! I designed this challenge to encourage competitive coding for efficiency (fastest ...
Shiran Yuan's user avatar
17 votes
15 answers
1k views

(Cops) Fast and Golfiest Season 1: The Lord of the Strings

Fast and Golfiest Cops Thread Welcome to the first season of Fast and Golfiest, a cops-and-robbers challenge! I designed this challenge to encourage competitive coding for efficiency (fastest ...
Shiran Yuan's user avatar
23 votes
15 answers
3k views

Code Golf for Golf

My first code golf question post! Hope u like it ;-) The task is simple. Write either an stdin-stdout program or a function. Input is a 2D array which contains only either characters or the integer <...
Shiran Yuan's user avatar
19 votes
10 answers
3k views

Numbers that can be negated by reading backwards

Balanced ternary is a modified version of ternary (base 3), using the three digits 1,0 and -1...
bsoelch's user avatar
  • 5,677
19 votes
41 answers
1k views

Output / Convert to unary number

Your task is it to output a number as a unary string. You get the number of a non-negative integer input in the range of 0 - 2'000'000'000. Rules You can choose any character for the digit you like. ...
12431234123412341234123's user avatar
1 vote
7 answers
476 views

Relations between interval and semitones

Output this table: -2* -1* - 0 - 1 2 -1* 0 1 - 2 3 4 1 2 3 - 4 5 6 3 4 - 5 - 6 7 5 6 - 7 - 8 9 6 7 8 - 9 10 11 8 9 10 - 11 12 13 10 11 - 12 - 13 14 You can output one string with two types of ...
l4m2's user avatar
  • 20.3k
21 votes
16 answers
2k views

Chamber of Reflection

Background A ray of light is fired from the top left vertex of an MxN Chamber, where M a denotes the width and ...
Jacob Creutzfeldt's user avatar
24 votes
38 answers
2k views

Diagonalize a vector

Diagonalize a vector into a matrix. Input A vector, list, array, etc. of integers \$\mathbf{v}\$ of length \$n\$. Output A \$n \times n\$ matrix, 2D array, etc. \$A\$ such that for each element \$a_i \...
bigyihsuan's user avatar
  • 8,508
0 votes
1 answer
74 views

Find the sum of primes [duplicate]

Given a number x, find the sum of all primes up to that number. The input will always be a positive number, bigger than 2. An upper limit isn't defined, so data types can be ignored. Use whichever you ...
S-Flavius's user avatar
  • 459
9 votes
13 answers
987 views

Landmine Number V

Background You have again x4 been given the task of calculating the number of landmines in a field. But this time, the field is not a number field... it's a field of letters. Our landmine letter ...
Jacob Creutzfeldt's user avatar
7 votes
1 answer
261 views

Reverse Conway's Game of Life

Conway's Game of Life is a cellular automaton "played" on an infinite grid, filled with cells that are either alive or dead. Once given an initial state, the board evolves indefinitely ...
c--'s user avatar
  • 2,423
10 votes
13 answers
1k views

Landmine Number IV

Background You have again x3 been given the task of calculating the number of landmines in a field. But this time, we have no landmine number, and some landmines have exploded. You must calculate the ...
Jacob Creutzfeldt's user avatar
14 votes
19 answers
3k views

Vanilla Natural Logarithm Challenge

There is a challenge for multiplying two numbers so I guess this counts too Given as input a positive real number n compute its natural logarithm. Your answer ...
mousetail's user avatar
  • 11.8k
6 votes
6 answers
959 views

Critical Calculations

Background In the game stick ranger, there is an item which grants the character the ability to get critical hits. Each time a projectile hits an enemy, it has some probability to be a critical hit (...
CursorCoercer's user avatar
22 votes
40 answers
3k views

Sum of a range of a sum of a range of a sum of a range of a sum of a range of a sum of

Inspired by the fact that a few related challenges to this could be answered by Vyxal in 0 Bytes using a special flag combination. Given only one input integer \$n\$, calculate \$f(n,n)\$ where $$ f(x,...
The Empty String Photographer's user avatar
11 votes
14 answers
2k views

Landmine Number III

Background You have again, again been given the task of calculating the number of landmines in a field. But this time, the field is foggy. You must calculate the landmine score given a list/string of ...
Jacob Creutzfeldt's user avatar
11 votes
6 answers
697 views

Compute the maximal Ducci period

Given an initial \$n\$-tuple \$t_0=(t_{0,1},...,t_{0,n})\$, we can obtain its corresponding Ducci sequence \$\{t_0, t_1, ...\}\$ by the recurrence \$\displaystyle t_{i+1}=\left(\left|t_{i,1}-t_{i,2}\...
att's user avatar
  • 19.7k
13 votes
11 answers
2k views

Measure the Diamond Road

Background You are planning your trip away from the Diamond City, and must travel through Diamond Road. However, Diamond Road branches away from Diamond City to different locations. Out of curiosity, ...
Jacob Creutzfeldt's user avatar
10 votes
13 answers
2k views

Landmine Number II

Background You have again been given the task of calculating the number of landmines in a field. However, we have now travelled into the flatlands. You must calculate the landmine score given a list/...
Jacob Creutzfeldt's user avatar
13 votes
27 answers
2k views

Landmine Number I

Background You have been given the task of calculating the number of landmines in a field. You must calculate the landmine score given a list/string of numbers and the landmine number. The landmine ...
Jacob Creutzfeldt's user avatar
13 votes
8 answers
695 views

Generate all linked chains

A followup to this challenge by Jeremy Collprav, inspired by DLosc solving this in Regenerate. Some sections copied from the linked challenge. Linking chains We define a chain to be a string ...
caird coinheringaahin g's user avatar
14 votes
15 answers
1k views

Two Parallel Linked Chains

Background We define the two types of chain to be a string that contains only dashes, "-", or only underscores, "_". We link two chains using one equals sign, "=". ...
Jacob Creutzfeldt's user avatar
12 votes
17 answers
2k views

Draw the initial positions of Mölkky pins in ASCII art

Write a function (or a whole program) that outputs (or prints) an ASCII art of the initial position of Mölkky pins. Output : ...
Fhuvi's user avatar
  • 1,548
21 votes
32 answers
2k views

Reversed Squares

Given an integer n, your task is to determine whether it is a perfect square that when reversed, is still a perfect square. You may assume n is always positive. When numbers such as 100 (10x10) are ...
Alan Bagel's user avatar
  • 3,445
10 votes
5 answers
869 views

Translate the keitai input method

The keitai input method is a method for writing Japanese kana on a 12-key phone keypad. Similar to Western keypads, each kana is assigned to a key; when the key is pressed multiple times, it cycles ...
bigyihsuan's user avatar
  • 8,508
6 votes
6 answers
724 views

Detect Maxima Using Persistent Homology

Inspired by this SO answer about peak detection. Background Persistent homology is a fancy term for a fancy math concept, but in this case all we care about is how it can be used for peak detection. ...
CursorCoercer's user avatar
23 votes
43 answers
3k views

Output each second

With roughly one second (plus or minus 10 ms) between outputs, output anything. The first output must be at most one second after the start of the program, but can be as soon as right when the program ...
Dadsdy's user avatar
  • 2,035
8 votes
5 answers
1k views

Approximate e using small numbers

Given an input integer from 1, 2, ..., n, the task to write code to make a number as close as possible (as measured by absolute distance) to e using only the four ...
Simd's user avatar
  • 1,812
8 votes
6 answers
219 views

Minimum partition with non-empty intersections

Given a set of intervals \$\mathcal{I} = \{I_1, \ldots, I_m\}\$, where each interval \$I_j\$ is represented by its bounds \$(a_j, b_j)\$, find a partition \$\mathcal{T}\$ of \$\mathcal{I}\$ of minimal ...
matteo_c's user avatar
  • 5,733
17 votes
18 answers
2k views

XOR of independent Bernoulli variables

In probability theory, a Bernoulli variable is a random variable which has a single parameter \$p\$, and is equal to 1 with probability \$p\$, and 0 with probability \$1-p\$. In this challenge, there ...
Command Master's user avatar
-9 votes
9 answers
314 views

Wrt "Hello World" prgrm bt wth n vwls

Create A "Hello, World!" program but without any vowels. Winner is the program with the least bytes. Rules: No vowels are allowed in the code. Must print to STDOUT Must be a full program. ...
Wallace's user avatar
  • 123
4 votes
4 answers
205 views

Tips for golfing in (,) in-paren-comma

What tips do you have for golfing in (,)? I've found that there are so many ways to make code shorter, and I want more ways. I doubt there even are any tips for (,) that are applicable in the majority ...
Dadsdy's user avatar
  • 2,035
25 votes
15 answers
2k views

Vertices of a regular dodecahedron

A regular dodecahedron is one of the five Platonic solids. It has 12 pentagonal faces, 20 vertices, and 30 edges. Your task is to output the vertex coordinates of a regular dodecahedron. The size, ...
alephalpha's user avatar
  • 46.5k
1 vote
0 answers
107 views

Bunny Shakespeare poetry [closed]

Suppose you have a grid of cells that is 6 wide and arbitrarily tall. In each cell is a word. Let the bottom row, which is row #1, be the last 6 words of sample.txt in order. Let the second to last ...
mikebolt's user avatar
  • 121
6 votes
0 answers
305 views

Crazyhouse chess KoTH

What is Crazyhouse Chess? Crazyhouse Chess is a chess variant that is basically normal chess except you can place a piece you previously captured back on the board instead of a regular turn. Bot ...
user avatar
12 votes
10 answers
3k views

Calculate max depth of JSON data

Challenge Given some JSON data, calculate the maximum depth reached. (Both arrays and dictionaries increase the depth) Input/Output The program is expected to read a JSON string from stdin and as soon ...
user avatar
1 vote
0 answers
139 views

making a binary string palindrome using xor operations [closed]

Problem You are given a binary string A of length N. You can perform the following type of operation on the string A: Choose two different indices \$i\$ and \$j\$ (\$1 \le i\$, \$j \le N\$) Change \$...
hemanth's user avatar
  • 11
47 votes
38 answers
3k views

Last odd digit of power of 2

Task Given \$n\$, output position of the last odd digit in the decimal representation of \$2^n\$ (counting from the end). Rules There are no odd digits for \$n=1,2,3,6,11\$ \$(2, 4, 8, 64, 2048)\$ - ...
pajonk's user avatar
  • 15.1k
23 votes
28 answers
1k views

Lowest digit addition generator

A digit addition generator of an integer n is any integer x that satisfy the equation ...
Tom Epsilon's user avatar
1 vote
0 answers
110 views

Print all semimagic squares [closed]

I am working on a code to print all semimagic squares [1] of a given size. I am working with the following definition: An \$n\times n\$ consists of numbers \$1,2,\cdots, n^2\$. All numbers must be ...
ananta's user avatar
  • 111
14 votes
5 answers
3k views

Sudoku as a SAT problem

Background An interesting way to solve a Sudoku puzzle is to represent it as a Boolean satisfiability problem, and then feed it to a SAT solver. A Boolean Satisfiability Problem (abbreviated as SAT ...
alephalpha's user avatar
  • 46.5k
5 votes
4 answers
205 views

Tips for golfing in Arturo

Arturo is a bytecode-compiled/interpreted, garbage-collected general-purpose language filling a role similar to JavaScript, Python and Ruby. It is centered around the concept of blocks, which hold ...
chunes's user avatar
  • 22.7k
8 votes
5 answers
2k views

What is the shortest regex for the month of January in a handful of the world's languages?

What is the shortest regular expression equivilant to the following? ...
Samuel Muldoon's user avatar
18 votes
3 answers
2k views

Render text in a slanted ASCII-art font

Given a text input such as: THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG render the following output: ...
Timwi's user avatar
  • 12.9k
19 votes
24 answers
2k views

Split a string on unnested commas

Create the shortest program/function/whatever that splits an inputted string along un-nested commas. A comma is considered nested if it is either within parentheses, brackets, or braces. Input and ...
Dadsdy's user avatar
  • 2,035

15 30 50 per page
1
3 4
5
6 7
278