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
7
votes
4answers
162 views

Split along groups (hard mode)

This is an alternate version of this earlier challenge with a twist that adds a significant bit of difficulty. Like last time, you are going to be given a string containing some alphabetic characters ...
17
votes
8answers
430 views

Split along groups

You are going to be given a string containing some alphabetic characters along with [ and ]. Your task is to split into ...
37
votes
19answers
4k views

Code Romanization

The challenge is to make any Roman numerals valid code in your chosen language. They should not appear inside of strings or anything similar, but work just like any other tokens, literals such as (...
13
votes
10answers
640 views

AoCG2021 Day 20: Wonky license check

Part of Advent of Code Golf 2021 event. See the linked meta post for details. Related to AoC2018 Day 8. The license file for an imaginary software system is defined as follows: The entire file is a ...
18
votes
10answers
783 views

Decrypt the extended Wechsler format

This challenge is based on a sandbox post by user48538. Since he is no longer active on this site, I took over this challenge. apgsearch, the distributed soup search program for Conway's Game of Life ...
13
votes
16answers
871 views

AoCG2021 Day 11: Garbageful streams

Part of Advent of Code Golf 2021 event. See the linked meta post for details. Related to AoC2017 Day 9. Weekends are Bubbler's days off from posting these lol A large stream blocks your path. ...
10
votes
3answers
254 views

Is it a valid line in "Girls & Boys"?

Intro Blur's song Girls & Boys featured the lines girls who are boys who like boys to be girls who do boys like they're girls, who do girls like they're boys ...
14
votes
15answers
949 views

Fully matched numbers

For the context of this challenge, a matched group is a digit \$n\$, followed by \$n\$ more matched groups. In the case of \$n = 0\$, that's the whole matched group. Digits only go up to 9. For ...
28
votes
29answers
2k views

Open or Close the Parentheses

Every phone needs a calculator app. Because of the limited screen real estate, the developer of mine has decided to save some buttons. Instead of having two dedicated bracket buttons - one for open <...
20
votes
30answers
2k views

Remove oddly nested substrings

Task: Input will consist of some text, with nested [] separating some of it into nested groups: ...
11
votes
16answers
850 views

Cartesian literal notation

Introduction In computer science, a literal is a notation for representing a fixed value in source code. Almost all programming languages have notations for atomic values, some also have notations ...
26
votes
21answers
2k views

Convert prefix to infix

Infix notation is a method of printing mathematical expressions where each operator sits between its two arguments, such as \$ \left(5 \cdot 4\right) + 3 \$. Prefix notation is a method of printing ...
2
votes
2answers
101 views

Tips for parsing Standard Input in JavaScript

I've been doing quite a few code golf recently and I realised that a lot of times, I have to do something involving list. Most of the times lists are space-separated or comma-separated values in the ...
17
votes
12answers
1k views

How many values of this type?

Background The number of values for a given type is called the cardinality of that type, and that of type T is written as |T|. Haskell and a few other languages ...
18
votes
22answers
2k views

Parentheses Clusters

Write a program that groups a string into parentheses cluster. Each cluster should be balanced. Examples : ...
14
votes
8answers
962 views

Simplify K projections

Background K functions have a feature called projection, which is essentially partial application of values to a function. The syntax for projections is a natural extension of the regular function ...
28
votes
10answers
2k views

Help Stack Exchange transpose tables

Stack Exchange doesn't know how to transpose tables. Let's help. Given a markdown table, transpose it. Input assumptions: There will be at least two rows (including header) and two columns Either all ...
22
votes
5answers
1k views

Parse a lambda for correctness

The goal of this challenge is to fill a niche that is mostly lacking on this site. In my observations there most parsing verification challenges fall into two categories: Super easy parsing. This ...
24
votes
26answers
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 ...
28
votes
40answers
6k 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. ...
25
votes
17answers
1k views

r flag my Vyxal

Vyxal is a stack-based language, meaning that everything operates by popping and pushing values onto a stack. It has a bunch of useful flags, one of which is r. ...
10
votes
4answers
335 views

Parse Ternary Lambda Calculus for correctness

Wheat Wizard has once tried to come up with a parsing problem unsuitable for regex, but it failed due to Anders Kaseorg's Perl regex answer. This is the second attempt. Now that we know that Perl ...
13
votes
8answers
2k views

Visualize a Risky program

Risky is a new language of mine, which features an interesting form of tacit programming. In this challenge, you'll take a Risky program as input, and visualize the parsing. No knowledge of Risky is ...
19
votes
5answers
833 views

What if function application was right-associative?

Background In Haskell and many other functional languages, function application f(x) is simply written as f x. Also, this form ...
14
votes
8answers
953 views

What is the link to your answer?

Goal Your task is to create a program taking no input that returns the link to your answer. You can find a link to your answer by clicking at the share button on your answer. Rules Standard loopholes ...
13
votes
1answer
858 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 ...
22
votes
36answers
3k views

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 as possible. Examples ...
70
votes
24answers
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 ...
6
votes
3answers
168 views

Distribute the additions!

Challenge: Given an expressions made of additions and multiplications, output an expression that is a sum of products. The output must be equivalent to the input modulo the law of distribution. For ...
11
votes
6answers
469 views

Approx how many search results

When one performs a search query using Google, one of the first things you see is an approximation of how many results were found. Today, you'll be simulating this in as few bytes as possible. Input A ...
12
votes
4answers
569 views

Leave the times out!

Everyone knows, that you can leave out the multiplication symbol (\$\times\$, or *) in a*b ...
3
votes
1answer
746 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 ...
51
votes
11answers
4k views

Write a C++ demangler

If you have ever looked at an objdump of a C++ program, you have likely seen something like this: _ZN3foo3bar3bazI6sampleEE3quxvi3foo This is a C++ mangled symbol, ...
78
votes
92answers
12k 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 ...
160
votes
57answers
41k views

Debunking Stroustrup's debunking of the myth “C++ is for large, complicated, programs only” [closed]

Stroustrup has recently posted a series of posts debunking popular myths about C++. The fifth myth is: “C++ is for large, complicated, programs only”. To debunk it, he wrote a simple C++ program ...
19
votes
11answers
4k views

I'm Lazy: Close my Superparens

Picolisp has a feature called "super parentheses": Brackets ('[' and ']') can be used as super parentheses. A closing bracket will match [all parentheses to and including] the innermost ...
15
votes
14answers
1k views

Evaluation order of an APL n-train

From Codidact with permission. Description APL trains are a series of functions, that get applied to an argument in this way: (f g) x = f g x here ...
50
votes
13answers
5k views

Read out the C variable declaration

Background Variable declaration statement in C consists of three parts: the name of the variable, its base type, and the type modifier(s). There are three kinds of type modifiers: Pointer ...
3
votes
4answers
2k views

Parse a nested parentheses

Objective Mimic Haskell's reads :: ReadS (). Or in other words, parse nested parentheses. Since the target type is () (the type ...
16
votes
22answers
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 ...
9
votes
1answer
270 views

CDGLF: TMN to APL

In this challenge you will remove one of my least favorite features, operator precedence from traditional math notation, to acheive the syntax of one of my favorite languages, APL. The APL subset we ...
69
votes
17answers
15k 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' ...
22
votes
18answers
1k views

Interpret Interval Notation

Interval notation is a way to write complicated range bounds more conveniently and concisely than writing an inequality. The challenge, should you choose to accept it, is to write a program or ...
11
votes
0answers
342 views

Golfing Expressions

We can write mathematical expressions using the standard math operators (,),+,...
18
votes
8answers
821 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 ...
18
votes
9answers
827 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 ...
20
votes
17answers
846 views

Parse a list of signed unary numbers

Unary numbers typically only represent nonnegative integers, but we can extend them to represent all integers as follows: A positive integer N is represented as N 1...
13
votes
12answers
419 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 ...
38
votes
16answers
3k views

Will I tip over?

Overview Given a 3 line string, figure out if the structure falls to the left, balances, or falls to the right. Input structure You can imagine the structure as metal rod with stuff on top, all being ...
17
votes
1answer
577 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....

1
2 3 4 5