Linked Questions

330 votes
179 answers
142k views

Tips for golfing in Python

What general tips do you have for golfing in Python? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to Python (e.g. "remove comments" is ...
moinudin's user avatar
  • 12.7k
112 votes
330 answers
22k 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 named after ...
Martin Ender's user avatar
54 votes
202 answers
14k views

Scream very loudly

Write a script that outputs A to stdout infinitely. There should be no newlines or separators between the characters. Standard loopholes apply. This is code-golf. ...
Tornado547's user avatar
  • 1,133
67 votes
103 answers
17k views

Dad jokes are fun

We all know the classic dad joke that goes something like this: Somebody says a sentence to describe their self (e.g. I'm tired or ...
moltarze's user avatar
  • 2,570
55 votes
102 answers
11k views

Is it double speak?

In an earlier challenge I asked code golfers to produce strings which copy each character in a string. For example: TThhiiss iiss ddoouubbllee ssppeeaakk!! This ...
AJFaraday's user avatar
  • 11.8k
33 votes
83 answers
6k views

Repeat every other character in string starting with second character

Requirements: Take a single word as input with only lowercase alphabetical characters (a-z) Output a string where every other character is repeated, with the first repeated character being the second ...
Taako's user avatar
  • 569
47 votes
44 answers
19k views

Draw A Sierpinski Triangle

The Sierpinsky Triangle is a fractal created by taking a triangle, decreasing the height and width by 1/2, creating 3 copies of the resulting triangle, and place them such each triangle touches the ...
Kibbee's user avatar
  • 959
39 votes
40 answers
5k views

Stretching Words

Write a program or function that duplicates letters in a word, so that all the duplicated letters arranged from left to right in the word would form the input array. For example: ...
Stretch Maniac's user avatar
49 votes
19 answers
3k views

Tips for golfing in The Shakespeare Programming Language

What general tips do you have for golfing in The Shakespeare Programming Language? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to SPL ...
xenia's user avatar
  • 8,122
23 votes
39 answers
3k views

Palindromic palindrome generator

Create a program, that converts input string to a palindrome starting with the input string. The program itself must be a palindrome. For example input: neverod, ...
tmp's user avatar
  • 481
22 votes
26 answers
3k views

Can I join the music box?

The magic music box (MMB) This explains the motivation for the challenge, feel free to ignore. The magic music box is a word game played by a group of people, where one is the owner of the magic ...
RGS's user avatar
  • 14.1k
18 votes
39 answers
4k views

Stripping off extra spaces from a string

You are given a string. Output the string with one space per words. Challenge Input will be a string (not null or empty), surrounded with quotes(...
Spikatrix's user avatar
  • 1,875
28 votes
16 answers
3k views

Tips for golfing in Scala

What general tips do you have for golfing in Scala? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Scala (e.g. "remove comments" is ...
user unknown's user avatar
  • 4,591
15 votes
40 answers
14k views

Hexadecimal Counter

Hexadecimal is a base 16 counting system that goes from 0 to f. Your job is to make a counter that will display these numbers. ...
jado's user avatar
  • 2,682
27 votes
21 answers
5k views

It almost works (Cops' Thread)

Robbers' Thread Your challenge is to find an existing challenge, and implement it in a way such that certain inputs fail. At least one input must not produce the correct output (use the other ...
emanresu A's user avatar
  • 37.8k

15 30 50 per page