Linked Questions

31
votes
76answers
4k views

Sum the numbers on standard in

Consider a stream/file with one integer per line. For example: 123 5 99 Your code should output the sum of these numbers, that is ...
54
votes
50answers
7k views

Convert YYYYMM to MMMYY

Basing on this SO question. Challenge is rather simple: given a date period in the format YYYYMM output it in the format MMMYY. ...
29
votes
88answers
4k views

Generate alphabet with 4 copies of each letter

Note that this is not the same as Print the alphabet four times. This task is to write a program to generate four copies of each letter of the English alphabet, one letter per line, on standard ...
46
votes
43answers
5k views

Tips for golfing in PowerShell

What general tips do you have for golfing in Windows PowerShell? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to PowerShell (e.g. "...
51
votes
43answers
6k views

Coprimes up to N

Given a number n >= 2, output all the positive integers less than n where gcd(n, k) == 1 (...
68
votes
27answers
13k views

418: I'm a teapot

As we all should know, there's a HTTP status code 418: I'm a teapot. Your mission, should you choose to accept it, is to use your creativitea and write the smallest possible server that responds with ...
26
votes
81answers
4k views

Is it a whole number?

A number is whole if it is a non-negative integer with no decimal part. So 0 and 8 and ...
29
votes
69answers
8k views

Randomizing until 0

Challenge Sandbox post Given a positive integer (K) Output a uniformly-random integer (Y) between ...
34
votes
56answers
6k views

Capitalize first letter of each word of input

This is a relatively quick one, but I'm sure you'll like it. Codegolf a program that will take input in the form of a sentence and then provide the output with the first letter capitalized in each ...
73
votes
17answers
17k views

Draw the ☣ (Biohazard Symbol)

Draw the Biohazard symbol in an arbitrary colour on a distinctly coloured background. The specific proportions were published in the June 27th 1974 issue of the Federal Register of the US Government. ...
53
votes
27answers
14k 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 ...
70
votes
23answers
7k views

Well that's odd… no wait, that's even!

Preamble Integers are always either even or odd. Even integers are divisible by two, odd integers are not. When you add two integers you can infer whether the result will be even or odd based on ...
57
votes
29answers
23k views

Cheat at Rock-Paper-Scissors-Lizard-Spock

When playing Rock-Paper-Scissors-Lizard-Spock, your robot reflexes let you see your opponent's throw before they make it. You just need to choose a throw that beats theirs, in as few bytes as possible ...
39
votes
43answers
5k views

Find the needle in the haystack

Given a rectangular haystack of size at least 2x2 composed of all the same printable ASCII characters, output the location (counting from the top-left) of the needle which is a different character. ...
36
votes
44answers
2k views

Twisting Words!

Twisting Words! Given a string and a positive integer. You must twist the string, back and forth. Example Input / Output Input ...

15 30 50 per page
1 2
3
4 5
17