Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Challenges

Code challenges of all types. For questions about golfing, bowling, etc, use Q&A. For questions about this community, use Meta. To get feedback on a challenge before posting it, use Sandbox.

Filters (None)
75%
+4 −0
Caesar shift cipher

Introduction What is the Caesar shift cipher (ROT$n$)? It's basically a cipher sequence that changes a letter's value from the number chosen. If we use ROT1 on "games", we get "hbnft". The basic i...

7 answers  ·  posted 2y ago by General Sebast1an‭  ·  edited 2y ago by General Sebast1an‭

77%
+5 −0
Add two negabinary integers

About Negabinary Negabinary means base negative two (-2). That is, the $n$th place value is determined by $(-2)^n$. Negabinary numbers can be evaluated just like any other base system. For exampl...

3 answers  ·  posted 3y ago by Moshi‭  ·  last activity 3y ago by Shaggy‭

77%
+5 −0
A number adder, not a death adder

Create a program P1 which takes as input a base 10 number N1 (the numbers for the variables are important). Given N1, P1 will print a program P2. P2 will take as input a base 10 number N2 and outpu...

14 answers  ·  posted 3y ago by AndrewTheCodegolfer‭  ·  last activity 2y ago by torres‭

77%
+5 −0
Shuffle a subset of a list

Idea shamelessly stolen from caird and rak1507 Shuffle a subset of a list of unique, positive integers with uniform randomness, given the indices of that subset. For example, given the list $[A, B...

4 answers  ·  posted 3y ago by user‭  ·  edited 2y ago by General Sebast1an‭

60%
+1 −0
Recreate the Server Fault logo

Make the Server Fault logo using the following criteria: The boxes' measurements: There are 3 columns of 5 boxes, with long ones at the left where the rest are regular. The following measure...

0 answers  ·  posted 3y ago by General Sebast1an‭

80%
+6 −0
Versatile self-printer

Using your languages of choice, golf a quine - a non-empty program taking no input and only outputting its source. Here, the win condition is your quine working in the most languages. It should be...

1 answer  ·  posted 3y ago by AndrewTheCodegolfer‭  ·  last activity 2y ago by General Sebast1an‭

66%
+6 −2
Multiply complex numbers.

Multiply complex numbers. 2 space-seperated ones will be input, as follows: (update: you can replace i with j or some other symbol if needed) a+bi -a+bi a-bi -a-bi where a and b are integers ...

7 answers  ·  posted 3y ago by heav‭  ·  last activity 1y ago by __blackjack__‭

77%
+5 −0
Create a Sudoku

Write the shortest program that takes no input and outputs a Sudoku solution. For reference, a Sudoku solution is a 9x9 grid of digits where each column, each row and each of the nine 3x3 grids th...

4 answers  ·  posted 3y ago by AndrewTheCodegolfer‭  ·  last activity 3y ago by Shaggy‭

81%
+7 −0
Evens or Odds - you know this one

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...

16 answers  ·  posted 3y ago by AndrewTheCodegolfer‭  ·  last activity 1y ago by Olin Lathrop‭

81%
+7 −0
Word Count Tool

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 ...

9 answers  ·  posted 3y ago by Quintec‭  ·  last activity 2y ago by torres‭

77%
+5 −0
Are they abundant, deficient or perfect?

Abundant numbers are numbers which are less than their proper divisor sum. For example $18$ is abundant as $1 + 2 + 3 + 6 + 9 = 21 > 18$ Deficient numbers are numbers which are greater than the...

8 answers  ·  posted 3y ago by caird coinheringaahing‭  ·  last activity 2y ago by General Sebast1an‭

77%
+5 −0
Recreate the Stack Overflow logo

Originally from Somewhere Else. I thought I'd continue making more drawing challenges here now that I discovered it. Make the Stack Overflow logo using the following criteria: The tray: ...

2 answers  ·  posted 3y ago by General Sebast1an‭  ·  last activity 2y ago by Anonymous‭

77%
+5 −0
Diagonalized alphabet

Task Print the following: ABDFHJLNPRTVXZ CABDFHJLNPRTVX ECABDFHJLNPRTV GECABDFHJLNPRT IGECABDFHJLNPR KIGECABDFHJLNP MKIGECABDFHJLN OMKIGECABDFHJL QOMKIGECABDFHJ SQOMKIGECABDFH USQOMKIGE...

7 answers  ·  posted 3y ago by Razetime‭  ·  last activity 2y ago by radarek‭

81%
+7 −0
Evaluation order of an APL n-train

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) ...

