Linked Questions

148
votes
263answers
39k 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 ...
227
votes
114answers
32k views

Without using numbers, get the highest salary you can. But don't exaggerate!

As I'm applying for some jobs whose job advert doesn't state the salary, I imagined a particularly evil interviewer that would give the candidate the possibility to decide their own salary ...by "...
69
votes
170answers
18k views

The Letter A without A

Your task is to display the letter "A" alone, without anything else, except any form of trailing newlines if you cannot avoid them, doing so in a program and/or snippet. Code that returns (instead of ...
66
votes
152answers
9k views

Diagonal Alphabet

Given no input, your task is to generate the following: ...
103
votes
67answers
25k views

I'm a palindrome. Are you?

There have been a couple of previous attempts to ask this question, but neither conforms to modern standards on this site. Per discussion on Meta, I'm reposting it in a way that allows for fair ...
62
votes
50answers
14k views

Tips for code-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 ...
44
votes
97answers
6k views

Concatenating n with n + 1

Introduction OEIS sequence A127421 is the sequence of numbers whose decimal expansion is a concatenation of 2 consecutive increasing non-negative numbers. Put simply, every number in the sequence is ...
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 ...
47
votes
46answers
15k views

99 bugs in the code

99 bugs in the code The adaption of "99 bottles of beer on the wall" for computer science where the bugs increase instead of the bottles decreasing is often re-posted around the internet. Example T-...
47
votes
37answers
10k views

Facey McFaceface

Anyone remember Boaty? You could totally make any old word, right? Write a function to turn a string into Somethingy McSomethingface. It should accept one string as input. Ignore the case of the ...
55
votes
20answers
8k views

Exit Code Golfing

Inspired by this default for IO. The Task Write a program that, given an input integer x between 0 and 255, crashes with exit code ...
48
votes
25answers
12k 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 ...
47
votes
18answers
9k views

Tips for golfing in Perl?

What general tips do you have for golfing in Perl? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Perl (e.g. "remove comments" is not ...
26
votes
34answers
3k views

Euro coins and notes

As the majority of nations using the Euro have the , as the decimal separator, you must use it also. The task is to output all the values of the Euro coins and ...
6
votes
65answers
5k views

Get the century of a year

Your program has to have an year like 1957 to be the input and then output the century of that year. For example: ...

15 30 50 per page