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

121 posts · Subscribe
92%
+23 −0
"Hello, World!"

Introduction The classic "Hello, World" challenge. What more can I say? Rules Program takes no input. Program outputs Hello, World! with an optional trailing newline. No other output is accep...

58 answers  ·  posted 2y ago by anna328p‭  ·  last activity 4mo ago by __blackjack__‭

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 2y ago by dzaima‭  ·  last activity 1y ago by snail_‭

87%
+12 −0
Evaluate a single variable polynomial equation

Challenge Given a list of n numbers and x, compute $a + bx^1 + cx^{2} + ... + zx^{n-1}$, where a is the first value in the list, b is the second, etc. n is at most 256 and at least 0. The input va...

20 answers  ·  posted 2y ago by moony‭  ·  last activity 1y ago by south‭

87%
+12 −0
Print the Great Numeric Pyramid

Print or return this exact text: 0 0 0 0 1 0 0 1 1 0 0 1 2 1 0 ...

5 answers  ·  posted 2y ago by Sisyphus‭  ·  last activity 1y ago by Marshall Lochbaum‭

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 2y ago by Quintec‭  ·  last activity 5mo ago by south‭

86%
+11 −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] -&gt; [1,2,1,2,3,3,4,5,1,2]...

18 answers  ·  posted 2y ago by rak1507‭  ·  last activity 2mo ago by dino‭

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 2y ago by rak1507‭  ·  last activity 1y ago by radarek‭

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

27 answers  ·  posted 2y ago by moony‭  ·  last activity 10mo ago by celtschk‭

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 2y ago by Razetime‭  ·  last activity 1y ago by radarek‭

86%
+11 −0
Can you give me half?

Challenge idea taken from: Eliseo D'Annunzio Task Provide code that evaluates to 0.5 numerically, i.e. the output must be recognized by your chosen language as a numeric value (Number, float, dou...

22 answers  ·  posted 12mo ago by Razetime‭  ·  last activity 3mo ago by taoh‭

85%
+10 −0
It's Hip to be Square

Challenge A catalogue type challenge that simply asks: Given an integer n (where n&gt;=0) as input return a truthy value if n is a perfect square or a falsey value if not. Rules You may take...

20 answers  ·  posted 1y ago by Shaggy‭  ·  last activity 9mo ago by Zakk‭

85%
+10 −0
Create an Alphabet Diamond

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

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

85%
+10 −0
Are All Elements Equal?

