A competition to solve a particular problem through the usage and manipulation of strings.

learn more… | top users | synonyms

9
votes
11answers
670 views

Multiply all numbers in a string

Your goal is to find all numbers in a string, and multiply each one individually by a value input by the user You will not need to worry about decimals The user will input a number and a string The ...
6
votes
43answers
2k views

Input a number and return day of week

Not restricted to any one programming language. What I'm saying is you pass 1 to it and it returns Monday, 7 corresponds with sunday and so on. I've managed a 146 byte statement in Java to do the ...
1
vote
14answers
706 views

Concise case changing code

Create the shortest program that given an input string it outputs the opposite-cased string. For example if I pass the string "HeLlO" the program should output "hElLo". Of course, neither aggregate ...
4
votes
2answers
293 views

Interpret /// (pronounced 'slashes')

Because we can't get enough of esoteric language golfs, can we? ///—pronounced slashes—is a fun little language based on the s/// regex-replacement function of Perl fame. It contains only ...
2
votes
2answers
232 views

Put together cut strips of paper to get original message

This question is from a programming challenge (not DARPA) which has ended. A sheet of paper consists of message, which has been shredded into vertical strips. Given the vertical strips and a ...
-4
votes
0answers
118 views

Let's have some fun, create a program to display a random curse word [on hold]

Your task is simple. Create a program that will display a random MILD curse word every time it is started, censored words are not allowed and do not count. Curse words should be mild enough to not be ...
7
votes
4answers
505 views

The Forest Path

After your disastrous canoe ride, you ended up falling off a waterfall at the end of the river rapids. Your canoe exploded, but you managed to survive the explosion. However, your river journey went ...
11
votes
4answers
581 views

Write a program which replaces with spaces the braces in cases where braces in places cause stasis

You are a project manager. One day, one of your programmers went insane (not your fault) and took all the expressions in the codebase and added random brackets to them, before quitting on the spot, ...
48
votes
72answers
8k views

Print the alphabet without using each vowel

