A competition to solve a particular problem through the usage and manipulation of strings.
18
votes
8answers
590 views
Incrementing Gray Codes
Introduction
A Gray Code is an alternative to binary representation in which a number is incremented by toggling only one bit, rather than a variable amount of bits. Here are some gray codes along ...
-5
votes
1answer
89 views
How much wood would a woodchuck chuck if a woodchuck could chuck wood? [duplicate]
The aim of this golf, is to output the text: "How much wood would a woodchuck chuck if a woodchuck could chuck wood?", request the user's input (which is a string), and then print "A woodchuck would ...
36
votes
43answers
2k views
Now I know my ABCs, won't you come and golf with me?
Write a program or function that outputs this exact text, case-insensitive:
A, B, C, D, E, F, G,
H, I, J, K, L, M, N, O, P,
Q, R, S,
T, U, V,
W, X, Y, Z.
(Based on the alphabet song that many ...
5
votes
5answers
278 views
Some ASCII art for N64's 20th B-Day
The official release of the Nintendo 64 in North America was on September 29, 1996.[1] I figured that this anniversary deserved an ASCII art challenge. There's one small twist though, you have to ...
8
votes
2answers
239 views
Convert pointfree to pointful
Being a Haskell hacker, I prefer pointfree notation over pointful. Unfortunately some people find pointfree notation hard to read, and I find it hard to get the correct number of parentheses when I ...
23
votes
9answers
920 views
Praming Puzles & Colf: Condense a String
Having spend some time on this site I have come to enjoy things being as short as possible. That may be the reason why I'm recently kind of offended by strings containing the same characters more than ...
8
votes
20answers
650 views
String and ASCII [duplicate]
The Challenge
Given a non-empty string containing only lowercase or uppercase letters and no spaces:
Sum up the ASCII values for each character instance in the input string.
The sum will be ...
11
votes
37answers
2k views
Output a string's cumulative slope
Challenge
Given a string such as Hello World!, break it down into its character values: 72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33.
Then calculate the difference between each ...
24
votes
13answers
4k views
Cheating a multiple choice test, part 2
This is sequel to this challenge by Adnan. If you like this challenge, chances are you'll like the other one too. Check it out!
A multiple choice test with 8 questions each with 4 choices might ...
24
votes
18answers
2k views
Draw a Bumpy String
(Inspired by this challenge.)
Let's say we have a string ABBCBA. We can say that there is a rise between A and B, for B follows A; we can say that there is a run between B and B, for nothing changes; ...
12
votes
9answers
476 views
ASCII Odd/Even Cipher
We'll define the ASCII Odd/Even Cipher via the below pseudocode:
Define 'neighbor' as the characters adjacent to the current letter in the string
If the one of the neighbors is out of bounds of the ...
27
votes
16answers
1k views
Implement tab completion
Tab completion is a useful feature that auto-completes partially written commands. You're going to be implementing it.
For example, if the available commands were ['apply','apple','apple pie','eat'],...
7
votes
10answers
389 views
String Concatenation
The Challenge
Given two strings containing only lowercase letters and no spaces, the result should be the shorter string, followed by an underscore, followed by the longer string with the first ...
23
votes
20answers
2k views
Jimmy these arrays down
My coworker, Jimmy is kinda new to C/C++. He's also kind of a slow learner. Now, to be fair, his code always compiles, but he has some really sloppy habits. For example, everybody knows that you can ...
24
votes
30answers
2k views
Substring Chainification
Introduction
For this example, let's take the string Hello, World! and the array [3, 2, 3]. To find the substring chain, we go through the following process:
The first number of the array is 3, so ...
23
votes
52answers
3k views
Is it an Odd Word?
Challenge
Given a single word as input, determine if the word is odd or even.
Odd and Even words
Assume the general rules:
odd + odd = even
even + odd = odd
odd + even = odd
even + even = even
...
19
votes
23answers
1k views
Close-Knit Words
Introduction
According to Rand Al'Thor's post in the Puzzling SE, a close-knit word is any word that contains three alphabetically consecutive letters (in any order).
Words like education, foghorn ...
17
votes
6answers
436 views
Minecraft castle fractal
Inpsired by a youtube video from a fellow PPCG user...
You challenge is to use ASCII-art draw a Minecraft castle wall of Andesite and Diorite. The shape of the wall is the Cantor Set. For reference, ...
4
votes
0answers
110 views
Expand the variadic expression
One of the cool features introduced in the C++11 standard is the ability to declare a template parameter as being variadic; i.e. that parameter represents a sequence of an arbitrary number of ...
28
votes
24answers
1k views
String Distance
Challenge
Given an input of an all-lowercase string [a-z], output the total distance between the letters.
Example
Input: golf
Distance from g to o : 8
Distance from o to l : 3
Distance from l to f ...
13
votes
24answers
2k views
English to Alien translator
Briefing
Aliens have settled on earth and strangely enough, their alphabet is the exact same as ours. Their language is also very similar to ours with some very distinct and easy to compute ...
16
votes
19answers
3k views
An A , or An An?
In English, there is the fun and simple difference between an and a: you use an when preceding a word starting with a vowel sound, and a when the word starts with a consonant sound.
For the sake of ...
32
votes
50answers
4k views
StringgnirtSStringgnirtSStringgnirtS
Here is a relatively simple challenge for you.
Given a string of length N, output the string forwards, then backwards, then forwards, then backwards... etc. N times. For example, if your input was
...
8
votes
2answers
307 views
The ten hundred most common words
This question is written because "Thing Explainer" is fun to read, and gave me an idea.
Write "stuff that makes computer do things" that reads/takes a set of letters, numbers and things like this "#%|...
4
votes
0answers
130 views
Generate Menu Access Keys
This is thematically similar to Generate keyboard shortcuts for a menu, but its actually a pretty different challenge.
Let's take PHPStorm's menu as an example:
New Project
New
Open Directory
Open
...
18
votes
11answers
3k views
Source code GO!
Let's use augmented reality to hunt small creatures hidden in source-code. Write a quine program that outputs its own code source, except for 5 consecutive characters that will be modified and that ...
29
votes
20answers
3k views
Parse the comments out of my esoteric code
Earlier this week, we learned about how to format esoteric languages for commenting. Today, we're going to do the inverse of that. I need you to write a program or function that parses some well-...
-5
votes
3answers
123 views
Old times roman, New times printing [closed]
Backstory
Frustrated with the current state of PC printers, Hans Golf Gutenberg set out to make the world's first automated printing press. It should be simple, easy to use, and automated. Luckily, ...
31
votes
11answers
4k views
How long is a Welsh word?
Write a program or function which receives as input a string representing a Welsh word (UTF-8 unless otherwise specified by you).
The following are all single letters in Welsh:
a, b, c, ch, d, dd,...
30
votes
30answers
5k views
Is it a Bumpy Word?
(inspired by this challenge over on Puzzling -- SPOILERS for that puzzle are below, so stop reading here if you want to solve that puzzle on your own!)
If a letter in a word occurs alphabetically ...
15
votes
10answers
2k views
Make me a bad fade animation… please
Your task is to, as the title discreetly suggests, make a bad fade animation of one word turning into a second word for yours truly.
What exactly is this "fade animation" you may ask?
To make a ...
23
votes
7answers
852 views
Decipher Neurotic Frogs
Decipher Neurotic Frogs
Now that Puzzling.SE has finally cracked my amphibian-obsessed cipher, let's write a program or function to decrypt it!
(If you want to look at the puzzle before having it ...
32
votes
20answers
2k views
Counting Goats to Sleep
Some people count sheep to get to sleep. Others count goats.
Write a program or function that takes in a positive integer N and outputs N-1 awake goats followed by one sleeping goat, as if someone ...
14
votes
5answers
407 views
Golff y Côd - Treiglad
Read this yng Nghymraeg
Challenge
Given a word in Welsh, output all of the possible mutated forms of the word.
Mutations
A mutation is a change of the first letter of a word when following certain ...
38
votes
25answers
2k views
Esolang-Comment-Template-Generator
Lots of people on this site use esoteric languages, and since these languages are unusual and hard to understand, they will frequently write an explanation in a certain format. For example, if the ...
8
votes
2answers
271 views
Conjugate a Turkish verb
Input
verb, a string that matches the regular expression ([a-pr-vyzıöüçğş]*[aeıioöuü][bcçdfgğhj-nprsştvyz]+|([a-pr-vyzıöüçğş]*[aeıioöuü]){2})(mak|mek)
plural, a truthy or falsy value
person, an ...
1
vote
1answer
190 views
“HHeelllloo,, EEaarrtthh!!” [duplicate]
Much like this challenge, write a program or function that takes no input and prints or returns the string
Hello, Earth!
with an optional trailing newline.
The catch is that your program must be ...
33
votes
16answers
5k views
Count to 100 in Danish
Print all the numbers from 0-100 in the right order using the Danish way of counting
How they count
Like English, they have dedicated words for 0-20, 30, 40 and 100
Instead of saying twenty-one and ...
41
votes
29answers
3k views
Bitflip and negate
Given an integer, make an expression that produces it from 0 using unary negation - and bitwise complement ~ (~n = -n-1), with the operators applied right to left.
...
-3 = ~-~-~0
-2 = ~-~0
-1 = ~...
19
votes
43answers
1k views
Stringsplode the String! [duplicate]
The challenge is relatively simple, but will hopefully lead to some wonderfully creative answers. The task is to take a string as an input (via command line, function parameter etc.) and output/return ...
5
votes
2answers
112 views
Marcel Proust and Markov decipher security service’s T9 texts
As if this challenge could be any more Pythonesque in spirit... No prior knowledge of Markov chains or encryption techniques is required.
You are a spy who needs to obtain some crucial information ...
12
votes
6answers
265 views
A cube of text ݀
Last time you made a square of text, but now, can you make a cube of text?
The Challenge
Given a string, output the string in the form of a cube.
You can assume the string will always have 2 chars ...
3
votes
2answers
164 views
The Path to the Result
Input:
A grid of varying size only containing numbers in the range 00-99, the following four characters: ^; >; v; <, and spaces to fill (and new-lines of course).
Output:
The result of the ...
7
votes
3answers
339 views
Two Symbol Math
Introduction
The four basic math operators (+, -, *, /) can be reduced to just two, due to the fact that:
x + y = x - (-y)
x * y = x / (1/y), y != 0
x * 0 = 0/x
Challenge
The challenge is to take ...
17
votes
12answers
877 views
Dimensional countdown
Write a function f(n,k) that displays the k-dimensional countdown from n.
A 1-dimensional countdown from 5 looks like
54321
A 2-dimensional countdown from 5 looks like
54321
4321
321
21
1
...
29
votes
38answers
3k views
Slowly turn a string into another
The Challenge
Given two strings/an array of strings, output the first string slowly shrinking and expanding back into the second string.
You can assume the strings will always start with the same ...
22
votes
19answers
2k views
Help: Aliens Programmers only speak ASCII
Setting the Scene:
It is an average afternoon, as you unwind after a long day by engaging in your favorite pastime: answering the plethora of captivating questions on PPCG. It hasn't been a good day ...
25
votes
21answers
3k views
Mirror, Mirror, in the Code
Two-dimensional programming languages often have mirror commands like / and \ to redirect the instruction pointer on the grid:
>>>>\
v
v
<<<</
In this challenge, you'...
13
votes
7answers
560 views
The world is like a Mirror: smile and it'll sɯıןǝ qɐɔʞ
Input:
A string only containing the following characters:
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.?! (space at the end) and two special characters (_ and |)
Output:
Mirror ...
22
votes
15answers
4k views
End the tabs versus space war
End the tabs versus space war
So, there has been a great deal of debate of whether to use tabs or spaces to indent/format code. Can you help the university settle the dispute, by going to an ...