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

Posts tagged code-golf

Code golf is a winning criterion, where users seek to solve the challenge in as few bytes of source code as possible.

This tag doesn't have a detailed wiki yet.

83%
+8 −0
Challenges The 50 substrings that validate any string of Roman numerals

Given a string of Roman numerals, decide whether it forms a valid Roman number. If not, output the substring that proves this, from the list of 50 strings described below. Relevant fact This chal...

7 answers  ·  posted 7mo ago by trichoplax‭  ·  edited 2h ago by trichoplax‭

50%
+0 −0
Challenges Multiplicative perfection

Given a positive integer, indicate whether it is the product of its proper divisors. Integers equal to the product of their proper divisors can be found on the Online Encyclopedia of Integer Seque...

4 answers  ·  posted 5d ago by trichoplax‭  ·  last activity 3d ago by celtschk‭

50%
+0 −0
Challenges How many odd digits?

Given a positive integer, count its odd digits. Input An integer from 1 to 999,999,999, inclusive, in any of the following formats: A number (such as an integer or floating point number), li...

6 answers  ·  posted 2mo ago by trichoplax‭  ·  last activity 3d ago by celtschk‭

Question code-golf number
71%
+3 −0
Sandbox Source with the whole alphabet in order of appearance

posted 1mo ago by Lundin‭  ·  edited 4d ago by Lundin‭

Article code-golf
50%
+0 −0
57%
+2 −1
Challenges Fibonacci without consecutive digits

