We’re rewarding the question askers & reputations are being recalculated! Read more.

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

Shorthand Combined Functions

I was doing some investigation into trig functions using compound angles recently, and noticed that the results are really long and tedious to write: $$ \cos(A+B) = \cos A \cos B - \sin A \sin B \\ \...
12
votes
8answers
440 views

Output integer given a digital clock style input

Input _ _ _ _ _ _ _ _ | _| _||_||_ |_ ||_||_|| | ||_ _| | _||_| ||_| _||_| output 1234567890 Rules ...
10
votes
1answer
294 views

Duct Tape a Regex Decider

Your task is to create a program that determines whether a given string is a valid regular expression or not using code snippets sourced from sites on the StackExchange network. For the purposes of ...
10
votes
1answer
219 views

Interpreter for number theory, modulo n

A sentence of number theory (for our purposes) is a sequence of the following symbols: 0 and ' (successor) - successor means <...
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: ...
12
votes
8answers
653 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 ...
18
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 ...
27
votes
27answers
4k views

Parse a C++14 integer literal

According to http://en.cppreference.com/w/cpp/language/integer_literal, integer literals consist of a decimal/hex/octal/binary literal and a optional integer suffix, that is obviously completely ...
8
votes
8answers
554 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 ...
14
votes
14answers
1k views

Multiply Two Integer Polynomials

Your task is to take two single-variable integer polynomial expressions and multiply them into their unsimplified first-term-major left-to-right expansion (A.K.A. FOIL in the case of binomials). Do ...
6
votes
5answers
642 views

Gotta Collect 'Em All

Your task here will be to write a very dumb AI capable of fetching all treasures on a map. Map The map is defined as follow: (artist-mode™-powered) Basic case: <...
11
votes
31answers
791 views

Sum integers in a string

Input A string. Output The sum of all integers in the line. Constraints 1≤Length of line≤500 Sample test Case Input the 5is 108 seCONd4 a Output ...
17
votes
4answers
1k views

What have we got?

Inspired by, and in memory of, our beloved genius, R.I.P. He invented and implemented dfns — his magnum opus and the subject of the challenge. For the interested: latest full dfns documentation and ...
1
vote
0answers
55 views

Bracket checking [duplicate]

