Linked Questions
27 questions linked to/from Implement a Truth-Machine
523
votes
1k
answers
198k
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 ...
550
votes
243
answers
137k
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 not ...
237
votes
372
answers
66k
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 ...
145
votes
581
answers
47k
views
Shortest infinite loop producing no output
Your task is to create the shortest infinite loop!
The point of this challenge is to create an infinite loop producing no output, unlike its possible duplicate. The reason to this is because the code ...
146
votes
339
answers
32k
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 ...
112
votes
336
answers
22k
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 ...
112
votes
288
answers
19k
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 ...
131
votes
211
answers
35k
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 ...
173
votes
98
answers
70k
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 ...
88
votes
232
answers
16k
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
29
answers
12k
views
Making Future Posts Runnable Online with Stack Snippets [closed]
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:
...
37
votes
73
answers
9k
views
Randomizing until 0
Challenge
Sandbox post
Given a positive integer (K) Output a uniformly-random integer (Y) between ...
32
votes
57
answers
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.
...
99
votes
15
answers
12k
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 ...
28
votes
41
answers
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:
...