Stack Exchange Network

Stack Exchange network consists of 174 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.

1
vote
0answers
52 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 ...
7
votes
1answer
296 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,...
12
votes
5answers
241 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 ...
12
votes
3answers
253 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
246 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 ...
4
votes
0answers
214 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 ...
17
votes
10answers
590 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
183 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 ...
14
votes
23answers
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
200 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 ...
1
vote
0answers
337 views

Is it a valid number theory expression?

A number theory expression contains: ...
12
votes
0answers
364 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 <...
22
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 ...
14
votes
6answers
445 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
329 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 ...
7
votes
3answers
186 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
314 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, ...
20
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 ...
20
votes
5answers
700 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
785 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
181 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
702 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
817 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
554 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
2k 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
517 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
482 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
606 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
968 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
513 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 - ...
22
votes
5answers
827 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 ...
36
votes
15answers
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 ...
7
votes
3answers
316 views

Identify the direction of lines in an ASCII-figure

Challenge: Take a rectangular figure consisting of the two characters # and (whitespace, ASCII-32), and identify which ...
20
votes
22answers
1k views

Simplify matrix input!

I have written a few challenges related to matrices, and common for all are that I use a format like the one below when representing the matrices, both in examples and in test cases: ...
24
votes
10answers
962 views

Convert a TIO answer to a CMC answer

Let's for once do something useful. Given the text from a Try It Online codegolf submission, produce the equivalent Chat Mini Challenge submission, which is of the form ...
18
votes
11answers
1k views

Swep tha vowels!

Note: the title was misspelled intentionally. Given a string s, swap the first vowel runs of every 2 words. For this challenge, y is considered a vowel. For example, given an input of "great day sir"...
5
votes
1answer
873 views

Regular expression parser

This task is a classic programming task: Implement a regular expression parser. That is, write a program or function which takes a string describing a regular expression and a candidate string, and ...
11
votes
1answer
214 views

I <3 conditionals

You end up having a lot of very long, boring-looking conditionals in your code: if flag == 1: while have != needed: if type == 7: These can be transformed into ...
44
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
974 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
690 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
488 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
102 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 ...
33
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: ...