Questions tagged [string]

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

Filter by
Sorted by
Tagged with
13
votes
5answers
501 views

Fancy String Replace

let S, a and b each represent a string Goal: Write a standard string replace function where ...
5
votes
2answers
166 views

Weigh your words!

The challenge Given two strings, each of length up to 30, consisting of printable ASCII characters (codes \$[32, 126]\$), put them onto a balance scale in the fewest bytes of code! This consists of ...
7
votes
23answers
331 views

caN it be acrOnymised? [duplicate]

The Typical Way to Make an Acronym Out of a Phrase Is to Take the First Letter of Each Word: TTWMAOPITFLEW. howeveR, sometimEs, you can make an acronym of random ...
43
votes
48answers
7k views

How much code would a codegolf golf if a codegolf could golf code?

Write a function or program that takes two words as input and outputs variants of the popular English tongue-twister "How much wood would a woodchuck chuck if a woodchuck could chuck wood?". The ...
21
votes
58answers
8k views

!I!n!s!e!r!t! !n!b!e!t!w!e!e!n!

Posted from here. This challenge is highly "distilled" from this question. Special thanks to @Akababa! In this task, you should insert an exclamation mark at the start of the string and after every ...
19
votes
9answers
2k views

Levenshtein Neighbours

Most square numbers have at least 1 different square number with which their Levenshtein distance is exactly 1. For a given square \$x\$, each square that meets this condition is called a Levenshtein ...
25
votes
29answers
2k views

Output with the same length always

With challenges like Output with the same length as the code and Create output twice the length of the code, I thought of a separate, but similar challenge. The task is to produce an output. It can ...
20
votes
12answers
2k views

Lípínguapua dopo Pêpê

Língua do Pê, or P Language, is a language game spoken in Brazil and Portugal with Portuguese. It is also known in other languages, such as Dutch and Afrikaans. (Wikipedia) There are some dialects in ...
32
votes
33answers
6k views

Is this n-speak?

Inspired by Is it double speak?, I devised a harder challenge. Given a string, determine if the string is n-speak, for any \$n\geq 2\$. N-speak is defined by repeating each letter \$n\$ times. With \$...
1
vote
5answers
192 views

Print an array as a table [closed]

Write a program that prints an associative array (key-value) to a table. Requirements Standard loopholes are forbidden Please include a link to an online interpreter and the byte count in the ...
29
votes
34answers
7k views

The cat ate your input again!

Create a cat program, a.k.a a program that takes an input and prints it. ...Except, the program will randomly take characters away from your input and print that instead. Each character in the input ...
44
votes
71answers
9k 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!! ...
52
votes
116answers
10k views

“DDoouubbllee ssppeeaakk!!”

Super simple challenge today, or is it? I feel like we've heard a fair bit about double speak recently, well let's define it in a codable way... Double speak is when each and every character in a ...
17
votes
12answers
2k views

Composing fill in the blanks

Let us say that we have a particular set of functions on strings. These functions are kind of like fill in the blanks or madlibs, except that they only take one input and use that to fill in all of ...
23
votes
22answers
2k views

Invert Some Switches on a Switchboard

