Questions tagged [parsing]

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

Filter by
Sorted by
Tagged with
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
388 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 ...
36
votes
25answers
4k views

Expand a C array

In the C programming language, arrays are defined like this: int foo[] = {4, 8, 15, 16, 23, 42}; //Foo implicitly has a size of 6 The size of the array is ...
14
votes
10answers
694 views

Determine the type of an input

The challenge is simple: Determine the type of an input, and output an identifier telling what type it is. "UI", Unsigned integer: 0, ...
27
votes
10answers
2k views

Parse a Quaternion

If you don't know already, a quaternion is basically a 4-part number. For the purposes of this challenge, it has a real component and three imaginary components. The imaginary components are ...
12
votes
4answers
1k views

Solve a Linear Equation

This challenge but with a better spec. Spec Your program will take a linear equation containing a single variable x and output the value of ...
2
votes
1answer
592 views

Translate Java methods to fields

So, recently, I found myself reformatting my code for Vitsy to using anonymous class instances for commands rather than the normal method approach. For those who don't know, anonymous class instance ...
-5
votes
4answers
279 views

Solve an algebraic expression

The Challenge Your task is to create a program that can solve an algebraic equation. Input Input will consist of a String. The string will be an equality ...
4
votes
3answers
122 views

Symbolic Differentiation of Composed Functions

Symbolic Differentiation 2: Back on the Chain Gang Task Write a program that takes in a certain sort of function from stdin and differentiates it with respect to x, using the chain rule.* The input ...
30
votes
25answers
4k views

Robot on a ladder

Background I have a ladder leaning on a wall, and a remote-controlled robot that can climb it. I can send three different commands to the robot: UP: the robot ...
46
votes
26answers
5k views

Translate oOo CODE

