Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [parsing]

This tag denotes challenges where parsing input is a large / the main part of the challenge.

46
votes
13answers
3k views

Golf my Shakespeare quote references

While writing my essay for Shakespeare, I realized that I needed to shorten my quote references to more manageable lengths. I had previously been writing this: ...
37
votes
1answer
999 views

Guess how to pronounce German words

Introduction Unlike English, German is considered to have quite a phonemic writing system. That means that the correspondence between spelling and pronunciation is close. Given any word you aren't ...
8
votes
13answers
877 views

Extract the Coefficients of a Linear Equation

Given a linear equation mx+n, return n and m. However, the equation may be in any of the ...
15
votes
1answer
493 views

What would your reputation be without the rep cap?

In this challenge, you will calculate what your reputation would be, if the reputation cap didn't exist on PPCG. Everyone can access the rawdata for reputation changes on the adress: codegolf....
0
votes
1answer
103 views

Take an input, a formula, and do f(x) [closed]

What I want: Take an input, x Take a formula. It has to be capable of reading something in the format: ax^m + bx^n + cx^o ... where m, n, o and any terms after that can represent any value. ...
21
votes
24answers
1k views

Wherre are the adjacent characters in the title? [3, 4]!

Title misspelled on purpose. Read more to find out why. Your task: given a delimited string or list including the characters A,B,C,D, output the indexes of all the ...
34
votes
8answers
3k views

Read ASCII-Art Text

Inspired by Golf me an ASCII Alphabet, of which this challenge is (almost) a direct inverse. Task: Take a string of ASCII-art text and output the content of the text as regular ASCII text. Input: ...
7
votes
3answers
450 views

Line up for golf!

Alice, Bob, Carol, Dave, and Eve are going out for a nice game of golf and need your help to decide in what order they will play. Your program will input some statements, which are defined as a ...
0
votes
0answers
64 views

Who won the game? [duplicate]

Task Everyone knows the game "Tic-Tac-Toe". Your task is it, to evaluate an ascii tic-tac-toe matchfield. Your Programm/Function should output/return the winner: O, X or nobody (N). Pattern ...
10
votes
8answers
639 views

Grade My Scan-tron!

Standardized testing usually comes with a scan-tron or some type of answer document that records your answer. A computer or human(s) would then check your answers and determine your grade. So here, ...
0
votes
1answer
116 views

