# All Questions

14,049 questions
Filter by
Sorted by
Tagged with
4 votes
2 answers
70 views

### Tips for golfing in $\it{Acc!!}$

What general tips do you have for golfing in Acc!!? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to Acc!! (e.g. "remove comments&...
622 votes
332 answers
240k views

### Produce the number 2014 without any numbers in your source code

Note to challenge writers as per meta consensus: This question was well-received when it was posted, but challenges like this, asking answerers to Do X without using Y are likely to be poorly received....
11 votes
9 answers
506 views

### Play a sequential game of Rock Paper Scissors

The "sequential" game A number of people stand in a line with their hands hidden in a pre-chosen state of either Rock ✊, Paper ✋ or Scissors ✌️. Here's an example line: Initial Line ✌️ ✋ ✊ ...
517 votes
978 answers
192k views

### "Hello, World!"

So... uh... this is a bit embarrassing. But we don't have a plain "Hello, World!" challenge yet (despite having 35 variants tagged with hello-world, and counting). While this is not the most ...
28 votes
27 answers
4k views

### Implement the divisibility-by-7 rule

To check whether a decimal number is divisible by 7: Erase the last digit. Multiply it by 2 and subtract from what is left. If the result is divisible by 7, the original number is divisible by 7. (...
14 votes
4 answers
2k views

### Print all legal chess moves

The game of chess has moves. Lots of moves. But how many, exactly? In this challenge, you must print all possible chess moves for a single player (black or white — you choose). Moves are distinguished ...
54 votes
85 answers
8k views

### Output Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo

Challenge The goal is to output Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo. Context. (Maybe another interesting challenge could be printing all ...
17 votes
21 answers
2k views

### Last Week Day Of The Month

Introduction This challenge was inspired by a seemingly simple task requested at work that couldn't easily be done in Microsoft Teams. At least not from what we could find! Task Your task, if you ...
47 votes
79 answers
10k views

### Is it a leap year?

This challenge is quite simple. You will take an input which will be a year from 1801 to 2400, and output if it is a leap year or not. Your input will have no newlines or trailing spaces: ...
7 votes
14 answers
3k views

### Output ISO8601 date string from seconds and nanoseconds

One reason why ISO8601 is the best date string format, is that you can simply append as much precision as you like. Given 2 integers representing seconds and nanoseconds that have passed since ...
49 votes
46 answers
9k views

### The Ackermann function

The Ackermann function is notable for being the one of the simplest examples of a total, computable function that isn't primitive recursive. We will use the definition of $A(m,n)$ taking in two ...
15 votes
11 answers
974 views

### Which Advent is it?

I know, a bit late. Challenge Your challenge is, given a date, output if it's not an Advent Sunday, or the Advent Sunday of the year. Rules The $4^\text{th}$ Advent is determined by the Sunday ...
10 votes
23 answers
2k views

### Argument of a complex number (Cops)

This is the cop's thread, where one should post the scrambled code. Here is the robbers' thread where the cracked source should be posted and linked to the cop's answer. NB: I am currently writing up ...
14 votes
7 answers
579 views

### Implement OADD_MONTHS

Introduction A function that adds months to a date (without overflowing ends of months) is implemented in many languages/packages. In Teradata SQL it's ADD_MONTHS, here are some examples: ...
42 votes
17 answers
3k views
+300

### {Curly Numbers};

In the esoteric programming language Curly, programs consist solely of curly braces {} and semicolons ;. Despite this humble ...
13 votes
22 answers
1k views

### Percentage of work days in a month

Given a year and a month, find out the percentage of work days in said month. Work days are Monday through Friday with no regard to holidays or other special things. The Gregorian calendar is used. ...
24 votes
26 answers
2k views

### Tips for golfing in sed

What general tips do you have for golfing in sed? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to sed (e.g. "remove comments" is not ...
18 votes
56 answers
2k views

### Fixed Repeating Output

Fixed Repeating Output is a challenge originally invented by Esolang user AnotherUser05 which shows that a language supports loops and I/O. Challenge A program that solves the challenge has to do ...
2 votes
1 answer
112 views

### Determine the optimal blackjack move

After the success of my baccarat challenge, I figured we should try a similar challenge for another casino game, blackjack. Blackjack is a game played with two to eight decks of cards shuffled ...
37 votes
32 answers
7k views

### Draw an ASCII Lightning Bolt

Introduction Partly inspired by this StackOverflow question, let's draw an ASCII Lightning Bolt. Write a program that takes a positive Integer n via STDIN or ...
37 votes
18 answers
12k views

### Find the nth decimal of pi

There are already 30 challenges dedicated to pi but not a single one asks you to find the nth decimal, so... Challenge For any integer in the range of ...
33 votes
76 answers
4k views

### Number to Binary

It seems we've managed to go all this time without a plain vanilla Number-To-Binary challenge! Whilst this will inevitably be only one element in many languages, it should put a few esolangs through ...
17 votes
14 answers
3k views

### BigNum Bakeoff Reboot

Some of you may be familiar with the BigNum Bakeoff, which ended up quite interestingly. The goal can more or less be summarized as writing a C program who's output would be the largest, under some ...
34 votes
59 answers
5k views

### Sum every second digit in a number

I have a number like this: n = 548915381 The output should be the sum of every second digit of that number. In this case 26: ...
26 votes
41 answers
2k views

### Create a Pride Flag

Challenge Create the image of a pride flag (rainbow flag), i.e. a six coloured striped flag (from top to bottom): red, orange, yellow, green, blue, and violet. Output Example (R) ...
14 votes
14 answers
2k views

### Break an integer into even- and odd-indexed bits

Objective Given an integer $n$ interpreted as two's complement binary, output two integers, namely the integer consisting of $n$'s bits at places of $2^0, 2^2, 2^4, \cdots$, and the integer ...
9 votes
8 answers
836 views

### Produce an image based on an elementary cellular automata ruleset

What is elementary cellular automata? Since I'm not sure I'll be able to explain this so that somebody who has never heard of this is able to understand, I'm giving an explanation from https://...
11 votes
20 answers
1k views

### Hexadecimal to Binary

Convert a hexadecimal number (of any size) into a binary number. Input A POSITIVE hexadecimal number with a 0x in the beginning. A valid input will always match the ...
37 votes
30 answers
6k views

### Find the number in the Champernowne constant

Introduction In base 10, the Champernowne constant is defined by concatenating representations of successive integers. In base 10: 0.1234567891011121314151617... ...
38 votes
116 answers
6k views

### Alphabet Staircase

The Challenge Your task is to create a program or function that outputs the following with no input: ...
34 votes
44 answers
4k views

### Find a multiple of a given number whose decimal representation looks like binary

I have come across a question on the Code Review site that seems interesting. I think OP is doing it wrong, but cannot be sure... So let's solve it for him! (write a program, not a function/procedure) ...
21 votes
22 answers
1k views

### Adding two numbers in Tally marks

Given two positive integers, add them. Both inputs and output are in Tally marks form, which can be expressed as:  T(n) := \begin{cases} n,&& n\le 5\\ 5 || T(n-5),&& n>5 \end{...
19 votes
26 answers
3k views

### Crossing a Lily Pond

The Narrative You are a frog who is at the edge of a pond with waterlilies. You would like to cross the pond without getting wet, so you plan to jump from lily to lily. There is, however, one problem: ...
19 votes
27 answers
4k views

### Make me a scrolling marquee

Introduction Remember the roaring 80's? I mean, you know, like 30 years ago? No cell phones, no internet, no ATM's, fluorescent clothing (what was that?!) and scrolling marqee's! No, no, no! Not the ...
15 votes
23 answers
5k views

### FizzFizzFizzBuzz!

Given a positive integer n, output the "FizzFizzFizzBuzz" sequence for that number: print the decimal representations of the numbers 1 through ...
9 votes
1 answer
1k views

### Flip a coin in Lost

Lost is a 2-D programming language where the start position and direction of the ip are entirely random. Today we will be writing a Lost program which uses this randomness to simulate a coin flip. A ...
93 votes
244 answers
19k views

### "DDoouubbllee ssppeeaakk!!"

Super simple challenge today, or is it? I feel like we've heard a fair bit about double speak recently, well let's define it in a codable way... Double speak is when each and every character in a ...
13 votes
40 answers
3k views

### Convert binary to unary

The title says it all; Given a number in the binary (base-2) number system, output the same number expressed in unary (base-1). You should take the binary number as a string (optionally with a ...
13 votes
2 answers
983 views

### Make a Lost Compass

Lost is a 2-Dimensional programming language where the instruction pointer starts at a random location, moving in a random direction. A description of the language can be found at the bottom of the ...
50 votes
45 answers
5k views

### Fake Marquee Text

In this challenge fake marquee text is text that is shown part by part, in a scrolling-like fashion. Some examples: ...
74 votes
75 answers
10k views

### This is my pillow

...will you help me immortalize it? I've had this pillow a few years now, and apparently it's time to get rid of it. Can you please write a function or program, that I can bring with me and use to ...
38 votes
145 answers
9k views

### Count up folks!

Introduction It may sound strange, but we haven't got ONE challenge for counting from 1 to n, inclusive. This is not the same ...
27 votes
71 answers
6k views

### 1, 2, miss a few, 99, 100

When I was a kid, there was a "really cool" shortcut to count to 100: 1, 2, miss a few, 99, 100 Output the exact string above, in the fewest characters ...
87 votes
84 answers
15k views

### Draw the Ukrainian Flag

As you probably know, there is a war going on in Ukraine. I noticed that it seems nobody has posted a Ukrainian flag challenge yet, so I thought I'd do it myself in support of Ukraine. The Challenge ...
58 votes
21 answers
4k views

### Fill in the Minesweeper clues

Minesweeper is a popular puzzle game where you must discover which tiles are "mines" without clicking on those tiles. Each tile is either a mine (represented by *) ...
9 votes
12 answers
1k views

### How many Carlitz compositions are there?

OEIS sequence A003242 comprises the numbers of Carlitz compositions for any given positive integer. This is the number of integer partitions of the integer for which no two adjacent parts are equal. ...
16 votes
17 answers
1k views

### Maximum number of trailing zeros

Input Positive integers a and b defining an interval of integers [a .. b]. Output The maximum number of trailing zeros in the binary expansion of any integer in the interval [a .. b]. Examples Input: [...
0 votes
5 answers
225 views

### Pretty printing JSON

I want format a JSON string into human-readable form. A string like this: ...
20 votes
20 answers
1k views

### Sum of Binary Substrings

This challenge is simple, given a decimal number, convert to binary, and calculate the sum of the sub-strings of the binary number, whose length is shorter than the original number. Here is an example:...
55 votes
10 answers
12k views

### Golf a number bigger than TREE(3)

The function TREE(k) gives the length of the longest sequence of trees T1, T2, ... where each vertex is labelled with one of k colours, the tree Ti has at most i vertices, and no tree is a minor of ...

15 30 50 per page