Linked Questions
37 questions linked to/from Tips for golfing in Perl?
123
votes
419
answers
31k
views
Print a 10 by 10 grid of asterisks
Background
This is a standard textbook example to demonstrate for loops.
This is one of the first programs I learnt when I started learning programming ~10 years ago.
Task
You are to print this exact ...
103
votes
45
answers
13k
views
Tips for golfing in <all languages>
The aim of this post is to gather all the golfing tips that can be easily applied to <all languages> rather than a specific one.
Only post answers that its ...
76
votes
61
answers
16k
views
Hare Krishna Hare Krishna Krishna Krishna Hare Hare
Recently, I've seen Hare Krishna people with their mantra on the emblem and I've found it may be quite interesting to code golf.
The challenge
Write the Hare Krishna mantra, i.e.:
...
58
votes
89
answers
8k
views
Pointers, pointers, pointers!
Introduction
In the error outputs of some languages such as Java, a pointer is shown to give the programmer an idea of exactly where the error went wrong.
Take this example on Ideone:
...
108
votes
40
answers
12k
views
A simple TCP server
Write a program or function that listens for incoming TCP traffic on port N. It offers a simple service: it calculates sum of IP address fields of incoming connection and returns.
Program or function ...
75
votes
57
answers
11k
views
My daughter's alphabet
The other day we were writing sentences with my daughter with a fridge magnet letter. While we were able to make some(I love cat), we didn't have enough letters to ...
52
votes
57
answers
10k
views
The Curious Case of Steve Ballmer
Steve Ballmer is the ex-CEO of Microsoft, and in a recent article, claimed that he "still does not know what he did wrong with mobile".
As CodeProject's newsletter pointed out, "That article's title ...
36
votes
66
answers
5k
views
Insist on an answer
At runtime, keep prompting for a line of input until the user inputs something (other than an empty newline), i.e. does not just press Enter or OK. Output or result is neither required nor prohibited.
...
44
votes
56
answers
8k
views
Don't give me five!
Question :
You will be given the starting and ending integers of a sequence and should return the number of integers within it which do not contain the digit 5. The ...
53
votes
48
answers
22k
views
AlTeRnAtE tHe CaSe
For today's challenge, you must write a program or function that alternates the case of a string. However, you must ignore non-alphabetic characters. This means that every alphabetic character must ...
68
votes
27
answers
15k
views
xkcd-Style Page Numbering
Randall Munroe's book "xkcd, volume 0" uses a rather odd number system for the page numbers. The first few page numbers are
...
28
votes
61
answers
4k
views
Erverse Hte Ifrst Wto Eltters fo Aech Owrd
Inspired by this accidental misspelling
If you could read the title, then you already know what the challenge is about. If not, then I'll tell you. Easy: simply take each word (single space delimited)...
42
votes
33
answers
12k
views
Java is to JavaScript as Car is to Carpet
Title stolen inspired by Greg Hewgill's answer to What's the difference between JavaScript and Java?
Introduction
Java and JavaScript are commonly used languages among programmers, and are currently ...
45
votes
34
answers
5k
views
Reverse the consonants
The program should take a string as input and reverse the consonants in it, while keeping the order of vowels. All the letters will be lowercase, so you don't have to worry about casing. Examples ...
30
votes
43
answers
3k
views
Implement "tac": Print lines from a file in reverse
Between the kitten question and seeing this question at U&L about some sed magic, how about implementing tac?
Objective
...