Linked Questions

14 votes
19 answers
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 ...
aebabis's user avatar
  • 443
1 vote
0 answers
63 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 ...
Wais Kamal's user avatar
1 vote
0 answers
52 views

Bracket Checker [duplicate]

Given a string of brackets tell the user whether or not the brackets are well matched or not. Brackets include []{}(). For example: ...
Ramen_Lover912's user avatar
24 votes
27 answers
2k 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 ...
Toby Speight's user avatar
  • 6,508
26 votes
25 answers
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 ...
Wheat Wizard's user avatar
  • 100k
52 votes
6 answers
5k 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 ...
PhiNotPi's user avatar
  • 29.1k
19 votes
9 answers
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 ...
DJMcMayhem's user avatar
  • 59.6k
19 votes
10 answers
2k views

Bracket balancing

You will be given a (possibly empty) string containing brackets ([{()}]) and any other characters (A-...
ghosts_in_the_code's user avatar
25 votes
6 answers
542 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 ...
DJMcMayhem's user avatar
  • 59.6k
6 votes
11 answers
2k 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 ...
mlpo's user avatar
  • 179
27 votes
5 answers
678 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 ...
Arthur's user avatar
  • 371
3 votes
17 answers
3k 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 ...
Arjun's user avatar
  • 5,084
10 votes
6 answers
516 views

The Missing Match

You are given a string of unknown length that contains a varied amount of (, {, [ and their ...
code's user avatar
  • 531
14 votes
5 answers
462 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 ...
Riley's user avatar
  • 11.7k
31 votes
1 answer
816 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 ...
Wheat Wizard's user avatar
  • 100k