Linked Questions

-1
votes
1answer
129 views

BF Last binary digit [duplicate]

Task Your task is to write as short as possible program preferably in Brainf**k which determines the last digit of given number after it's conversion from decimal to binary system. Input An integer ...
419
votes
756answers
126k 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 ...
204
votes
331answers
44k views

Golf you a quine for great good!

Using your language of choice, golf a quine. A quine is a non-empty computer program which takes no input and produces a copy of its own source code as its only output. No cheating -- that means ...
121
votes
477answers
36k 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 ...
195
votes
289answers
45k 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 ...
280
votes
141answers
470k views

I need a program where the user inputs an array of doubles and the program outputs the array sorted

Note: This question was severely edited since I first posted it here. The rules were moved to here, read them before posting any answer to understand the purpose of this. This was the first question ...
377
votes
36answers
66k views

American Gothic in the palette of Mona Lisa: Rearrange the pixels

You are given two true color images, the Source and the Palette. They do not necessarily have the same dimensions but it is guaranteed that their areas are the same, i.e. they have the same number of ...
44
votes
188answers
12k views

Add two numbers

Input: Two integers. Preferably decimal integers, but other forms of numbers can be used. These can be given to the code in standard input, as arguments to the program or function, or as a list. ...
138
votes
50answers
24k 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 ...
86
votes
38answers
20k views

Tips for golfing in Java

Are there any useful shortcuts that can be used in Java? As shown below, import already adds at least 17 characters to a program. ...
32
votes
74answers
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 ...
85
votes
15answers
8k 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 ...
36
votes
26answers
5k views

Oddly Even, Positively Negative

Given N, output the Nth term of this infinite sequence: -1 2 -2 1 -3 4 -4 3 -5 6 -6 5 -7 8 -8 7 -9 10 -10 9 -11 12 -12 11 ... etc. N may be 0-indexed or 1-...
19
votes
40answers
4k views

Make me a s'more!

Make me a s'more! I tell you the width, the amount of graham cracker, the amount of chocolate, and the amount of marshmallow. An example: Input: Width: 10 Graham: ...
26
votes
38answers
2k views

Minus, Plus, Times, Exponentiation?

This is a CMC (chat mini challenge) that I posted in our chatroom, The Ninteenth Byte, a bit ago. The Challenge Given a positive integer x, depending on the last ...

15 30 50 per page