Linked Questions
27 questions linked to/from Implement a Truth-Machine
515
votes
970
answers
189k
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
241
answers
134k
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 ...
234
votes
366
answers
65k
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 ...
144
votes
566
answers
46k
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 ...
145
votes
333
answers
31k
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 ...
110
votes
328
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 named after ...
111
votes
286
answers
18k
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 ...
128
votes
201
answers
34k
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
97
answers
67k
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 ...
86
votes
221
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 ...
138
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:
...
36
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.
...
96
votes
15
answers
11k
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:
...