Inspiration: in 1939, a man named Ernest Vincent Wright wrote a novel called Gadsby without using the letter 'e'. Your task is to write a set of (up to 5) programs in any language (which has a ...
10
votes
7answers
510 views

Molar masses of compounds

Task Write a program that takes in a compound made solely of elements with an atomic number less than or equal to 92 (Uranium), and outputs the molar mass of the compound in grams/mole. Rules and ...
12
votes
3answers
718 views

Expression that equals its length

Given a number, find an expression in words equaling that number, with a length of that number. Thus, to an input of 15, you might output sixteen minus one, which has fifteen characters (not counting ...
15
votes
13answers
1k views

Determine a string's Scrabble score and validity

Your task is to determine if a given string is of proper length and can be represented with Scrabble tiles and, if so, output the sum of each letter's score. If you don't know how to play Scrabble:, ...
10
votes
4answers
438 views

Golf String's format() inverse

Invert the Format method. The Format method of the String class (or equivallent, such as sprintf) is available in most languages. It basically takes a "Format" string which may contain placeholders ...
5
votes
9answers
1k views

Same word when missing letters

Idea From a given word dictionary (containing only plain letters, i.e: no accent or other special chars), with a given fixed word length, find every same when a given number letters are missing. For ...
13
votes
2answers
528 views

How many characters per character?

At http://shakespeare.mit.edu/ you can find the full text of each of Shakespeare's plays on one page (e.g. Hamlet). Write a script that takes in the url of a play from stdin, such as ...
2
votes
24answers
1k views

Count how many characters are in the program's source

Write a program that counts and prints the number of characters in it's own source code to standard output. The number must be generated from counting the characters. This Ruby solution would not be ...
22
votes
3answers
943 views

Where are the runs in this infinite string? (CCCCCC Found!)

Starting with the string ABC, consider the result of repeatedly appending the last half of itself to itself (using the larger half if the length is odd). We get the progression: ABC ABCBC ABCBCCBC ...
8
votes
9answers
738 views

Quoting Big Brother

Task: Have your program randomly choose one of the following two quotes at runtime and print that one quote, exactly as shown. 1: Under the spreading chestnut tree I sold you and you sold me. There ...
15
votes
25answers
1k views

Convert a string of binary characters to the ASCII equivalents

Take a string of binary characters separated by a space, and convert it to an ASCII string. For example... 1001000 1100101 1101100 1101100 1101111 100000 1010111 1101111 1110010 1101100 1100100 ...
7
votes
8answers
1k views

Write an IBAN validator

Write a program (the body of the function is enough) that accepts a string of alphanumeric characters and validates it according to ISO 13616:2007. The algorithm for validation is (source: wikipedia ...
14
votes
3answers
516 views

Find the shortest bracket numbers

Bracket numbers provide a simple way to express large integers using only left bracket, space, and right bracket ([ ]). A bracket number is defined as a string of one or more pairs of matching ...
0
votes
5answers
291 views

Implement atoi function [duplicate]

You already know that the atoi function of stdlib.h converts a string to an integer. atoi (copied from here) int atoi (const char * str); Convert string to integer Parses the C-string ...
30
votes
22answers
5k views

Draw the Sawtooth Alphabet

A simple one today. Write the shortest program that draws a "sawtooth alphabet" given a positive integer for the height. You must write the name of your programming language when you come to the ...
10
votes
5answers
535 views

Reduce html to n characters while keeping the formatting

Almost every language has a built-in function that can split a string at a given position. However, as soon as you have html tags in the string, the built-in function will not work properly. Your ...
36
votes
35answers
5k views

ETAOIN SHRDLU golf

Short and sweet description of the challenge: Based off ETAOIN SHRDLU, your challenge is to write the shortest program or function in any language that outputs the 26 letters of the English alphabet ...
-1
votes
3answers
166 views

Output a non-Context-Free Language [closed]

Your challenge is to write a program which will output a non-context-free language. A Context-free Grammar is a series of replacement rules, describing which symbols can be replaced by which other ...
30
votes
3answers
3k views

Regex that only matches itself

There are some pretty cool challenges out there involving regex (Self-matching regex, Regex validating regex) This may well be impossible, but is there a regex that will ONLY match itself? NOTE, ...
32
votes
37answers
6k views

The shortest code to invert a binary string

Me thinks there aren't enough easy questions on here that beginners can attempt! The challenge: Given a random input string of 1's and 0's such as: 10101110101010010100010001010110101001010 Write ...
8
votes
2answers
419 views

Apply English punctuation rules

You've been hired to write some code for a dictation-taking app, which takes voice input from a spoken source, parses it as words, and writes it down on a screen. The management doesn't really trust ...
65
votes
11answers
16k views

I am passive aggressive and want to insult my boss without him finding out

It's been a rough few months at work and I feel like I just want to scream right to my boss' face. I am, however, not one to directly confront people I have a problem with. I also don't want to lose ...
4
votes
28answers
1k views

Implement an integer parser

Implement an integer parser in the shortest code possible, with the following restrictions: The function or program can only take one argument: a string (or equivalent). Assume it to be signed and ...
8
votes
18answers
950 views

Check for occurences of string in other string

Challenge I'm sure you read the title, and came in to farm your rep, thinking its kids' stuff, but think again! You have to challenge each other in the shortest code to count the occurences of a ...
9
votes
23answers
1k views

Print a string with vertical words

Your task is to take an input string of ascii characters and output the string as a series of vertical words separated by spaces. An example is shown below: Given the string: Hello, World! My name ...
18
votes
5answers
1k views

Leet to English Translation

Leet to English Translation Your challenge is to write a program to translate (English) leetspeak/lolspeak/txtspk into normal English. Your program should read from standard input and output to ...
8
votes
4answers
621 views

Generate keyboard shortcuts for a menu

Menu Shortcuts Traditionally, user menus are accessible by keyboard shortcuts, such as Alt + (a letter), or even simply hitting the letter when all textboxes are unfocused (gmail style). Your task ...
18
votes
5answers
930 views

World IPv6 day 2014

To mark the anniversary of World IPv6 day, the Internet Society has published a campaign to Turn Off IPv4 on 6 June 2014 for One Day. IPv6 addresses may be represented in their long form as eight ...
19
votes
17answers
2k views

How many IP addresses are in a given range?

Inspired by... http://programmers.stackexchange.com/questions/241402/how-can-i-work-out-how-many-ip-addresses-there-are-in-a-given-range Write a program or function that takes two strings as input, ...
-2
votes
11answers
389 views

Code Golf: Create a string of 100 of the same character [closed]

The problem is to create a string of the same character repeated 100 times in as short a statement as possible. One potential solution is: var i = 100, s = ''; while(i--) s += "Z"; I'm looking ...
13
votes
34answers
1k views

Detect rotated strings

Read two strings from stdin. Output Yes if one string is a rotated version of the other. Otherwise output No Testcases Input CodeGolf GolfCode Output Yes Input stackexchange changestackex ...
-4
votes
4answers
307 views

print text with no chars [closed]

Mission is write a program that prints "Hello World!". Simple? Text must be human readable and should not be "|-| € |_ |_ 0 // 0 |? |_ |) \./" or something like that Program should not contain: ...
14
votes
31answers
966 views

Shortest program to split a string at non-digits without RegExps

EDIT: If you're using Lisp, I have given some guidelines at the bottom in counting bytes. Objective: Make the shortest function that splits a string at non-digits and returns an array consisting of ...
47
votes
31answers
14k views

All Your Base Are Belong To Us (Restricted)

Input must not be required, and output must read "All your base are belong to us". Restrictions No external resources. Plus a minimum of two of the following: You cannot use "a", "b", "t", "u", or ...
17
votes
8answers
1k views

One Letter Swap

The largest forum on the web, called postcount++ decided to make a new forum game. In this game, the goal is to post the word, but the word has to have one letter added, removed, or changed. Your boss ...
11
votes
8answers
1k views

Is it a prime? w/o math

Write a program or function in any language that tells if the input is a prime number. The input is a string representing a natural number in base-10. The output is one of the two strings "Prime" or ...
8
votes
16answers
429 views

Sum of integers in string, separated by non-numericals such as 'a' and 'Y'

Create a program which sums all integers found in a string which is set as a variable in the program (thus, the program doesn't have to handle any input). The integer numbers are separated by ...
-6
votes
1answer
102 views

Dealing with boolean strings [closed]

you have the following or similar string : () || () || { () || () } && () || { () && () } || and && are used as operators. () indicates of an boolean of that matter.(true or ...
7
votes
31answers
3k views

Is string X a subsequence of string Y?

Given strings X and Y, determine whether X is a subsequence of Y. The empty string is regarded as a subsequence of every string. (E.g., '' and 'anna' are subsequences of 'banana'.) Input X, a ...
14
votes
9answers
950 views

Write a function that returns past tense of given verb

Challenge Write a function which takes an argument which is a verb, and returns the past tense of the verb. (Assume that the verb is regular) Past tense Note: consider y as neither consonant ...
6
votes
17answers
782 views

Write a program for splitting the string with alternative spaces

Want to write a program in minimum number of code,all programming language accepted Runtime criteria also challanged Example: Input : abcdef Output: a b c d e f ab cd ef abc def ...
8
votes
16answers
2k views

Outputting ordinal numbers (1st, 2nd, 3rd)

I would like to generate (as a return result of a function, or simply as the output of a program) the ordinal suffix of a positive integer concatenated to the number. Samples: 1st 2nd 3rd 4th ...