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

learn more… | top users | synonyms

8
votes
13answers
337 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 ...
1
vote
2answers
167 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 ...
10
votes
5answers
488 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 ...
47
votes
71answers
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 ...
-1
votes
3answers
156 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
2k 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
395 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 ...
64
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
939 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
610 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
905 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
376 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 ...
1
vote
19answers
718 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 ...
12
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
293 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
935 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
13k 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 ...
7
votes
16answers
424 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
99 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 ...
13
votes
9answers
931 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
764 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 ...
14
votes
1answer
787 views

Create a C preprocessor

The goal is to create a preprocessor for the C language, as small as possible in terms of source code size in bytes, in your preferred language. Its input will be a C source file, and its output will ...
6
votes
8answers
2k views

Find the minimum edit distance between two strings

Explanation The edit distance between two strings is a function of the minimum possible number of insertions, deletions, or substitutions to convert one word into another word. Insertions and ...
9
votes
10answers
505 views

String of alphanumeric characters to a sorted list of comma-separated ranges

Given a string of unsorted alphanumeric characters, e.g. ABC321STPpJqZZr0 output a ", "-separated list of character ranges, sorted by ASCII value, ignoring case and removing duplicates (i.e. ...
16
votes
29answers
2k views

Print custom alphabet

The Challenge Display the alphabet from a given letter read from console input. If the letter is uppercase, you have to display the alphabet uppercased. The alphabet printed must end in the precedent ...
3
votes
7answers
309 views

Longest Common Subsequence of Two Strings containing a particular Substring

A subsequence is a sequence that can be derived from another sequence by deleting some elements without changing the order of the remaining elements. Given three strings A, B and C (note the order) ...
8
votes
12answers
624 views

Topographic Strings

Here is some example input, so I can explain what the problem is: ((1 2)(3 (4 5) moo)) (i (lik(cherries)e (woohoo))) Think of this line of text as a topographic map of some mountains. Each set of ...
4
votes
10answers
485 views

Golf an LZW encoder

Given an alphabet and a string, your job is to create the Lempel–Ziv–Welch compression of the string. Your implementation can either be a function with two parameters and a return value, or a full ...
13
votes
9answers
793 views

Create a Twitter Parser

Introduction You use Twitter (let's pretend, if not), where you are limited to 140 characters per individual tweet you care to share with the world. If you wanted to tweet to your followers Abraham ...
4
votes
12answers
568 views

Shortest string expressions stable under deleting quotes

Forgetting quotes can lead to certain problems. For example, in Scala the two expressions: "("+("+")+(")+(")+")" ("+("+")+(")+(")+") differ only in starting and ending quotes, but they ...
7
votes
6answers
270 views

Determine whether a car can get around a route with a limited amount of gas

Using any programming language that supports functions, have the function is_enough(strArr) that take strArr which will be an an array consisting of the following elements: N which will be the ...
-5
votes
2answers
190 views

Shortest code to reverse a string [duplicate]

The winner will be the one to use the shortest code to reverse this string: Today there was two clouds in the sky, each forming a shape. It may be in any programming language.
2
votes
2answers
276 views

Hide one message inside another

Your task is to hide a small message or string inside a larger block of text. To do so, you must hide the message as capital letters inside the larger For the quoted test: Lorem ipsum dolor ...
1
vote
38answers
2k views

Print an n-by-n Box [closed]

Simple problem: print an n by n box from a function. A couple caveats:  -You may not use any loops  -The function must have exactly one parameter of type int (or the equivalent in your ...
1
vote
0answers
81 views

palindrome detection palindrome [duplicate]

Write a function with a single string parameter and a boolean return value. The function should return true iff the string is a palindrome character-wise. Alternatively, write a program that reads a ...
7
votes
7answers
791 views

ASCII ruler generation

The challenge is to generate an ASCII character count ruler in the following format: +-------------------------------------------------------------------------+ || | | | | | | | ...
21
votes
4answers
840 views

9-hole mini-golf: Text Manipulation

9-hole mini-golf: Description 9 (mostly fairly easy) code golfing challenges of varying difficulty Penalties for using the same language more than once All challenges about a specific theme (this ...
10
votes
3answers
220 views

Expand tabs (implement expand(1))

Your task this time is to implement a variant of the POSIX expand(1) utility which expands tabs to spaces. Your program is to take a tabstop specification and then read input on standard in and ...
17
votes
19answers
3k views

Hello world!!! Fibonacci distribution

Your program should output exactly: Hello world!!! with or without linefeed after. Your program should take no input. Sourcecode character distribution must be correct according to: The number of ...
11
votes
29answers
2k views

Reverse stdin and place on stdout

Requirements: Take an input on stdin including new lines / carriage returns of unlimited length (only bounded by system memory; that is, there is no inherent limit in the program.) Output the ...