CSV cleanup: remove all in col after ( [closed]

Problem Given a file with: ...
23
votes
16answers
1k views

Making Music Boxes

Your task is to take a sequence of characters (the music) as input (in a function or program), and print (or return) the music as it would look like in a music box. You will only receive the ...
14
votes
4answers
493 views

Solve Math Problem Notation

Imagine I have an infinite number of homework problems (!) each given an integer number. Math Problem Notation is a notation for describing subsets of the problem using problem specifiers. An MPN ...
12
votes
18answers
1k views

Simple CSV/DSV importer

Slightly more than an inverse of this. In: Multi-line DSV data and a single delimiter character. The DSV may be taken as a file, a filename, line-break separated string, list of strings, etc. ...
32
votes
1answer
2k views

Generate Pyramid Scheme code

Pyramid Scheme is a language being developed by @ConorO'Brien. In Pyramid Scheme, the code that you write looks like this: ...
7
votes
1answer
357 views

Parse the Markdown-like Markup!

The Challenge In this challenge, you are supposed to write a program or function that takes in a String, which will contain the simplified Markdown-like Markup, and outputs the corresponding HTML ...
28
votes
1answer
411 views

Count spelling errors in text; minimize the number of spelling errors in your code

Write a program or function that takes two inputs: A text message The dictionary of English language, as it appears in this Github file (containing about 60000 words) and outputs the number of ...
14
votes
13answers
1k views

Permanently self-modifying code

Now, we all know most languages have very simple ways to "self-modify" code. However, what if you were to actually modify the code and edit parts of it...on disk? Your goal is to make code that ...
24
votes
2answers
925 views

Write an Incident tokeniser

Background Incident is a fairly unusual programming language, in that its list of tokens is not predetermined, but rather inferred from the input. As such, tokenising an Incident program can be ...
27
votes
39answers
5k views

12 hour to 24 hour time converter

Amazingly, this simple task doesn't seem to exist already, so... Your task is to write a program that takes as input a 12 hour time, and converts it into "military time", or 24-hour time format. ...
19
votes
6answers
674 views

Count the characters - bit by bit!

The simple part: Given an input string containing only printable ASCII-characters (space - tilde), count the number of occurrences of each character and return the result on any convenient format. The ...
2
votes
3answers
216 views

Binary to trinary [duplicate]

The problem Given a binary number from 0 to 111111 convert it to trinary. (Base 3). Then print the result. Rules No using a list of conversions. Don't cheat You must use a string as the number ...
28
votes
19answers
2k views

URL-Friendly Titles

People on this site really love to embellish their post titles... Stewie's sequence: + * - / + * - / However, when this title needs to be included in the page ...
15
votes
19answers
2k views

Shortest Konami Code

The Problem You must write a program that, when the Konami Code is typed in during runtime, prints the string "+30 lives" and sounds a noise of your choice from ...
34
votes
28answers
4k views

Please release me!

As code-golfers, we're not used to releasing (surely). We're gonna need a few tools to help us do that. Of course, to help marketing a new release, we need a nice and shiny Release Version. Who doesn'...
25
votes
15answers
868 views

Transpile WordMath

We've all seen those online "maths hax" that look like this: Think of a number, divide by 2, multiply by 0, add 8. And, by magic, everyone ends up with the ...
5
votes
9answers
833 views

Parse a raw IRC message

In the IRC protocol, raw messages look similar to this: command arg1 arg2 :arg3 with spaces :arg4 with spaces :arg5 In a shell environment (e.g. bash), that ...
13
votes
11answers
342 views

Interpret loose ranges

Interpret loose ranges ListSharp is an interpreted programming language that has many features, one of those features is a 1 index based range creator that works like this: You define a range as <...
18
votes
14answers
1k views

Translate number pairs to guitar notes

A guitar fretboard diagram looks like this: ...
23
votes
20answers
3k 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 ...
9
votes
2answers
404 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 <...
26
votes
32answers
4k views

Decode the chmod

Challenge Given a three digit octal permissions number, output the permissions that it grants. chmod On UNIX OSes file permissions are changed using the chmod ...
30
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-...
11
votes
2answers
354 views

What's on the TV?

Challenge Write a program which, using the XML data from the site here, display the name of the programme which is currently showing on BBC 1. Information All times are given at London time (GMT+1 ...
6
votes
2answers
365 views

Number Plate Golf: Parsing

See Also: Recognition Introduction You've now been taken off the speed camera development team (let's face it, your code is nowhere near production code standards) and are now working on a program ...
18
votes
23answers
2k views

Quick Golf: The Gold Leader

Challenge Using data from the API here, output the names of the three countries with the most Olympic gold medals at the 2016 Rio Olympic Games (i.e. the first element of the returned list). For ...
75
votes
82answers
10k views

Count of “a”s and “b”s must be equal. Did you get it computer?

In the popular (and essential) computer science book, An Introduction to Formal Languages and Automata by Peter Linz, the following formal language is frequently stated: mainly because this language ...
9
votes
3answers
293 views

Parse and Process the Key-Language Input

Let's parse and process Key-Language! Given the input of a sequence of keyboard keypresses and/or special keys, write a program, function, etc. that outputs the product when all the actions are ...
18
votes
36answers
2k views

What's the second non-repeating character?

Based on this question from Code Review Given a non-empty string of printable ASCII characters, output the second non-repeating character. For example, for input ...
19
votes
4answers
342 views

Convert an Expression to Panfix Notation

I was browsing esolangs, and chanced upon this language: https://github.com/catseye/Quylthulg. One interesting thing about this language, is that it doesn't use prefix, postfix, or infix, it uses all ...
27
votes
7answers
882 views

Decode a Microsoft MS-DOS 5.0 FAT directory entry

The Microsoft FAT file system has a directory table to represent which "files" are in which "folders" on the disk. For the time, these entries crammed a lot of information into a small amount of bits. ...
16
votes
11answers
739 views

Is my emoji dry?

This is my pet emoji, Billy: -_- Emojis don't like to be in the rain, so Billy is sad... Let's draw him an umbrella to make him feel better! ...
4
votes
5answers
315 views

Is the gas lighter than air?

Air balloons need a gas that is lighter than air. However, hydrogen is flammable, while helium is not sustainable, so we need a replacement! You must write code that determines whether any given gas ...
13
votes
1answer
320 views

Parse a 1D language

Given a string containing only 0's 1's, 2's and brackets, output the grammar tree of the string. A 2 requires 2 arguments - one to the left and one to the right A ...
16
votes
1answer
589 views

Convert ASCII box drawing into Unicode

I am shamelessly posting a request for something I would actually find useful. The task is to take an arbitrary ascii box drawing like this ...
2
votes
1answer
271 views

Find the last three words of each paragraph if they are shorter than 20 characters in total

Based on my SO question, but more specifically: Find a RegEx such that, given a text where paragraphs end with an empty line (or $ at the very end), match the up ...
31
votes
9answers
5k views

Remove unnecessary parentheses

You are given a string composed with the characters 0123456789+*(). You can assume that string is always a valid mathematical expression. Your task is to remove ...
8
votes
16answers
1k views

Traveling on a flat Earth

Coordinates in the flat-Earth world consist of latitude (x) and longitude (y), which are integers in the range 0...9999. Much like Gaussian integers, but they are always written using this notation: <...
8
votes
9answers
387 views

Create a Boolean parser (continued)

Continuation of this challenge because the author is gone and the question is closed. What you need to do is create a Boolean parser. Boolean expressions, in case you haven't heard of them yet, have ...
13
votes
3answers
302 views

How many 14ers did I climb?

In mountaineering terminology, a "14er" is any mountain with an elevation of 14 000 feet or more. However, there is another distinction. For a peak to count as a 14er, it must also have a "geographic ...