Search
An integer is called square-free if it is not a multiple of a perfect square other than 1. For example, 42 is square-free, but 44 is not because it is a multiple of the perfect square 4 = 2². Your...
Background Check out this video on the Collatz conjecture, also known as A006577. If you don't know what this is, we're given an equation of $3x + 1$, and it is applied this way: If $x$ is odd...
You are a low-level censor working for the Ministry of Media Accuracy. Part of your job is to make sure that certain words don't appear in publications. Every morning you get a fresh stack of next...
Challenge A Niven number is a positive integer which is divisible by the sum of its digits. For example, 81 -> 8+1=9 -> 81%9=0. Your task is to find the first n Niven numbers, given n. Te...
Challenge Given an integer n>=4 as input create an ASCII art "prison door"* measuring n-1 characters wide and n characters high, using the symbols from the example below. Example ╔╦╗ ╠╬╣ ...
Challenge This is a simple randomness challenge: Given a non-negative integer $n$, and positive integer $m$, simulate rolling and summing the results of $n$ fair dice, each of which have $m$ sides...
Brain-Flak, 12 bytes {({}<>)<>}<> Try it online! # (Implicitly) Read characters from STDIN and place them all on the active stack # While the top of the active stack is no...
C, 8 solutions Standard C, no extensions. 1 solution snippet per line: "llll"[3]^33^333 4*4*4*4 5555-555-555-555-555-555-555-555-555-555-55-55-55-55-55-5-5-5-7-7 6666/26 (int){8<...
Jelly has an atom called untruth, which when given indices, creates an array with 1s at those places: [2,4] → [0,1,0,1]. You are required to perform the inverse of this. Given a 2D boolean array, ...
JavaScript (Node.js), 74 70 bytes Works for any number of dimensions. f=(a,z=[])=>a.map?.((b,c)=>z.push(...f(b).map(a=>[c,...a])))?z:a?[z]:z Try it online! (TIO uses an old version ...
Programs may take input from prompts from the GUI For Mathematica, JS, Matlab, et. al. this is the closest thing they have to STDIN.
Using the lack of features in a language to trivialize the problem For example, in a challenge which requires your program to check if it is connected to the internet, using Brainfuck to always pr...
Functions may take multiple arguments with currying For some languages like Haskell this is almost a necessity, as only one-argument functions exist and multi-argument functions are implemented wi...
Interpreting the challenge too literally If the challenge asks that you print the nth prime given input n, a program printing the nth prime given input n isn't allowed.
The answer header must specify the minimum implementation & environment required If there are multiple implementations of a language and an answer depends on features of one, it must be specif...
Task I often need to find the factorial of a number or the sum of all numbers up to a number when cheating on math tests. To help me with this, your task is to write $F$, a generalized version of ...
Challenge Given a string, e.g. Hello, do the following: Mirror it: Hello -> HelloolleH and create a right triangle using it as the sides: H ee l l l l o...
APL (Dyalog Extended), 18 bytes Anonymous tacit prefix function taking a list of two strings as argument. 2=1⊥(≠⌿∊≢⍤⊢⌸⍤,⍤1↑) Try it online! (…) apply the following tacit function to the arg...
Natural to set (set meaning an unordered collection with no duplicates, though answers may use and output lists instead) Recently I was brainstorming what a language with only (arbitrarily nested...
Challenge Given an array consisting of positive integers and 0s, return it with 0s acting like backspaces. Leading backspaces do nothing, and more backspaces than elements also does nothing. Cre...
Description APL trains are a series of functions, that get applied to an argument in this way: (f g) x = f g x (f g h) x = (f x) g (h x) (a b c d e f) x = (a (b c (d e f))) x = a (b x) c (d x) ...
In Google Docs, the word count tool looks like this: Pages would not make sense, but your goal is to implement every other count. Definitions Words are strings of text separated by any amount ...
status-completed I've just converted posts in the Challenges category over to a new Challenge post type that awards more reputation per upvote, starting now. Retroactive reputation changes are bei...
Get ready for a comparatively dry question - this is intended to be one of the "the"s of the code-golfing dictionary. Create a program which inputs a base 10 non-negative whole number (without lea...