Inspired by this challenge. Goal: Given a pre-configured switchboard and a list of indexes, invert the switches at the given indexes. A switchboard is made up of some number of switches (...
22
votes
43answers
4k views

Character Frequency in a String [duplicate]

Given a string of printable ASCII, output the frequency of each character in that string. The Challenge Input is given as a string of printable ASCII characters (decimal ...
32
votes
23answers
4k views

Brute-force the switchboard

The other day, our team went to an escape room. One of the puzzles involved a board of six mechanical switches where you had to find the correct combination of on and off in order to unlock a box, ...
6
votes
7answers
503 views

Battle of the Jimmys

/o\ Jimmy has been receiving a lot of attention on this site recently and it has caused Jimmy to get a little stressed. The bodybuilder Jimmys ...
4
votes
2answers
163 views

How many pages have issues? [duplicate]

At work I've been acting as quality control on our public documents, to make sure that they are WCAG 2.0 compliant. Given the length of some of these documents there tend to be issues, and so I record ...
22
votes
17answers
2k views

Inscriptio Labyrinthica

In the burial place of King Silo of Asturias there is an inscription that reads SILO PRINCEPS FECIT (King Silo made this). The first letter is found in the very middle, and from there one reads by ...
66
votes
12answers
11k views

Operation Unz̖̬̜̺̬a͇͖̯͔͉l̟̭g͕̝̼͇͓̪͍o̬̝͍̹̻

I'm sure you're all familiar with Z̃͗̇̚͟Ḁ̬̹̈̊̂̏̚L̜̼͊ͣ̈́̿̚G̱̮ͩ̃͑̆ͤ̂̚Õ̷͇͉̺̜̲ͩ́ͪͬͦ͐ ̪̀ͤͨ͛̍̈͢ĝ̭͇̻̊ͮ̾͂e̬̤͔̩̋ͮ̊̈ͭ̓̃n͖͎̘̭̯̳͎͒͂̏̃̾ͯe͕̖̋ͧ͑ͪ̑r̛ͩa̴͕̥̺̺̫̾ͭ͂ͥ̄ͧ͆t͍̻̘̆o͓̥ͤͫ̃̈̂r̹̤͇̰̻̯̐ͮ̈́ͦ͂͞. If not, you can play ...
9
votes
17answers
1k views

Alphanumeric Line and Curve Counting

Given an input string, write a program that outputs the total number of lines and curves it has. The Challenge Take input from STDIN, or any other input method. ...
9
votes
16answers
1k views

MQTT subscription topic match

Background MQTT (Message Queuing Telemetry Transport) is an ISO standard publish-subscribe-based messaging protocol (Wikipedia). Each message has a topic, such as the following examples: ...
24
votes
21answers
5k views

A scene of Jimmy diversity

As you probably know, there have been multiple lovely Jimmy challenges recently popping up. In these challenges, you were challenged with our beloved friend's acrobatics skills. Now we've got a ...
11
votes
8answers
627 views

Jimmy needs a new pair of shoes!

Jimmy has had a busy last week with all these platforms and ropes, and poor Jimmy doesn't even have legs or feet to stand on! Your job is to take a string containing multiple Jimmys and give them ...
23
votes
14answers
3k views

Do you know your 'KVZ's?

Concept In what ways can you scramble the English alphabet so that it can still be sung to the tune Twinkle Twinkle Little Star without ruining the tune? Rules Swapping Let's just assume the ...
2
votes
0answers
65 views

Mutation chain generator [duplicate]

Given a start word and a target word, print the "mutation chain" that starts at the start word and ends at the target word. You may assume both words are lowercase and only have alphabetic characters....
9
votes
28answers
1k views

String to Bit Transition

Task Given an input string of one or more ASCII characters which codepoints are between 0 and 128 (exclusive), do the following: Convert each character into its 7-bit ASCII code (if the ASCII code ...
10
votes
55answers
6k views

Swapping “Good” and “Bad”

Challenge Description: Write a program that asks the user for input. The user will enter Good or Bad. You do not have to ...
17
votes
23answers
7k views

Can Jimmy hang on his rope?

Yet another Jimmy challenge by his original father. See these other lovely challenges. As you all know, recently we've been seeing challenges related to Jimmy on platforms. Now, Jimmy is an acrobat ...
16
votes
8answers
1k views

Jimmy needs your help!

It seems as of recent, there have been a lot a Jimmys falling to their death, as can be seen here, and here where you were asked to determine if Jimmy would fall. It is time we put a stop to this ...
20
votes
8answers
911 views

Alice's First Code Review

Alice is an intern in a company that uses Brainfuck as a primary language for both client-side and server-side development. Alice just has written her first code and she's a bit nervous as she's ...
5
votes
2answers
405 views

Can the cursor reach the bottom?

In a matrix of characters, a cursor is a movable position between two adjacent characters, before the first character or after the last character in a line, like that "I"-shaped indicator which moves ...
28
votes
13answers
5k views

How many Jimmys can fit?

In this simple but fun challenge, you were asked to determine if Jimmy would fall of their platform. Jimmy has three body parts /, ...
11
votes
29answers
5k views

Count All Possible Unique Combinations of Letters in a Word

You are given a string, which will contain ordinary a-z characters. (You can assume this will always be the case in any test, and assume that all letters will be lowercase as well). You must ...
12
votes
7answers
381 views

Print the total length of all “quoted” characters

Rules In this challenge, I'm going to redefine the definition of "quotes" a bit. Quotation marks (AKA quotes) are any identical characters used in pairs in various writing systems to set off direct ...
29
votes
4answers
2k views

Print the new site header

The new site header has some bits of source code from various questions as the background. Here are the first 3 lines: ...
57
votes
11answers
8k views

New Site Design!

Unless you have a userscript that modifies the site's design (or even if so), you should have noticed that we have our site design! (It's November now) So, to celebrate, let's make a program that ...
45
votes
45answers
13k views

Print “N NE E SE S SW W NW”

This seems almost trivial, but since after some effort I was not able to beat the literal solution in J, I thought it might make a decent challenge (though, to be clear, this is not a J-specific ...
1
vote
3answers
271 views

Manhattan Directions Code Golf

This code golf challenge is to show directions through numbers. When the user enters a number, then that means a direction change as follows: ...
21
votes
21answers
2k views

Overlapping String-Blocks

Challenge: Given a list of multi-line strings, overlap them (in the top-left) and output the result. Example: Input: ["aaaa\naaaa\naaaa\naaaa","bb\nbb\nbb","c"] ...
-3
votes
10answers
374 views

Point out a string character [closed]

Introduction In many programming languages, within syntax exceptions, it is often pointed out to the programmer exactly which character or line is the culprit. This challenge will be a bit of a ...
16
votes
37answers
2k views

Split into three!

Given a string, you've to split it into groups of three characters (by padding _ at the end). Related, but still it's different. Sample I/O: ...
30
votes
43answers
4k views

pwaS eht tirsf dna tasl setterl fo hace dorw

Or, "Swap the first and last letters of each word" Your challenge is to, given a string of alphabetical ASCII characters as well as one other character to use as a delimiter (to separate each word), ...
10
votes
2answers
295 views

Golf my Ada arrays

Background Ada is a programming language that is not exactly known for its terseness. However, its array literal syntax can in theory allow for fairly terse array specifications. Here is a simple ...
1
vote
1answer
132 views

Building a Structured Outline [closed]

In a fictional document management system, input documents are structured with weighted headings. Lowest weighted headings are the most important. This is a sample document: H1 All About Birds H2 ...
25
votes
40answers
7k views

As programmers say: Strive to be lazy

Story Have you seen this post from 9gag? Maybe you got the feeling to make your own sentences. But then you realize that you could just golf a script in half an hour, and you will never have to deal ...
12
votes
5answers
216 views

Country Code Transformations

Background and Motivation: IOC Country Codes are three letter abbreviations that are commonly used when broadcasting the Olympic Games. The last two letters of some codes overlap with the first two ...
10
votes
10answers
660 views

Determine if a grid contains another grid

Challenge Create a function takes in two 2-dimensional arrays of Characters (or Strings if the programming language does not have characters as a datatype) as inputs: a and b. If your language does ...
8
votes
8answers
549 views

Type-check an expression

Given an infix expression, determine whether all constants are of the same type. Operators will consist only of these dyadic operators: +-/* Your program or ...