Challenge Given a list of integers &gt;= 0 , check if all of them are equal. Tests [1,1,1,1,1] -&gt; true [0,1,1,6,7] -&gt; false [1] -&gt; true [] -&gt; undefined(you do n...

16 answers  ·  posted 1y ago by Razetime‭  ·  last activity 8mo ago by torres‭

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 2y ago by Dion‭  ·  last activity 1y ago by celtschk‭

84%
+9 −0
Obligatory Quine Challenge

Rules Using your language of choice, golf a quine. A quine is a non-empty computer program which takes no input and produces a copy of its own source code as its only output. No cheating -- ...

9 answers  ·  posted 2y ago by ATaco‭  ·  last activity 1y ago by General Sebast1an‭

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 2y ago by Razetime‭  ·  edited 1y ago by General Sebast1an‭

84%
+9 −0
Coat of Many Colours

Challenge Given a list of unique colour names as input, sort them in the order that they first appear in Joseph's Amazing Technicolour Dreamcoat. Example Input: green, blue, red, brown Outpu...

6 answers  ·  posted 1y ago by Shaggy‭  ·  last activity 1y ago by radarek‭

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 2y ago by Quintec‭  ·  last activity 8mo ago by torres‭

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 2y ago by Razetime‭  ·  last activity 8mo ago by torres‭

83%
+8 −0
Looping counter

Looping counter Create an infinite loop that outputs lines of asterisks, with each line containing one more asterisk. Instead of the asterisk, any printable, non-whitespace character can be used. ...

18 answers  ·  posted 9mo ago by celtschk‭  ·  last activity 4mo ago by south‭

81%
+7 −0
Find n Niven Numbers

Challenge A Niven number is a positive integer which is divisible by the sum of its digits. For example, 81 -&gt; 8+1=9 -&gt; 81%9=0. Your task is to find the first n Niven numbers, given n. Te...

7 answers  ·  posted 6mo ago by Razetime‭  ·  last activity 5mo ago by Shaggy‭

81%
+7 −0
Operation "Find The Operator"

Challenge Make a program that takes input of 3 non-negative integers: a result and 2 other values that once calculated results to the 3rd value. The program must figure out how to get the 2 fir...

5 answers  ·  posted 1y ago by General Sebast1an‭  ·  last activity 1y ago by radarek‭

81%
+7 −0
Determine whether an integer is square-free

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

13 answers  ·  posted 1y ago by celtschk‭  ·  last activity 4mo ago by Shaggy‭

81%
+7 −0
Reduce over the range [1..n]

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

14 answers  ·  posted 1y ago by user‭  ·  last activity 6mo ago by gifti‭

81%
+7 −0
Word Set Square

Challenge Given a string, e.g. Hello, do the following: Mirror it: Hello -&gt; HelloolleH and create a right triangle using it as the sides: H ee l l l l o...

11 answers  ·  posted 2y ago by Razetime‭  ·  last activity 4mo ago by Shaggy‭

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 2y ago by Wezl‭  ·  last activity 1y ago by radarek‭

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 2y ago by Razetime‭  ·  last activity 1y ago by General Sebast1an‭

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 2y ago by moony‭  ·  last activity 1y ago by radarek‭

81%
+7 −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 2y ago by Lundin‭  ·  last activity 2y ago by Lundin‭

81%
+7 −0
In The Jailhouse Now

Challenge Given an integer n&gt;=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 ╔╦╗ ╠╬╣ ...

6 answers  ·  posted 1y ago by Shaggy‭  ·  last activity 1y ago by snail_‭

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 1y ago by rak1507‭  ·  last activity 1y ago by Shaggy‭

81%
+7 −0
Collatz conjecture; Count the tries to reach $1$

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

15 answers  ·  posted 1y ago by General Sebast1an‭  ·  last activity 8mo ago by torres‭

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 1y ago by rak1507‭  ·  last activity 1y 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 1y ago by AndrewTheCodegolfer‭  ·  last activity 6mo 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 1y ago by Quintec‭  ·  last activity 8mo ago by torres‭

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, &amp;...

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

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 2y ago by rak1507‭  ·  last activity 1y ago by Shaggy‭

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 1y ago by AndrewTheCodegolfer‭  ·  last activity 1y 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 2y ago by snail_‭  ·  edited 1y ago by General Sebast1an‭

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 2y ago by Razetime‭  ·  last activity 9mo ago by Zakk‭

80%
+6 −0
Roll n fair dice

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

9 answers  ·  posted 1y ago by Moshi‭  ·  last activity 8mo ago by south‭

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 2y ago by Adám‭  ·  last activity 12mo ago by south‭

80%
+6 −0
Golf golf challenge

The task is to create a program which displays a golf score as text. It takes 2 numbers as input, separated by space or new line: The first number is the par of the specific hole. The second nu...

5 answers  ·  posted 1y ago by Lundin‭  ·  last activity 1y ago by radarek‭

77%
+5 −0
Create a range grid

This challenge is based on the i. verb from J. A range grid is basically a range of m × n numbers fit into a rectangular grid with m rows and n columns. A 2×3 range grid would be: 0 1 2 3 4 5 ...

8 answers  ·  posted 9mo ago by Razetime‭  ·  last activity 5mo ago by Shaggy‭

77%
+5 −0
Guess the language! (Cops' Thread)

ROBBERS' THREAD A famous cops-and-robbers challenge whose source shall remain unnamed is brought to Codidact. You are a cop. You should write a program in a "famous" (has an English Wikipedia/Eso...

16 answers  ·  posted 1y ago by AndrewTheCodegolfer‭  ·  last activity 1y ago by Shaggy‭

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 1y ago by Moshi‭  ·  last activity 1y ago by Shaggy‭

77%
+5 −0
Gamer Meme Creator

Challenge You will be given a string and an ascii art as input. The string must be placed above the ascii art, and centered based on its longest line. The text BOTTOM TEXT must be placed below...

4 answers  ·  posted 1y ago by Razetime‭  ·  last activity 1y ago by user‭

77%
+5 −0
99 Shortened Bottles of Beer

Disclaimer This challenge also exists in CGCC, but if you want to compete here (too), then hop in! Challenge Recreate "99 Bottles of Beer on the Wall", using the least bytes possible. Lyrics: ...

13 answers  ·  posted 1y ago by General Sebast1an‭  ·  last activity 1y ago by General Sebast1an‭

77%
+5 −0
Compute the determinant

Challenge A simple challenge: Given a two-dimensional matrix (an array of arrays) of real numbers, compute the determinant. The determinant of a matrix is a mathematical construct used in many ap...

8 answers  ·  posted 1y ago by Moshi‭  ·  last activity 1y ago by radarek‭

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 1y ago by AndrewTheCodegolfer‭  ·  last activity 8mo ago by torres‭

This community is part of the Codidact network. We have other communities too — take a look!

You can also join us in chat!

Want to advertise this community? Use our templates!

Like what we're doing? Support us! Donate