Consider a string like: a.push(c.push("a",["ad","bd",2,{"ard",duo}]).pop().replace(2,"tg").enc([3,{2,adf},"atr"],5) Write a program that will verify whether a ...
8
votes
1answer
374 views

Fully Modular C: Grading

You are a Computer Science professor teaching the C programming language. One principle you seek to impart to the students is modularity. Unfortunately, past classes have tended not to get the message,...
14
votes
5answers
294 views

Conjugation in Real Life

In @Adám's Dyalog APL Extended, the (under) operator means conjugation: apply one function, then a second function, then the inverse of the first. It's fun to ...
13
votes
3answers
272 views

Unminify a Pythlike String

Pyth is perhaps the most successful general-purpose golfing language. Though it is somewhat in decline as a result of newer languages, from 2014 to 2016 Pyth's concise syntax, constant updates, ...
10
votes
0answers
278 views

Captcha Capture [closed]

Captchas aren't meant to be machine-readable, and that's terrible. It is time to end this obvious bout of unfounded hatred for machines just trying to let you know about great deals on ṗḧ@ṛḿ4ćëüẗ1ċäḷṡ ...
41
votes
12answers
4k 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
7answers
485 views

Transpile Brainstract to Brainfuck

Introduction Brainstract, a newly created dialect of Brainfuck adds a bit more elements to the syntax. In addition to the normal Brainfuck syntax, there are macros. To define a macro: ...
4
votes
0answers
222 views

Simulate Casio S-VPAM calulator [closed]

It is 20th anniversary of Casio's S-VPAM calculators and it is worth celebrating. Task: Process input string as Casio S-VPAM calculator does. The infix notation and precedence of mathematical ...
18
votes
10answers
643 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 ...
6
votes
2answers
190 views

What associativity was it again

Non-associative operators (for example the subtraction-operator) often are either left- or right associative, such that one has to write less parentheses. Consider for example the following: $$ a-b-c ...
14
votes
10answers
1k views

Decoding the Kaadi system

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 ...
17
votes
26answers
2k views

Elixir Array Syntactic Sugar

In Elixir, (linked) lists are in the format [head | tail] where head can be anything and tail is a list of the rest of the list, and ...
-5
votes
5answers
219 views

Get the number of images on a webpage [closed]

Recreational languages win at code golf too much. This challenge is simple, when using higher level functions. The task is as follows: Given any valid url, which is guaranteed to result in a valid ...
2
votes
0answers
402 views

Is it a valid number theory expression?

A number theory expression contains: ...
11
votes
0answers
575 views

Complement of a Regex

For the purposes of this challenge, we define a postfix regex dialect with alphabet {1, 0} and the following operations: 1 and <...
20
votes
24answers
2k views

Ten-pin bowling score - World Bowling edition

World Bowling scoring Many people have gone to their local bowling center to play a few games of bowling, and many people continue to struggle to calculate their scores. World Bowling has introduced ...
16
votes
6answers
483 views

Panfix to parenthesized infix

Quylthulg is a language by Chris Pressey that attempts to solve the problem of infix notation using what it calls panfix: like postfix, panfix does not require the deployment of arcane contrivances ...
-6
votes
5answers
351 views

Write a bullet-proof “Atof” [closed]

Write a bullet-proof "Atof" Atof (Array to float) is a function that every language has to have. (K&R: Atof in chapter 4.2 ...
6
votes
3answers
228 views

Of Dumps and Cubes, and Structured Nonsense

Your challenge is to translate a Cubically cube-dump to the format specified in this challenge. Input The input will represent a Rubik's Cube, formatted how Cubically prints its memory cube at the ...
11
votes
3answers
351 views

Same Name, Lame!

Write a function or program that, when given a list of names, outputs or returns a list where duplicates of given names have a unique shortened version of their surname. Input: A list of names, ...
21
votes
56answers
5k views

Compare two numbers given as strings

I have a problem at work. I need to compare two numbers that come as strings from two different databases. The numbers may come with leading zeroes and/or leading/trailing spaces. So I may have ...
21
votes
5answers
730 views

Convert a HTML page into a mountain

Task: convert a HTML page into a mountain! When HTML pages are indented, they can look like: ...
10
votes
9answers
800 views

R[oman|everse] Polish Notation

It is the year MDLXVII in a world in which the Roman Empire never fell, and the collapse into the dark ages never occurred. Due to the extended period of Pax Romana, the empire's economic stability ...
3
votes
0answers
200 views

2017 SCRAM Finder

Background The nuclear industry has term, SCRAM, used to describe a quick shutdown of the reactor. There's a fun myth that it stands for "Safety Control Rod Ax Man," the role which served to shut ...
24
votes
14answers
1k views

Parse the Parcel

Thanks to your help in the Mark My Mail challenge, PPCG-Post has successfully stamped all of its parcels with the generated barcodes! Now, it's time to decode them. In this challenge your program ...
16
votes
15answers
720 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...
19
votes
4answers
857 views

Clearly parenthesize APL trains

In APL, you can write tacit functions, called trains. How they work is irrelevant for this challenge. Here are the different ways they can be grouped, using as ...
7
votes
3answers
813 views

The Missing Number - Version 2

Background: This question is a remix of the one that I made previously on this forum. The only difference with this one is: the range is significantly larger, AND dynamic. Details below! Also, I'm ...
22
votes
3answers
3k views

The Missing Number Revised

Background: I originally posted this question last night, and received backlash on its vagueness. I have since consulted many personnel concerning not only the wording of the problem, but also its ...
21
votes
25answers
3k views

Parse my Esperanto!

The famous constructed language Esperanto uses the Latin alphabet (mostly, see the linked wikipedia page for details). However, there are some characters with accents: ĉ, ĝ, ĥ, ĵ, ŝ, and ŭ. (C-...
20
votes
16answers
1k views

Simple markdown rendering

There are several ways to create headers on posts on the Stack Exchange network. The format that's most commonly1 used on PPCG seems to be: ...
9
votes
13answers
520 views

Expand Comparison Chains

Unlike most languages, Python evaluates a<b<c as it would be done in mathematics, actually comparing the three numbers, as opposed to comparing the boolean <...
17
votes
3answers
492 views

Exponentiation to multiplication to addition

Multiplication between 2 integers can be reduced into a series of addition like so 3 * 5 = 3 + 3 + 3 + 3 + 3 = 5 + 5 + 5 Exponentiation (raising a to the power b)...
10
votes
3answers
617 views

Exact Cover Puzzle

CHALLENGE Given a set of grouped letters, arrange them onto the board so that they cover the area entirely. Board Representation (a.k.a. the SHIP DECK) The board is a 6x6 grid. There will always be ...
9
votes
14answers
977 views

Increasing, decreasing, none or all?

Take two inputs, a non-empty vector/list containing digits 1 and 2 and a string (no, you may not take ...
7
votes
3answers
522 views

Logical Order of Operations

Task Given an input, evaluate it as a mathematical equation following the order of operations. But, instead of the using PEMDAS, we drop the parentheses and exponentiation and introduce spaces - ...
23
votes
5answers
870 views

Complex Dice Rolling Expressions

Background I play D&D on a regular basis with some friends. While talking about the complexity of some systems/versions when it comes to rolling dice and applying bonuses and penalties, we ...