Linked Questions

14
votes
19answers
3k views

Fun with Matching Braces [duplicate]

The contest is to make a program or function that takes an arbitrary string resembling source code and checks to see if the "braces" follow the basic rules for brace matching. That is, the number of ...
1
vote
0answers
54 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 ...
25
votes
25answers
2k views

Detect Perfect Pairings

Let's have a function \$f\$ that takes a string and removes all pairs of adjacent identical characters. For example \$f(a\color{red}{bb}ba\color{red}{cc}) = aba\$ Note that when two pairs overlap ...
49
votes
6answers
4k views

Language Design: 2-D Pattern Matching

This is Fortnightly Challenge #6. Theme: Language Design There's a chatroom for this challenge. Come and join us if you want to discuss ideas! And now for something completely different... This ...
19
votes
8answers
2k views

Write a brain-flak classic interpreter!

Brain-Flak (a cross between Brainf**k and Flak-Overstow) is a stack-based esoteric language. Since this challenge was posted, the language has evolved and updated, but this first revision of the ...
19
votes
16answers
1k views

Tips for golfing in sed

What general tips do you have for golfing in sed? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to sed (e.g. "remove comments" is not ...
20
votes
10answers
2k views

Bracket balancing

You will be given a (possibly empty) string containing brackets ([{()}]) and any other characters (A-...
23
votes
6answers
468 views

Appends or Prepends? Depends

Brain-flak turns one year old tomorrow! In honor of it's birthday, we're having a PPCG style birthday party, where several users post brain-flak related questions! Help us celebrate! :) Brain-flak is ...
5
votes
11answers
1k views

Recursion bracketed; or Dyck words generation

We already have challenges to check if a string of brackets is fully matched and to count the number of balanced strings. It remains for us to generate these strings, but it will not be so easy… A ...
27
votes
5answers
561 views

Bubble the brackets!

There are a few questions on this site about balancing brackets, and checking whether brackets are balanced. I propose it's now time to use those balanced brackets for something! In mathematics and ...
14
votes
5answers
391 views

Generate all Brain-Flak Snippets

This question is the second of several Brain-flak Birthday challenges designed to celebrate Brain-Flak's first Birthday! You can find more information about Brain-Flak's Birthday here Challenge For ...
3
votes
17answers
754 views

Is there an unmatched parenthesis in this String?

Introduction Given a String containing an arithmetic expression, your task is to output a truthy or falsey value based on whether it contains unmatched parentheses. Input Your program should take ...
28
votes
1answer
674 views

Unrestricted Languages

One of my favorite types of challenges on this site are restricted-source challenges. These challenges impose a computer tractable restriction that the sources of potential answers must pass. I like ...