Linked Questions

432
votes
774answers
134k 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 ...
510
votes
230answers
115k views

Showcase of Languages

Notes This thread is open and unlocked only because the community decided to make an exception. Please do not use this question as evidence that you can ask similar questions here. Please do ...
202
votes
298answers
47k views

Is this number a prime?

Believe it or not, we do not yet have a code golf challenge for a simple primality test. While it may not be the most interesting challenge, particularly for "usual" languages, it can be nontrivial in ...
124
votes
275answers
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 ...
99
votes
236answers
15k views

Output with the same length as the code

In this challenge, you should write a program or function which takes no input and prints or returns a string with the same number of bytes as the program itself. There are a few rules: You may only ...
86
votes
268answers
17k 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
185answers
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 ...
71
votes
190answers
13k views

Count up forever

Write a program that counts up forever, starting from one. Rules: Your program must log to STDOUT or an acceptable alternative, if ...
137
votes
80answers
42k views

Tips for golfing in JavaScript

What general tips do you have for golfing in JavaScript? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to JavaScript (e.g. "remove ...
135
votes
28answers
11k views

Making Future Posts Runnable Online with Stack Snippets

Stack Snippets were recently added to PPCG! Reminiscent of JSFiddle, Stack Snippets allow HTML, CSS, and JavaScript to be run directly in posts! Here is a very simple Stack Snippet: ...
29
votes
69answers
8k views

Randomizing until 0

Challenge Sandbox post Given a positive integer (K) Output a uniformly-random integer (Y) between ...
90
votes
16answers
9k views

Create a programming language that only appears to be unusable

Robbers' challenge thread is here. Cops' challenge: Design a programming language that appears to be unusable for programming, but admits computation (or at least completion of the task) through some ...
26
votes
50answers
6k views

Internal Truth Machine

It's a normal truth machine but instead of taking input, it uses the first character of the program. Thus, internal. The 0 and 1 are plain characters, i.e. ASCII code 0x30 and 0x31 respectively. ...
24
votes
36answers
4k views

Swap, delete and repeat

Introduction Let's observe the following string: ABCDEFGHIJKLMNOP If we swap the ends of the string, which are these: ...
16
votes
32answers
1k views

Maximizing output from minimal input

Obviously, code golfing is all about making the most of the least code. Who really cares what the actual output is? While we have had a challenge for highest input-to-output ratio, this is a call for ...

15 30 50 per page