Linked Questions

121
votes
269answers
26k views

Shortest code to produce infinite output

Write the shortest code you can that produces an infinite output. That's all. You code will only be disqualified if it stops producing output at some point. As always in code golf, the shortest code ...
221
votes
106answers
39k views

Print every character your program doesn't have

Your task is to build a program (using only printable ASCII characters and/or tabs and newlines) that prints out exactly the characters in the printable ASCII space (...
84
votes
263answers
16k views

Simple cat program

One of the most common standard tasks (especially when showcasing esoteric programming languages) is to implement a "cat program": read all of STDIN and print it to STDOUT. While this is named after ...
119
votes
181answers
30k views

Sing Happy Birthday to your favourite programming language

Your favourite programming language has just had a birthday. Be nice and sing it the Happy Birthday song. Of course you should accomplish this by writing a program in that language. The program takes ...
372
votes
36answers
52k views

Covfefify a string

In this challenge, you must take a string matching the regex ^[a-zA-Z]+$ or whatever is reasonable (you don't have to consider uppercase or lowercase letters if you ...
60
votes
210answers
8k views

The Mystery String Printer (Cops)

The robbers thread can be found here: The Mystery String Printer (Robbers) Your challenge Write a program, function, or REPL script that prints a string to STDOUT. The robbers will try to create a ...
106
votes
93answers
16k views

Loading… Forever

Your challenge is to make an infinite loading screen, that looks like this: Or, to be more specific: Take no input. Output Loading..., with a trailing space, but ...
77
votes
97answers
10k views

N(e(s(t))) a string

To "function nest" a string, you must: Treat the first character as a function, and the following characters as the arguments to that function. For example, if the input string was ...
59
votes
118answers
14k views

Duck, duck, goose!

Remember the kids game, 'Duck, Duck, Goose'? No? Me neither. The challenge Print the word 'duck' on individual lines an indeterminate amount of times. Print the word 'goose'. Your program ends. The ...
85
votes
75answers
22k views

It took me a lot of time to make this, pls like. (YouTube Comments #1)

Hold up..... this isn't trolling. Background These days on YouTube, comment sections are littered with such patterns: ...
44
votes
128answers
5k views

Full Width Text

Full width text is text that has a space after every character, including the last one. For instance, the first sentence of this question becomes: ...
65
votes
74answers
10k views

Make the Mexican Wave

In as few bytes as possible, write a program or function that outputs the following: ...
81
votes
35answers
8k views

Tips for golfing in <all languages>

The aim of this post is to gather all the golfing tips that can be easily applied to <all languages> rather than a specific one. Only post answers that its ...
56
votes
80answers
11k views

Play the “bzzt” game

Winner: Aditsu's CJam answer! A whopping 25 bytes! Nice! You may continue to submit your answer, however you can no longer win. Original post kept for posterity: The "Bzzt" game is a game where you ...
48
votes
88answers
7k views

Alphabet triangle

You are to print this exact text: ...
70
votes
50answers
7k views

Score rock-paper-scissors

Given two string inputs of "Rock", "Paper", or "Scissors", determine the outcome of the RPS round. Output 1 if the first player wins, -1 if the second player wins, or 0 for a tie. ...
50
votes
65answers
18k views

Helloellolloloo Worldorldrldldd

Make a program that takes the word you input, and adds that word to the back of itself minus its first letter, then repeats until all letters are gone. For example, ...
44
votes
67answers
13k views

Hack into a Lottery

You've recently made an account on a dodgy gambling site, where for a fee of 25 dollars, they will pay you back a random amount between 0 and 50 dollars. After getting around 5 dollars twice, you ...
42
votes
85answers
5k views

StringgnirtSStringgnirtSStringgnirtS

Here is a relatively simple challenge for you. Given a string of length N, output the string forwards, then backwards, then forwards, then backwards... etc. N times. For example, if your input was <...
46
votes
69answers
7k views

Make an Emergency Corridor

In some nations there are recommendations or laws on how to form emergency corridors on streets that have multiple lanes per direction. (In the following we only consider the lanes going in the ...
37
votes
88answers
5k views

Print all alphanumeric characters plus underscore

Write a program or function that prints or returns a string of the alphanumeric characters plus underscore, in any order. To be precise, the following characters need to be output, and no more: ...
34
votes
88answers
14k views

Is this number evil?

Introduction In number theory, a number is considered evil if there are an even number of 1's in its binary representation. In today's challenge, you will be identifying whether or not a given number ...
66
votes
50answers
10k views

My daughter's alphabet

The other day we were writing sentences with my daughter with a fridge magnet letter. While we were able to make some(I love cat), we didn't have enough letters to ...
74
votes
41answers
10k views

Fibonacci + Fizz Buzz = Fibo Nacci!

Fibonacci + FizzBuzz = Fibo Nacci! Your challenge is to create a Fibo Nacci program! A Fibo Nacci program outputs the first 100 Fibonacci numbers (starting from 1). If the Fibonacci number is ...
43
votes
66answers
5k views

Blinking twelve

Many electronic devices, specially old ones, will show a blinking 12:00 when the time has not been set. The purpose of this challenge is to recreate this. ...
33
votes
76answers
7k views

Notcalc (Calculate the wrong answer)

Goal: Given two natural numbers (integers from 0 to infinity), output a number that is not the sum of those numbers, but is a natural number. Example solutions (TI-Basic): ...
55
votes
52answers
10k views

How much code would a codegolf golf if a codegolf could golf code?

Write a function or program that takes two words as input and outputs variants of the popular English tongue-twister "How much wood would a woodchuck chuck if a woodchuck could chuck wood?". The ...
32
votes
74answers
4k views

Sum the numbers on standard in

Consider a stream/file with one integer per line. For example: 123 5 99 Your code should output the sum of these numbers, that is ...
54
votes
49answers
7k views

Convert YYYYMM to MMMYY

Basing on this SO question. Challenge is rather simple: given a date period in the format YYYYMM output it in the format MMMYY. ...
51
votes
43answers
5k views

Coprimes up to N

Given a number n >= 2, output all the positive integers less than n where gcd(n, k) == 1 (...

15 30 50 per page