Linked Questions
88 questions linked to/from Tips for golfing in JavaScript
178
votes
509
answers
40k
views
Implement a Truth-Machine
A truth-machine (credits goes to this guy for coming up with it) is a very simple program designed to demonstrate the I/O and control flow of a language. Here's what a truth-machine does:
Gets a ...
203
votes
439
answers
84k
views
1, 2, Fizz, 4, Buzz
Introduction
In our recent effort to collect catalogues of shortest solutions for standard programming exercises, here is PPCG's first ever vanilla FizzBuzz challenge. If you wish to see other ...
114
votes
341
answers
25k
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 ...
76
votes
180
answers
19k
views
Print 0 to 100 without 1-9 characters
Print integers 0 to 100 (inclusive) without using characters 123456789 in your code.
Separator of numbers can be comma or white space (by default <blank>, <...
168
votes
65
answers
44k
views
Tips for golfing in C
What general tips do you have for golfing in C? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to C (e.g. "remove comments" is not an ...
89
votes
98
answers
21k
views
When does (x == x+2)? [closed]
The challenge: Define x in such a way that the expression (x == x+2) would evaluate to true.
I tagged the question with C, but ...
81
votes
129
answers
11k
views
Make an alphabet searchlight!
Inspired by a bug in a solution to this challenge, your challenge is to produce this exact text:
...
78
votes
96
answers
18k
views
Build me a brick wall!
Challenge
I need help building a brick wall! Throw together some code for me
using no input and produce the following output wall shown below:
...
105
votes
45
answers
14k
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 ...
64
votes
91
answers
14k
views
Implement Minceraft
Introduction
The game Minecraft has a 1 in 10000 chance of showing "Minceraft" instead of "Minecraft" on the title screen.
Your challenge
Your challenge is to code a function or ...
110
votes
44
answers
19k
views
Tips for Golfing in ECMAScript 6 and above
This is similar to other "Tips for golfing in <...>" but specifically targeting the newer features in JavaScript brought up in ECMAScript 6 and above.
JavaScript inherently is a very verbose ...
102
votes
51
answers
9k
views
2048-like array shift
Assume we want to shift an array like it is done in the 2048 game: if we have two equal consecutive elements in array, merge them into twice the value element.
Shift must return a new array, where ...
54
votes
76
answers
19k
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, ...
47
votes
95
answers
11k
views
Binary to decimal converter
Binary to decimal converter
As far as I can see, we don't have a simple binary to decimal conversion challenge.
Write a program or function that takes a positive binary integer and outputs its ...
60
votes
61
answers
7k
views
Count without 3
Background
When I was in elementary school, we used to play a game in math class that goes as follows.
All kids sit in a big circle and take turns counting, starting from 1.
However, the following ...