string's questions - English 1answer

1.450 string questions.

Given a string, character list, byte stream, sequence… which is both valid UTF-8 and valid Windows-1252 (most languages will probably want to take a normal UTF-8 string), convert it from (that is, ...

Former US Secretary of Defense, Donald Rumsfeld, famously popularized the phrase "known knowns." Here we're going to distill his remarks into a four-line stanza. Specifically, output this text:<...

Today, we're going to make an ASCII hexagon. You must write a program or function that takes a positive integer n, and outputs a hexagon grid of size n, made up of asterisks. For example, a hexagon of ...

Uncollapse digits

36 answers, 4.070 views code-golf string
Task Given a string of English names of digits “collapsed” together, like this:zeronineoneoneeighttwoseventhreesixfourtwofiveSplit the string back into digits:...

Enklactify these strings

32 answers, 1.973 views code-golf string
Inspired by this comment chain... I wanna enklact my way out of this challenge but I can't... @ETHproductions to enklact (v): to implement a lookup table ...

Inspired by the Codewars Kata. Your goal is to take an input string such as this one:"'Twas a dark and stormy night..."and return a string containing the ...

Given a string, your task is to collapse it into a zigzag-like structure as described below. Folding into a Zigzag We'll take the string "Mississippi" as an ...

So... uh... this is a bit embarrassing. But we don't have a plain "Hello, World!" challenge yet (despite having 35 variants tagged with hello-world, and counting). While this is not the most ...

Simple cat program

236 answers, 13.910 views code-golf string
One of the most common standard tasks (especially when showcasing esoteric programming languages) is to implement a "cat program": read all of STDIN and print it to STDOUT. While this is named after ...

Write a program or function that transforms an input string into Zalgo text. For example, for an input string Zalgo, a possible output might look like: ...

Introduction In our recent effort to collect catalogues of shortest solutions for standard programming exercises, here is PPCG's first ever vanilla FizzBuzz challenge. If you wish to see other ...

Given a letter of the English alphabet, your task is to build a semi-diagonal alphabet to the input. How to build a Semi-Diagonal alphabet? Brief Description: First, you take the position of the ...

I've been working on this iOS app recently and I encountered a (rather easily solved) problem: How do I determine if my string is comprised only of emojis? Well, that's your job today! Input A ...

Richard Dawkins in his book The Blind Watchmaker, describes a Weasel program. The algorithm can be described as follows: Start with a random string of 28 characters. Valid characters are all ...

You must write a program or function that takes a string of brackets and outputs whether or not that string is fully matched. Your program should print a truthy or falsy value, and IO can be in any ...

There have been a couple of previous attempts to ask this question, but neither conforms to modern standards on this site. Per discussion on Meta, I'm reposting it in a way that allows for fair ...

Write the shortest possible code which converts tabs to spaces in the input. Tab size should be supplied as a parameter or be hardcoded in the code in a single place. Spaces on output should point to ...

A Capital Cipher

14 answers, 982 views code-golf string cipher
Your task is to decipher a non-empty string consisting of printable ASCII characters in the range [32..126]. Reading the string character per character: each time you encounter a letter in lowercase,...

Say I have text like this (each word on one line, with no spaces)Programming Puzzles & Code GolfThat makes no sense! It totally defies the laws of physics. ...

Here's a programming puzzle for you: Given a list of pairs of strings and corresponding numbers, for example, [[A,37],[B,27],[C,21],[D,11],[E,10],[F,9],[G,3],[H,2]]...

The challenge Given a 2d string representing the bottom of a boat as an input, you must determine whether or not the boat will float. This 2D string can be in whatever format is most convenient. (...

Introduction Long ago, when I used to code card games with usual playing cards, I used to specify a number for each card and call a function with some number to get a card. This somewhat inspired me ...

You will be given a string s. It is guaranteed that the string has equal and at least one [s and ...

Levenshtein Distance

19 answers, 2.424 views code-golf string
While there are many edit distance questions, such as this one, there isn't a simple question to write a program that calculates the Levenshtein distance. Some Exposition The Levenshtein edit ...

Space indentation users, unite! We must fight against all the lowly tab users! Your mission (should you choose to accept it) is to write a program or function that takes in two arguments: A string: ...

Introduction I've seen throughout the code-golf challenges several simple tasks involving JSON, such as interpreting JSON strings with RegExs, and almost every other manipulation I could think of. ...

The λ-calculus, or lambda calculus, is a logical system based on anonymous functions. For example, this a λ-expression:λf.(λx.xx)(λx.f(xx))However, for the ...

Taken from StackOverflow Question Challenge Given an encoded string in format n[s] where n is the amount of times ...

Introduction: The best options for the glass of your house will: 1. Let through as little heat as possible in both directions (insulation-value Ug). (2. Let ...

Input None Output 52 cards. No duplicates. Cards are represented as their unicode characters, e.g. 🂹. The Unicode codepoints follow the following format: The first three digits are ...

your shift key is broken. wheNever you type two lines, the cApitaL...

Divide two strings

8 answers, 742 views code-golf string
One day, I saw the challenge to multiply two strings and I thought I might be able to do one better. That challenge was fake. It was elementwise maximum. It was not real multiplication. So I set out ...

Challenge: Input: You take two inputs: - A string only containing printable ASCII (excluding spaces, tabs or new-lines) - A printable ASCII character Output: The first line will contain the string-...

Background Three years ago, this guy Tom Murphy got it into his head to extend the idea of a portmanteau to all words in a language and called this a portmantout (portmanteau plus tout [French for ...

You have come across an old Indian manuscript, one that describes mounds of buried treasure. The manuscript also tells you the location of the treasure, except that some crucial numbers have been ...

Rememebere tehe vowelese!

18 answers, 2.501 views code-golf string
Input A string of printable ASCII characters, for example:This is an example string.Output For every consonant (...

Inspired by a meme I saw earlier today. Challenge description Consider an infinite alphabet grid: ...

Challenge Given a string describing a cutting rule and another string, cut parts out of the second string using the rule described by the first string. Both strings will consist of letters ...

The "Look and say" or "Say what you see" sequence is a series of numbers where each describes the last. ...

Decode the string

43 answers, 3.967 views code-golf string
This is my first challenge on ppcg! Input A string consisting of two different ascii characters. For exampleABAABBAAAAAABBAAABAABBAABAChallenge The task is ...

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 reverse ...

“Multiply” two strings

53 answers, 4.566 views code-golf string
This was inspired by a function I recently added to my language Add++. Therefore I will submit an short answer in Add++ but I won't accept it if it wins (it wouldn't be fair) Don't you hate it when ...

Exchange capitalization

26 answers, 4.194 views code-golf string
Given two strings of letters, transfer the capitalization pattern of each string onto the other one. Fewest bytes wins. ...

Challenge : Check : if there are exactly n exclamation marks ! between every pairand ...

COBOL is a very old language, at the time of writing it is 58 years old. It is so old, in fact, that it has a very interesting quirk: the first six characters of each line are comments. Why is this, ...

Challenge : Inspired by Alphabet Position Finder Given an string and one of two possible mathematical operator (+ or -) as ...

Example inputs and outputs: Input 1 "request.partner"Output 1 [request, partner]Input 2 ...

Your challenge is to sort a string, but rather than by the normal alphabetical order (abc..xyz), you will be sorting strings by a specified alphabet. You must write a program or function that takes ...

split and capitalize

24 answers, 1.114 views code-golf string
Challenge : Given a string split at specific positions and capitalize the first character of the given word. Capitalize the first word's first char if and only if it was already capitalized Input : ...

Do you recognize the PPCG logo? it looks like this, when you do an ascii art of it.+---+ |PCG| +---+ vNow, In this Code Golf, You will make a code, that ...

Related tags

Hot questions

Language

Popular Tags