Linked Questions

42
votes
5answers
2k views

My god, it's full of spaces!

Some people insist on using spaces for tabulation and indentation. For tabulation, that's indisputably wrong. By definition, tabulators must be used for tabulation. Even for indentation, tabulators ...
40
votes
18answers
10k views

Duck, duck, gone!

Here is the (quite scary) Five little ducks song(it is not long): ...
39
votes
24answers
4k views

How many lights are on?

You are little speck on a Cartesian plane. Pondering your existence, you decide to roam around your plane and touch things. You notice that every coordinate pair you visit has a light switch. To ...
39
votes
43answers
4k 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. ...
39
votes
31answers
3k views

Print a booklet

Reading a book is easy, but printing a book can be a bit tricky. When printing a booklet, the printer needs to have the pages arranged in a certain manner in order to be read from left to right. The ...
39
votes
21answers
1k views

Array alignment addition

Introduction Consider two non-empty integer arrays, say A = [0 3 2 2 8 4] and B = [7 8 7 2]. To perform alignment addition on them, we do the following: Repeat each array enough times to have total ...
38
votes
96answers
14k views

Is this number evil?

Introduction In number theory, a number is considered evil if there are an even number of 1's in its binary representation. In today's challenge, you will be identifying whether or not a given number ...
38
votes
14answers
2k views

Backspace-and-retype a list of words

Here’s how to backspace-and-retype from one string to another: Start from the first string. Remove characters at the end until the result is a prefix of the second string. (This may take 0 steps.) ...
37
votes
88answers
6k views

Print all alphanumeric characters plus underscore

Write a program or function that prints or returns a string of the alphanumeric characters plus underscore, in any order. To be precise, the following characters need to be output, and no more: ...
36
votes
18answers
5k views

Automate your first grade counting exercise

CodeGolf Challenge PWSSHHHH! You wake up in a cryogenics lab in the year 3000. Upon being escorted to the assignment office to receive your career chip, presumably that of a delivery boy, a probe ...
36
votes
21answers
3k views

Leaping Kangaroos

Backstory Disclaimer: May contain made up information about kangaroos. Kangaroos traverse several stages of development. As they grow older and stronger, they can jump higher and longer, and they ...
36
votes
10answers
4k views

Tell me how many math problems I have to do!

My teacher always gives me the most complicated set of math problems for homework. Like: pg. 546: 17-19, 22, 26, pg. 548: 35-67 odd, 79, 80-86 even. And I want to ...
35
votes
78answers
7k views

Notcalc (Calculate the wrong answer)

Goal: Given two natural numbers (integers from 0 to infinity), output a number that is not the sum of those numbers, but is a natural number. Example solutions (TI-Basic): ...
35
votes
15answers
7k views

Generate Brainfuck for the numbers 1–255

Write a program that, for the numbers 1 through 255, prints out BF code that will produce the given number in some byte of the array, plus a newline. For example, the first four lines of the output ...
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 ...

15 30 50 per page
1 2 3
4
5
16