Given an input of a program written in oOo CODE, output the BF code that it represents. Here is a short description of how oOo CODE works: First, all non-alphabetic characters are removed (...
30
votes
20answers
1k views

Locate and rotate

The task This is a simple challenge. Your input is a single non-empty string, containing only digits 0123456789 and hashes #. ...
13
votes
1answer
499 views

Resolve SAS macro variables

The SAS programming language is a clunky, archaic language dating back to 1966 that's still in use today. The original compiler was written in PL/I, and indeed much of the syntax derives from PL/I. ...
11
votes
4answers
1k views

What character is that HTML entity?

The goal is really simple. Receiving a string as input, parse all the HTML entities that correspond to the following characters (including their uppercase variants): ...
21
votes
8answers
505 views

Read a retro display

Art stolen from What size is the digit? 7-segment digits can be represented in ASCII using _| characters. Here are the digits ...
16
votes
5answers
198 views

Parse nested digit-lead strings

The task A string S is constructed with the following process: Start with S being the empty string. Insert at some position of ...
17
votes
6answers
536 views

Translate a Glypho program

Given an input of any valid Glypho program, output its "human-readable" counterpart. Glypho is an interesting esolang idea: The instruction reference is given here. For each instruction, the ...
17
votes
4answers
2k views

What's the Language?

Recently, the PPCG design leaderboard has been having some trouble parsing answer html headers. In this challenge you'll be taking your own shot at parsing answer headers. Example Test Cases These ...
6
votes
0answers
148 views

Implement FBLint

(FB, or Functional-Basic, as found here Interpret Functional-Basic) Task Implement a linting program for FB, similar to JSLint for JavaScript. Error types Invalid identifier Identifiers can only ...
18
votes
6answers
752 views

Parse RNA into codons

Introduction RNA is the less famous cousin of DNA. Its main purpose is to control the production of proteins in cells through a process called translation. In this challenge, your task is to ...
14
votes
4answers
506 views

Make a simple pretty-comment tool

Challenge: Some ascii-art is a pain to make, but makes code comments easier to read, especially when the code is dense. The challenge is to make a simple tool that converts comments to simple ascii-...
10
votes
2answers
242 views

The absent-minded linguist

Background Your friend, a linguist, has recorded and analyzed some simple conversation snippets in various languages. Being quite absent-minded, they have forgotten which language each snippet was in....
15
votes
3answers
449 views

Tokenize a Stack-Based language

I've been working on another stack-based golfing language called Stackgoat. In this challenge you'll be writing a Tokenizer for Stackgoat (or really any general stack-based languages). Examples <...
11
votes
6answers
443 views

Can a fraction be simplified using Anomalous Cancellation?

Anomalous Cancellation (from Wolfram Alpha): Anomalous cancellation is a "canceling" of digits of a and b in the numerator and denominator of a fraction a/b which results in a fraction equal to the ...
8
votes
2answers
231 views

In a string or not?

Recently I've been having some trouble with the new TeaScript interpreter. The biggest problem is identifying whether or not a string contains any special characters. Challenge A special character ...
8
votes
8answers
422 views

Is it an integer, a string, or a decimal?

Your challenge is to determine whether the given input is an integer, a string, or a decimal. Rules A string is any input that is not an integer or a float An integer must contain only numeric ...
12
votes
3answers
370 views

Recreate the sentence

This challenge consists of two parts. The winner will be the solution with the lowest total byte count. The same language must be used for both challenges. Part 1: Write a function or program that ...
21
votes
1answer
491 views

Count common Game of Life patterns

The task here is to read from a Golly .rle or plaintext file (your choice) whose filename is provided (on STDIN or as a command line argument) and identify and ...
10
votes
0answers
404 views

Please parse this aLL1en language

Background Due to some unfortunate accident during coding you are now teleported and stranded on an alien planet. You really hope that the locals will be helpful and point to the general direction of ...
29
votes
10answers
1k views

Santa's Decision

Santa's Decision: In this challenge, you will help Santa Claus decide whether somebody on their list has been naughty or nice, and subsequently get coal or ...
19
votes
31answers
1k views

Mixed Number to an Improper Fraction

Mixed Number to an Improper Fraction In this challenge you will be converting a mixed number to an improper fraction. Because improper fractions use fewer numbers, your code will need to be as short ...
21
votes
2answers
803 views

Symbolic Integration of Polynomials

Apply an indefinite integral to a given string. The only rules you will be using are defined as such: ∫cx^(n)dx = (c/(n+1))x^(n+1) + C, n ≠ -1 c, C, and n are all constants. Specifications: You ...
25
votes
5answers
841 views

Parse a two-dimensional syntax

Background Alice and Bob are creating a golfing language to win every single PPCG challenge. Alice wants to make a two-dimensional language, like ><>, but Bob prefers a prefix-infix syntax like in ...
8
votes
7answers
496 views

Convert between SI prefixes

Introduction The International System of Units is a system of measuring all around the world, except for a few countries including the US. The SI system (or metric system) is based on powers of ten, ...
70
votes
23answers
7k views

Well that's odd… no wait, that's even!

Preamble Integers are always either even or odd. Even integers are divisible by two, odd integers are not. When you add two integers you can infer whether the result will be even or odd based on ...
10
votes
1answer
285 views

Black Friday Queue Managment

Introduction You are the manager of the electronics department in a major retail store and the biggest sales day of the year is this Friday. To help manage the crowds, your store is implementing a ...
17
votes
1answer
667 views

Drawing Lewis Structures of Alkanes

I just had a lesson in school about alkanes and figured it would probably make for a great code golf challenge! Don't worry, it isn't as complicated as it may look! A Quick Rehash (Please Note: To ...
15
votes
3answers
704 views

Help me manage my time

I have been recently told to read an entire physics textbook by the new year (true story, unfortunately). I need your help to determine what chapters I should read each day. This is where you come in. ...
9
votes
5answers
530 views

DCSS morgue file parser

In this challenge, you need to parse morgue files from the roguelike game Dungeon Crawl Stone Soup and output it to STDOUT. What are these morgue files?? When you die, a text file is generated with ...
25
votes
9answers
1k views

De-Parenthesizing a String

Given a properly-parenthesized string as input, output a list of all nonempty substrings within matching parentheses (or outside of all parentheses), with nested parentheses removed. Each substring ...
79
votes
16answers
4k views

Defeat SVGCaptcha

I came across SVGCaptcha, and immediately knew it was a bad idea. I would like you to show just how bad an idea this is by extracting the validation code from the SVG images that code produces. An ...
5
votes
1answer
155 views

Write a Blade Templating Engine

Blade is a PHP templating engine. For this challenge, you only need to implement a modified version one feature -- text replacement. Challenge Description Given an input file and a map of keys to ...
27
votes
4answers
584 views

Reverse a regex

The Challenge Given a valid regex, output a regex that that matches the same set of strings, but reversed. The Task This challenge uses the most basic regex operations: ...
16
votes
1answer
678 views

Who has the most stars in The Nineteenth Byte?

Note: this challenge involves downloading and sifting through HTML webpages. If your language cannot handle this you might not want to participate in this challenge. Introduction There are always ...
72
votes
16answers
14k views

The World's Smallest Web Browser

Backstory: You enjoy your new programming job at a mega-multi-corporation. However, you aren't allowed to browse the web since your computer only has a CLI. They also run sweeps of all employees' ...
2
votes
0answers
77 views

Simple regex parser [duplicate]

Let's parse some regex. Not quite the regex you are used to, but the formal regular expressions taught in courses on automata theory. Wikipedia knows what I'm talking about. We have four operations. ...
30
votes
3answers
1k views

Help! My calculator broke! (Turn integer expression into calculator keystrokes)

Introduction Help! I accidentally dropped my TI-84 calculator out my window (don't ask how) and it broke. I have a math test tomorrow and the only calculator I can find is one with these buttons: <...
24
votes
52answers
2k views

Remove all occurrences of the first letter of a string from the entire string

Given an input string only containing the characters A-Z, a-z, and spaces, remove all occurrences of the uppercase and lowercase ...
19
votes
2answers
785 views

Dames, do some math!

The order of operations, PEMDAS, is a basic rule in mathematics telling us which order operations should be performed: "Parentheses, Exponents, Multiplication and Division, and Addition and ...