Output the Nth number in the list of Fibonacci numbers that have no consecutive digits. Input A non-negative integer (if you treat the Fibonacci numbers as zero-indexed) or a positive integer (...

4 answers  ·  posted 8mo ago by trichoplax‭  ·  last activity 24d ago by Andrew Ray‭

50%
+0 −0
Sandbox Digits with subsets of unique probability

posted 2mo ago by trichoplax‭  ·  edited 2mo ago by trichoplax‭

50%
+0 −0
Sandbox How many odd digits? [FINALIZED]

posted 2mo ago by trichoplax‭  ·  edited 2mo ago by trichoplax‭

60%
+1 −0
Challenges Hex ​​​detector

Given an integer from 1 to 1000, indicate whether it is a centered hexagonal number[1] (also known as a hex number). What is a hex number? The hex numbers can be visualised as follows: On a he...

4 answers  ·  posted 3mo ago by trichoplax‭  ·  last activity 2mo ago by trichoplax‭

Question code-golf math number
85%
+10 −0
Challenges 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. ...

21 answers  ·  posted 2y ago by celtschk‭  ·  last activity 2mo ago by xrs‭

Question code-golf
66%
+2 −0
Challenges Substring factor

Does a positive integer have a substring as a factor? Input A positive integer. Output One of 2 distinct values to indicate whether the input has a factor that is a strict substring of it...

3 answers  ·  posted 3mo ago by trichoplax‭  ·  last activity 2mo ago by Shaggy‭

50%
+0 −0
Sandbox Plain ​​spheres

posted 3mo ago by trichoplax‭  ·  edited 2mo ago by trichoplax‭

66%
+2 −0
Sandbox Net​​ or​​ not? [FINALIZED]

posted 2mo ago by trichoplax‭  ·  edited 2mo ago by trichoplax‭

50%
+0 −0
Challenges Net​​ or​​ not?

Given a hexomino, indicate whether it is a net of a cube. Input A 6 by 6 grid containing exactly 6 filled squares. The 6 filled squares will be in a single edge connected set (a hexomino). Th...

0 answers  ·  posted 2mo ago by trichoplax‭

Question code-golf math
71%
+3 −0
Challenges Towers of DC .:.

DC is a reverse-Polish calculator REPL that is available on most Linux distributions. In reverse-Polish notation, you can push values to a stack and then pop those values back off to perform operat...

0 answers  ·  posted 3mo ago by Andrew Ray‭  ·  edited 3mo ago by trichoplax‭

50%
+0 −0
Sandbox Substring factor [FINALIZED]

posted 3mo ago by trichoplax‭  ·  edited 3mo ago by trichoplax‭

60%
+1 −0
Challenges Most isolated of 3 points

Given 3 points, output one that is separated from its nearest neighbour by the largest distance. Input 3 distinct points (that is, no 2 points are in the same position). Each point is a pair o...

0 answers  ·  posted 3mo ago by trichoplax‭  ·  edited 3mo ago by trichoplax‭

Question code-golf math number
60%
+1 −0
Sandbox Most isolated of 3 points [FINALIZED]

posted 3mo ago by trichoplax‭  ·  edited 3mo ago by trichoplax‭

75%
+4 −0
Challenges Fibonascii Squares

The Challenge Your job is to, given input positive non-zero integer $n$, output an ASCII representation of the tiled Fibonacci squares up to the $n$th number of the Fibonacci sequence. Rules Inp...

2 answers  ·  posted 4mo ago by Sylvester‭  ·  edited 3mo ago by Sylvester‭

50%
+0 −0
Sandbox Hex ​​​detector [FINALIZED]

posted 3mo ago by trichoplax‭  ·  edited 3mo ago by trichoplax‭

66%
+2 −0
Sandbox Fibonascii Squares [FINALIZED]

posted 4mo ago by Sylvester‭  ·  edited 4mo ago by trichoplax‭

50%
+0 −0
Challenges Rationalise recurring binary

Given a potentially recurring binary string, output the number it represents, as a fraction in lowest terms. The notation used in this challenge for recurring digits is non-standard. An r is used ...

0 answers  ·  posted 2y ago by trichoplax‭  ·  edited 4mo ago by trichoplax‭

77%
+5 −0
Challenges 55 fruit salad: choose your own Kolmogorov complexity

This is a fixed output challenge. It is similar to a standard Kolmogorov complexity challenge, except you get to choose your own fixed output. Given no input, output 55 fruits. You may choose any 5...

5 answers  ·  posted 2y ago by trichoplax‭  ·  last activity 4mo ago by trichoplax‭

92%
+24 −0
Challenges "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...

61 answers  ·  posted 4y ago by anna328p‭  ·  last activity 4mo ago by Lundin‭

80%
+6 −0
Challenges Digit Sum Integer Sequence (working title)

Inspired by this challenge. If anyone has any suggestions for a song title I could use for the challenge title then please leave a comment. Definition We define f(x) for a given integer as the su...

7 answers  ·  posted 3y ago by Shaggy‭  ·  last activity 5mo ago by xrs‭

Question code-golf sequence
84%
+9 −0
Challenges 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...

21 answers  ·  posted 4y ago by Dion‭  ·  last activity 5mo ago by xrs‭

61%
+6 −3
Challenges Make $2 + 2 = 5$

In this challenge, add 2 integers, but if both the integers are 2, output 5. Shortest code in each language wins! Example ungolfed program in Python 3.x def add(x, y): if x == 2 and y == 2: ...

21 answers  ·  posted 3y ago by General Sebast1an‭  ·  last activity 5mo ago by xrs‭

Question code-golf math number
86%
+11 −0
Challenges 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...

33 answers  ·  posted 4y ago by moony‭  ·  last activity 5mo ago by xrs‭

Question code-golf
71%
+3 −0
Challenges Single digit Roman numeral

Given a single character, which is a valid Roman numeral, output its value. Values There are 7 valid single character Roman numerals, with the following values: Character Value I...

6 answers  ·  posted 12mo ago by trichoplax‭  ·  last activity 5mo ago by xrs‭

Question code-golf
66%
+2 −0
Challenges Round trip stones

$N$ vessels initially contain $3$ stones each. What is the probability of having at least $3$ stones in the first vessel after moving a uniformly random selection from the first vessel to the secon...

1 answer  ·  posted 6mo ago by trichoplax‭  ·  last activity 5mo ago by Arpad Horvath‭

66%
+2 −0
Q&A Tips for golfing in Emmental

Also posted here on CodeGolf.SE Brief introduction to Emmental: Emmental is a self-modifying programming language defined by a meta-circular interpreter. It is a stack based language, but also ...

0 answers  ·  posted 5mo ago by CrSb0001‭

Question code-golf tips
66%
+2 −0
Challenges Construct the Irish possessive

In this challenge you will take an Irish word and a personal pronoun and create the possessive pronoun construction combining the two. For example sé, madra becomes a mhadra. Translated to English...

1 answer  ·  posted 6mo ago by WheatWizard‭  ·  last activity 6mo ago by Arpad Horvath‭

50%
+0 −0
Sandbox Round trip stones [FINALIZED]

posted 6mo ago by trichoplax‭  ·  edited 6mo ago by trichoplax‭

60%
+1 −0
Challenges Word suggesting

Suggest a word from a word list, given a string. Motivation Imagine typing a word one letter at a time, and seeing a suggested word after each letter is typed. At first the suggested word is simp...

1 answer  ·  posted 1y ago by trichoplax‭  ·  edited 7mo ago by trichoplax‭

Question code-golf string list
71%
+3 −0
Sandbox 12-hour time is weird [finalized]

posted 7mo ago by honnza‭  ·  edited 7mo ago by honnza‭

71%
+3 −0
Challenges 12-hour time is weird

Your mission for today, should you choose to accept it, is to write a simple 12-hour clock calculator. Your input will always be in the form of arg op arg, where op is either + or -, and arg is eit...

0 answers  ·  posted 7mo ago by honnza‭

Question code-golf
75%
+4 −0
Challenges Is it stuck in a counting loop?

Given a list of non-negative integers the function $f$ replaces every integer with the number of identical integers preceding it (not necessarily contiguously). So f [1,1,2,2,1,3,3] = [1,2,1,2,3,1...

1 answer  ·  posted 10mo ago by WheatWizard‭  ·  last activity 7mo ago by isaacg‭

66%
+2 −0
Challenges Can I follow this recipe?

You work in a kitchen which has a peculiar rule. When you mix something into a pot you must always add at least one new ingredient. So you can add pasta, oil, salt then pesto, but not pasta, pesto...

1 answer  ·  posted 7mo ago by WheatWizard‭  ·  last activity 7mo ago by isaacg‭

62%
+3 −1
Challenges Print the modular multiplicative inverse / virtual fractions

Goal Print the modular multiplicative inverse with a modulus of 65536 (or a higher exponent of 2) for odd numbers 1-97. Example output Print these values (or an extension of them): 1 43691 52...

1 answer  ·  posted 9mo ago by H_H‭  ·  last activity 7mo ago by isaacg‭

Question code-golf math
50%
+0 −0
71%
+3 −0
Challenges Plain black webpage

This is a language specific challenge, for HTML only. Your answer is the content of a self contained HTML file, that when opened in a web browser gives a plain black page. Requirements The HTM...

4 answers  ·  posted 9mo ago by trichoplax‭  ·  last activity 9mo ago by Razetime‭

66%
+2 −0
Challenges Borromean coprimes

Given 3 positive integers, indicate whether they are Borromean coprimes. Definition 3 positive integers are called Borromean coprimes if both of the following are true: Their greatest common d...

2 answers  ·  posted 1y ago by trichoplax‭  ·  last activity 11mo ago by NikNakk‭

Question code-golf math
60%
+1 −0
Challenges Shortest representation in generalised Roman numerals

Find the shortest representation of an integer in generalised Roman numerals. Since there is more than one way to generalise, only the following definition applies to this challenge. Definition T...

1 answer  ·  posted 12mo ago by trichoplax‭  ·  last activity 11mo ago by NikNakk‭

Question code-golf number
71%
+3 −0
Challenges How many umbrellas to cover the beach?

You work at a beach. In the afternoon, the sun gets quite hot and beachgoers want to be shaded. So you put out umbrellas. When you put out umbrellas you want to shade the entire beach, with as few ...

2 answers  ·  posted 12mo ago by WheatWizard‭  ·  last activity 11mo ago by justhalf‭

Question code-golf array
66%
+2 −0
Challenges Is it part of the mandelbrot set?

Input is a number, you have to decide if it is part of the mandelbrot set or not, after at least 16 iterations. This is done by applying this formula: $z_n = z_{n-1}^2 + c$ repeatedly. $c$ is the ...

1 answer  ·  posted 1y ago by H_H‭  ·  last activity 11mo ago by Arpad Horvath‭

Question code-golf
66%
+2 −0
Challenges Is it a valid hidden word?

The Universal Crossword has a set of guidelines for crossword puzzle submissions. In this challenge we are going to be concerned with their rules for hidden word themes. A hidden word clue consis...

1 answer  ·  posted 12mo ago by WheatWizard‭  ·  last activity 11mo ago by Razetime‭

60%
+1 −0
Sandbox Arbitrary angle wrapping wordsearch

posted 2y ago by trichoplax‭  ·  edited 12mo ago by trichoplax‭

50%
+0 −0