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.

75%
+4 −0
Challenges When The Ternary Is Balance

Inspired by this Rosetta Code article. Introduction Balanced Ternary is a method of representing integers using -1, 0 and 1 in base 3. Decimal 11 = (1 * 32) + (1 * 31) + (−1 * 30) = [1,1,-1] or ...

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

Question code-golf number base
50%
+0 −0
Q&A Tips in golfing using Lua

Lua's not really used much in golfing, so it'd be pretty cool to learn some golfing tricks when making answers using it. What golfing tips are there for Lua?

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

Question code-golf tips
50%
+0 −0
71%
+3 −0
Challenges My house is destroyed! Can you make me one?

Background A House of I I went on an adventure Grabbed resources and making deeds Like start to work on the materials To build the shelter I need It was a marvelous one At least in the eyes ...

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

Question code-golf string
71%
+3 −0
Sandbox Balance my ternary[FINALIZED]

posted 2y ago by Razetime‭  ·  edited 2y ago by Razetime‭

60%
+1 −0
Sandbox Generalized Sort

posted 2y ago by Moshi‭  ·  edited 2y ago by Moshi‭

81%
+7 −0
Challenges In The Jailhouse Now

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 ╔╦╗ ╠╬╣ ...

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

Question code-golf ascii-art
75%
+4 −0
Challenges 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‭

Question code-golf ascii-art
71%
+3 −0
Challenges Multiply two strings

Given two strings, I define their product as follows: If any of the two strings is empty, the product is the empty string. If the second string consists of a single character, the result ...

6 answers  ·  posted 2y ago by celtschk‭  ·  last activity 2y ago by Hakerh400‭

Question code-golf string
75%
+4 −0
Sandbox Compute the determinant

posted 2y ago by Moshi‭  ·  edited 2y ago by Moshi‭

Article code-golf math
75%
+4 −0
Challenges 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‭

80%
+6 −0
Challenges 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‭

28%
+0 −3
77%
+5 −0
Challenges 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‭

Question code-golf sequence
50%
+0 −0
Sandbox Recreate modulo [cancelled]

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

Article code-golf math
66%
+2 −0
Q&A How to add lots of command line arguments to https://tio.run?

I have a question about everyone's favourite Code Golf editor https://tio.run. After picking a language, is there a sensible way to enter command line arguments to it, other than adding them manual...

0 answers  ·  posted 2y ago by Lundin‭  ·  edited 2y ago by Lundin‭

60%
+1 −0
Challenges A chunk of symbols is a calculation

Challenge Create a program that takes input of a string and outputs an integer using the following calculation system: The string can only contain +, -, *, /, ^, ! (or a different character; ! ...

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

80%
+6 −0
Challenges 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‭

Question code-golf string
71%
+3 −0
Challenges 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‭

Question code-golf
75%
+4 −0
Challenges 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‭

77%
+5 −0
Q&A Befunge Golfing Tips

Post tips for Befunge code golf here! This is based on a type of question I used to see on CGCC, where people would post tips for golfing in various languages. They happened to be quite helpful, s...

3 answers  ·  posted 3y ago by moony‭  ·  edited 2y ago by user‭

Question code-golf tips
71%
+3 −0
Challenges 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‭

Question code-golf
80%
+6 −0
Challenges 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‭

66%
+2 −0
Challenges 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
Challenges 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‭

Question code-golf ascii-art
77%
+5 −0
Challenges 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‭

40%
+0 −1
Sandbox Set in sets in sets [cancelled]

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

77%
+5 −0
Challenges 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‭

84%
+9 −0
Challenges 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‭

60%
+1 −0
77%
+5 −0
Challenges 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 2y ago by AndrewTheCodegolfer‭  ·  last activity 2y ago by Shaggy‭

71%
+3 −0
Sandbox Obligatory factorial challenge

posted 2y ago by user‭  ·  edited 2y ago by user‭

60%
+1 −0
Q&A Tips for golfing in Scala

What general tips do you have for golfing in Scala? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Scala (e.g. "remove comments" i...

1 answer  ·  posted 3y ago by user‭  ·  edited 2y ago by user‭

Question code-golf tips
81%
+7 −0
Challenges 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‭

Question code-golf
77%
+5 −0
Challenges 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 2y ago by Razetime‭  ·  last activity 2y ago by user‭

66%
+2 −0
Sandbox Gamer Meme Creator[FINALIZED]

posted 2y ago by Razetime‭  ·  edited 2y ago by Razetime‭

77%
+5 −0
Challenges 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‭

Question code-golf math
60%
+1 −0
Challenges 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‭

77%
+5 −0
Challenges 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‭

Question code-golf sudoku
60%
+1 −0
Sandbox FizzBuzz based on line count

posted 3y ago by Lundin‭  ·  edited 3y ago by Lundin‭

Article code-golf
81%
+7 −0
Challenges 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‭

Question code-golf
77%
+5 −0
Challenges 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‭

Question code-golf boolean
87%
+12 −0
Challenges 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 3y ago by Sisyphus‭  ·  last activity 3y ago by Marshall Lochbaum‭

71%
+3 −0
Challenges 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‭

Question code-golf math
71%
+3 −0
Sandbox Draw a line over ASCII

posted 3y ago by dzaima‭  ·  edited 3y ago by dzaima‭