7 answers  ·  posted 3y ago by rak1507‭  ·  last activity 3y ago by Shaggy‭

81%
+7 −0
Backspace an array

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...

6 answers  ·  posted 3y ago by rak1507‭  ·  last activity 2y ago by Shaggy‭

80%
+6 −0
Juggler sequences

A Juggler sequence is a sequence that begins with a positive integer $a_0$ and each subsequent term is calculated as: $$a_{k+1} = \begin{cases} \left \lfloor a_k ^ \frac 1 2 \right \rfloor, &...

9 answers  ·  posted 3y ago by caird coinheringaahing‭  ·  last activity 2y ago by Shaggy‭

83%
+8 −0
Golf a FRACTRAN interpreter

Description From the Esolangs wiki, In Fractran, a program consists of a finite list of positive, rational numbers. The input to a program is a positive integer n. The list is then searched ...

8 answers  ·  posted 3y ago by Razetime‭  ·  last activity 2y ago by torres‭

86%
+11 −0
Merge two strings

Challenge Given two strings a and b, return the shortest string s so that s starts with a and ends with b. (Inspired by https://chat.stackexchange.com/transcript/message/57816868#57816868 ) Exam...

8 answers  ·  posted 3y ago by rak1507‭  ·  last activity 2y ago by radarek‭

81%
+7 −0
Make my number a set

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...

10 answers  ·  posted 3y ago by Wezl‭  ·  last activity 2y ago by radarek‭

71%
+3 −0
Really Cool Numbers

Define a cool number as a number whose proper divisors (all except for the number itself) have an integral mean. Define a really cool number as a number whose divisors (including itself) are all co...

3 answers  ·  posted 3y ago by Quintec‭  ·  last activity 3y ago by user‭

80%
+6 −0
Beaver Code Decryption

Credit This challenge is taken with permission from https://www.mysterytwisterc3.org/en/challenges/level-1/beaver-code Description The encryption method is as follows: The plaintext is divided ...

6 answers  ·  posted 3y ago by rak1507‭  ·  last activity 2y ago by Shaggy‭

87%
+12 −0
Cumulative Counts

Challenge Given an array of numbers return the cumulative count of each item. This is the number of times an item has occurred so far. Examples [1,1,2,2,2,1,1,1,3,3] -> [1,2,1,2,3,3,4,5,1,2]...

19 answers  ·  posted 3y ago by rak1507‭  ·  last activity 10mo ago by WheatWizard‭

81%
+7 −0
Word Set Square

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...

11 answers  ·  posted 3y ago by Razetime‭  ·  last activity 1y ago by Shaggy‭

77%
+5 −0
Ratio limits of fibonacci-like series

Definition $F_{n}\left(0\right)=0$ $F_{n}\left(1\right)=1$ $F_{n}\left(x\right)=n\cdot F_{n}\left(x-1\right)+F_{n}\left(x-2\right)$ For example: $F_{1}=\left[0,1,1,2,3,5,8,13,21,34,55,89...\ri...

3 answers  ·  posted 3y ago by rak1507‭  ·  edited 2y ago by General Sebast1an‭

80%
+6 −0
Is it a near-anagram?

Two words are anagrams of each other if the letters of one can be reordered to spell the other; e.g. ADOBE and ABODE are anagrams. An alternate way of describing it is that both words contain the s...

5 answers  ·  posted 3y ago by snail_‭  ·  edited 2y ago by General Sebast1an‭

75%
+4 −0
The Pell Numbers

Introduction The Pell(no, not Bell) Numbers are a simple, Fibonacci-like sequence, defined by the following relation: $P_n=\begin{cases}0&\mbox{if }n=0;\\1&\mbox{if }n=1;\\2P_{n-1}+P_{n-2...

9 answers  ·  posted 3y ago by Razetime‭  ·  last activity 2y ago by torres‭

75%
+4 −0
Win a War (or at least a few battles)

You have an army of size $n$ that you need to split up to fight $k$ battles simultaneously against an opposing army $A$. In each battle, the army with the most troops present wins - no one wins a t...

2 answers  ·  posted 3y ago by Quintec‭  ·  edited 2y ago by General Sebast1an‭

83%
+8 −0
Solve Goldbach's Conjecture

Goldbach's Conjecture states that every even whole number greater than 2 is the sum of 2 prime numbers. Your task is to return those 2 prime numbers, given an even whole number as input. There are ...

10 answers  ·  posted 3y ago by Quintec‭  ·  last activity 2y ago by torres‭

85%
+10 −0
Create an Alphabet Diamond

Challenge Output the following text: A ABA ABCBA ABCDCBA ABCDEDCBA ...

11 answers  ·  posted 3y ago by dzaima‭  ·  last activity 2y ago by General Sebast1an‭

77%
+5 −0
Longest parallel lines

Note: This challenge was underspecified and bad, and as such I would not encourage answering it in the future. Challenge You will be given a single 2D boolean array $M$. You may take its dimensi...

1 answer  ·  posted 3y ago by rak1507‭  ·  edited 3y ago by rak1507‭

80%
+6 −0
Write a Deadfish Interpreter

A rewrite of this SE question with a simpler input format and guidelines. Challenge Deadfish uses a single accumulator, on which all commands are to be performed. It has the following commands: ...

8 answers  ·  posted 3y ago by Razetime‭  ·  last activity 2y ago by Zakk‭

81%
+7 −0
Truthify an array

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, ...

10 answers  ·  posted 3y ago by Razetime‭  ·  last activity 2y ago by General Sebast1an‭

75%
+4 −0
Calculate a person's age

Challenge Given a date with day, month and year, calculate how old a person born on that day would be today. Input can be in any reasonable format(params, array, date object). Input will never b...

0 answers  ·  posted 3y ago by Razetime‭

66%
+2 −0
Golf me a polygonal loader

CGCC Sandbox, Codidact Sandbox Given three positive integers as input, animate an ascii-art polygonal loading symbol on the screen. Intro Using the first input $n$, Take one the following regul...

1 answer  ·  posted 3y ago by Razetime‭  ·  edited 2y ago by General Sebast1an‭

71%
+3 −0
The Camelot Wheel

Given a musical key, output its number and letter on the Camelot Wheel (shown below). Input A musical key as a string, as shown on the wheel. The words "Sharp" and "Flat" may be replaced with s...

2 answers  ·  posted 3y ago by Quintec‭  ·  edited 2y ago by General Sebast1an‭

83%
+8 −0
Integer to Roman numeral

The task is to take a decimal integer as input and print the corresponding Roman numeral with capital letters. The program must handle all positive integer numbers between 1 and 1000. Input can be...

3 answers  ·  posted 3y ago by Lundin‭  ·  last activity 3y ago by Lundin‭

75%
+4 −0
Generate Lewis Caroll's Jabberwocky

The task is to generate the text of Lewis Caroll's Jabberwocky. The text, quoted from Wikipedia, is as follows (I've replaced a non-ASCII character with ASCII, otherwise it's direct copy&paste...

4 answers  ·  posted 3y ago by celtschk‭  ·  last activity 2y ago by General Sebast1an‭

71%
+3 −0
Towering Cistercian Representation

SE Sandbox Link, Codidact Sandbox Link Inspired by this video. Given a positive integer, draw its Cistercian representation as ascii art. The Challenge Cistercian numerals are a decimal-based...

1 answer  ·  posted 3y ago by Razetime‭  ·  edited 2y ago by General Sebast1an‭

88%
+13 −0
Output 256 in many different ways

Challenge Write as many functions, programs, or snippets of code, that result in 256. Your score is the number of separate solutions submitted in an answer. The challenge? The characters used in ...

12 answers  ·  posted 3y ago by dzaima‭  ·  last activity 2y ago by snail_‭

86%
+11 −0
Reverse an ASCII string

Your goal is to reverse an ascii string. Given a (optionally newline or null terminated) input, output your input in reverse order, optionally followed by a newline. Terminate afterward. Function...

32 answers  ·  posted 3y ago by moony‭  ·  last activity 9mo ago by qwr‭

77%
+5 −0
Given the preorder and the inorder of a tree, output the postorder

Definitions A binary tree is either a null (leaf), or an object (node). A node contains a value (non-negative integer) and two pointers (left and right) to two separate binary trees. A binary tre...

2 answers  ·  posted 3y ago by Hakerh400‭  ·  last activity 2y ago by radarek‭

71%
+3 −0
Longest Increasing Subsequence

Given an array of numbers, output the length of the longest increasing (not necessarily contiguous) subsequence. It is guaranteed that there are no duplicates in the array. For example, if the inpu...

4 answers  ·  posted 3y ago by Quintec‭  ·  edited 2y ago by General Sebast1an‭

80%
+6 −0
Shape of an array

Given a non-ragged array (an array where all sub-arrays at a particular level have the same length) of non-negative integers, answer its shape, that is, the length along every dimension. You may as...

6 answers  ·  posted 3y ago by Adám‭  ·  last activity 2y ago by south‭

86%
+11 −0
Weave Strings Together

Given a list of strings(and optionally, their length) as input, weave the strings together. Intro Your goal is to mimic the WV operator in Pip. Take a list of strings and alternate between their ...

13 answers  ·  posted 3y ago by Razetime‭  ·  last activity 2y ago by radarek‭

81%
+7 −0
Bytes to Segfault

Challenge Cause the currently running program to receive the SIGSEGV signal (on Linux or other *nix systems) as fast as possible. What it does with the signal doesn't matter as long as it receives...

10 answers  ·  posted 3y ago by moony‭  ·  last activity 2y ago by radarek‭

84%
+9 −0
1, 2, Fizz, 4, Buzz!

The task Output the first 100 elements of the infamous FizzBuzz sequence. How? The FizzBuzz sequence is the sequence of decimal integers from 1 to 100 inclusive, but: If the integer is divisi...

20 answers  ·  posted 3y ago by Dion‭  ·  last activity 2y ago by celtschk‭

75%
+4 −0
Tile pyramids on top of each other!

The task Given a positive integer as input, output tiled pyramids of this height. How? Let's say the inputted integer was n. From there, we output n lines of output, each having: A decreasing...

9 answers  ·  posted 3y ago by Dion‭  ·  last activity 2y ago by A username‭

84%
+9 −0
Length of a Sumac Sequence

Heavily based on this closed challenge from SE. Description A Sumac sequence starts with two non-zero integers $t_1$ and $t_2.$ The next term, $t_3 = t_1 - t_2$ More generally, $t_n = t_{n-2} ...

9 answers  ·  posted 3y ago by Razetime‭  ·  edited 2y ago by General Sebast1an‭

87%
+12 −0
Partial Sums of Harmonic Series

Given an positive integer $n$, return the least positive integer $k$ such that the $k$th partial sum of the harmonic series is greater than or equal to $n$. For example, if $n = 2$, then $k = 4$, b...

11 answers  ·  posted 3y ago by Quintec‭  ·  last activity 1y ago by south‭

77%
+5 −0
Prime Difference

Given an integer n, output the smallest prime such that the difference between it and the next prime is at least n. For example, if n=5, you would output 23, since the next prime is 29, and 29-23&...

8 answers  ·  posted 3y ago by Quintec‭  ·  last activity 2y ago by radarek‭