Skip to main content
added 536 characters in body
Source Link
user202729
  • 17.6k
  • 14
  • 17

I decide to change the statement a little, so people who don't know the language can easily understand the challenge. (apparently there are many)


Background:

  • I'm thinking about scraping some BF programs on this site for the fastest-code (or approximation) version of the other challenge, and I figure out that I need to have this, and I post it here as a code-golf challenge since it's somewhat interesting (and also pretty easy).
  • It's possible to force programs to check if there are any extra characters too; however it might make the problem harder (only allow printable ASCII? Some scraped data might have non-ASCII characters, so it isn't really practical. Any Unicode characters as input? Most esoteric languages can't handle that.)

Does this BF program have a simple memory layout?

Given a string consisting of only the characters +-[]<>., check if:

  • All pairs of [] are matching (balanced), and
  • There's an equal number of < and > between every matching pair of [].

Background: the inputs that this program output true are exactly the valid inputs for the related challenge BF memory layout optimizer.

Reference implementation in Python 3.

Example input/output

Output true:

,>>, ,<++[->>+<<] +<><>+ ,[.,] >.< 

Output false:

,[>,] +[>>>->-[>->----<<<]>>]>.---.>+..+++.>>.<.>>---.<<<.+++.------.<-.>>+. ].[ 

Undefined behavior: (your program can do anything when given those as input)

((((()()()()()){}){}){}()) $\="=".hex.$/ \!$/'?))='%<\..> 

I decide to change the statement a little, so people who don't know the language can easily understand the challenge. (apparently there are many)


Background:

  • I'm thinking about scraping some BF programs on this site for the fastest-code (or approximation) version of the other challenge, and I figure out that I need to have this, and I post it here as a code-golf challenge since it's somewhat interesting (and also pretty easy).
  • It's possible to force programs to check if there are any extra characters too; however it might make the problem harder (only allow printable ASCII? Some scraped data might have non-ASCII characters, so it isn't really practical. Any Unicode characters as input? Most esoteric languages can't handle that.)

Does this BF program have a simple memory layout?

Given a string consisting of only the characters +-[]<>., check if:

  • All pairs of [] are matching (balanced), and
  • There's an equal number of < and > between every matching pair of [].

Example input/output

Output true:

,>>, ,<++[->>+<<] +<><>+ ,[.,] >.< 

Output false:

,[>,] +[>>>->-[>->----<<<]>>]>.---.>+..+++.>>.<.>>---.<<<.+++.------.<-.>>+. ].[ 

Undefined behavior: (your program can do anything when given those as input)

((((()()()()()){}){}){}()) $\="=".hex.$/ \!$/'?))='%<\..> 

I decide to change the statement a little, so people who don't know the language can easily understand the challenge. (apparently there are many)


Background:

  • I'm thinking about scraping some BF programs on this site for the fastest-code (or approximation) version of the other challenge, and I figure out that I need to have this, and I post it here as a code-golf challenge since it's somewhat interesting (and also pretty easy).
  • It's possible to force programs to check if there are any extra characters too; however it might make the problem harder (only allow printable ASCII? Some scraped data might have non-ASCII characters, so it isn't really practical. Any Unicode characters as input? Most esoteric languages can't handle that.)

Does this BF program have a simple memory layout?

Given a string consisting of only the characters +-[]<>., check if:

  • All pairs of [] are matching (balanced), and
  • There's an equal number of < and > between every matching pair of [].

Background: the inputs that this program output true are exactly the valid inputs for the related challenge BF memory layout optimizer.

Reference implementation in Python 3.

Example input/output

Output true:

,>>, ,<++[->>+<<] +<><>+ ,[.,] >.< 

Output false:

,[>,] +[>>>->-[>->----<<<]>>]>.---.>+..+++.>>.<.>>---.<<<.+++.------.<-.>>+. ].[ 

Undefined behavior: (your program can do anything when given those as input)

((((()()()()()){}){}){}()) $\="=".hex.$/ \!$/'?))='%<\..> 
deleted 4 characters in body
Source Link
user202729
  • 17.6k
  • 14
  • 17

I decide to change the statement a little, so people who don't know the language can easily understand the challenge. (apparently there are many)


Background:

  • I'm thinking about scraping some BF programs on this site for the fastest-code (or approximation) version of the other challenge, and I figure out that I need to have this, and I post it here as a code-golf challenge since it's somewhat interesting (and also pretty easy).
  • It's possible to force programs to check if there are any extra characters too; however it might make the problem harder (only allow printable ASCII? Some scraped data might have non-ASCII characters, so it isn't really practical. Any Unicode characters as input? Most esoteric languages can't handle that.)

Does this BF program have a simple memory layout?

Given a BF programstring consisting of only the characters +-[]<>., check if:

  • All pairs of [] are matching (balanced), and
  • There's an equal number of < and > between every matching pair of [].

Example input/output

Output true:

,>>, ,<++[->>+<<] +<><>+ ,[.,] >.< 

Output false:

,[>,] +[>>>->-[>->----<<<]>>]>.---.>+..+++.>>.<.>>---.<<<.+++.------.<-.>>+. ].[ 

Undefined behavior: (your program can do anything when given those as input)

((((()()()()()){}){}){}()) $\="=".hex.$/ \!$/'?))='%<\..> 

Background:

  • I'm thinking about scraping some BF programs on this site for the fastest-code (or approximation) version of the other challenge, and I figure out that I need to have this, and I post it here as a code-golf challenge since it's somewhat interesting (and also pretty easy).
  • It's possible to force programs to check if there are any extra characters too; however it might make the problem harder (only allow printable ASCII? Some scraped data might have non-ASCII characters, so it isn't really practical. Any Unicode characters as input? Most esoteric languages can't handle that.)

Does this BF program have a simple memory layout?

Given a BF program consisting of only the characters +-[]<>., check if:

  • All pairs of [] are matching (balanced), and
  • There's an equal number of < and > between every matching pair of [].

Example input/output

Output true:

,>>, ,<++[->>+<<] +<><>+ ,[.,] >.< 

Output false:

,[>,] +[>>>->-[>->----<<<]>>]>.---.>+..+++.>>.<.>>---.<<<.+++.------.<-.>>+. ].[ 

Undefined behavior: (your program can do anything when given those as input)

((((()()()()()){}){}){}()) $\="=".hex.$/ \!$/'?))='%<\..> 

I decide to change the statement a little, so people who don't know the language can easily understand the challenge. (apparently there are many)


Background:

  • I'm thinking about scraping some BF programs on this site for the fastest-code (or approximation) version of the other challenge, and I figure out that I need to have this, and I post it here as a code-golf challenge since it's somewhat interesting (and also pretty easy).
  • It's possible to force programs to check if there are any extra characters too; however it might make the problem harder (only allow printable ASCII? Some scraped data might have non-ASCII characters, so it isn't really practical. Any Unicode characters as input? Most esoteric languages can't handle that.)

Does this BF program have a simple memory layout?

Given a string consisting of only the characters +-[]<>., check if:

  • All pairs of [] are matching (balanced), and
  • There's an equal number of < and > between every matching pair of [].

Example input/output

Output true:

,>>, ,<++[->>+<<] +<><>+ ,[.,] >.< 

Output false:

,[>,] +[>>>->-[>->----<<<]>>]>.---.>+..+++.>>.<.>>---.<<<.+++.------.<-.>>+. ].[ 

Undefined behavior: (your program can do anything when given those as input)

((((()()()()()){}){}){}()) $\="=".hex.$/ \!$/'?))='%<\..> 
added 11 characters in body
Source Link
user202729
  • 17.6k
  • 14
  • 17

Background:

  • I'm thinking about scraping some BF programs on this site for the fastest-code (or approximation) version of the other challenge, and I figure out that I need to have this, and I post it here as a code-golf challenge since it's somewhat interesting (and also pretty easy).
  • It's possible to force programs to check if there are any extra characters too; however it might make the problem harder (only allow printable ASCII? Some scraped data might have non-ASCII characters, so it isn't really practical. Any Unicode characters as input? Most esoteric languages can't handle that.)

Does this BF program have a simple memory layout?

Given a BF program consisting of only the characters +-[]<>., check if:

  • All pairs of [] are matching (balanced), and
  • There's an equal number of < and > between every matching pair of [].

Example input/output

Output true:

,>>, ,<++[->>+<<] +<><>+ ,[.,] >.< 

Output false:

,[>,] +[>>>->-[>->----<<<]>>]>.---.>+..+++.>>.<.>>---.<<<.+++.------.<-.>>+. ].[ 

Undefined behavior: (your program can do anything when given those as input)

((((()()()()()){}){}){}()) $\="=".hex.$/ \!$/'?))='%<\..> 

Background:

  • I'm thinking about scraping some BF programs on this site for the fastest-code (or approximation) version of the other challenge, and I figure out that I need to have this, and I post it here as a code-golf challenge since it's somewhat interesting (and also pretty easy).
  • It's possible to force programs to check if there are any extra characters too; however it might make the problem harder (only allow printable ASCII? Some scraped data might have non-ASCII characters, so it isn't really practical. Any Unicode characters as input? Most esoteric languages can't handle that.)

Does this BF program have a simple memory layout?

Given a BF program consisting of only the characters +-[]<>., check if:

  • All pairs of [] are matching, and
  • There's an equal number of < and > between every matching pair of [].

Example input/output

Output true:

,>>, ,<++[->>+<<] +<><>+ ,[.,] >.< 

Output false:

,[>,] +[>>>->-[>->----<<<]>>]>.---.>+..+++.>>.<.>>---.<<<.+++.------.<-.>>+. ].[ 

Undefined behavior: (your program can do anything when given those as input)

((((()()()()()){}){}){}()) $\="=".hex.$/ \!$/'?))='%<\..> 

Background:

  • I'm thinking about scraping some BF programs on this site for the fastest-code (or approximation) version of the other challenge, and I figure out that I need to have this, and I post it here as a code-golf challenge since it's somewhat interesting (and also pretty easy).
  • It's possible to force programs to check if there are any extra characters too; however it might make the problem harder (only allow printable ASCII? Some scraped data might have non-ASCII characters, so it isn't really practical. Any Unicode characters as input? Most esoteric languages can't handle that.)

Does this BF program have a simple memory layout?

Given a BF program consisting of only the characters +-[]<>., check if:

  • All pairs of [] are matching (balanced), and
  • There's an equal number of < and > between every matching pair of [].

Example input/output

Output true:

,>>, ,<++[->>+<<] +<><>+ ,[.,] >.< 

Output false:

,[>,] +[>>>->-[>->----<<<]>>]>.---.>+..+++.>>.<.>>---.<<<.+++.------.<-.>>+. ].[ 

Undefined behavior: (your program can do anything when given those as input)

((((()()()()()){}){}){}()) $\="=".hex.$/ \!$/'?))='%<\..> 
added 9 characters in body
Source Link
user202729
  • 17.6k
  • 14
  • 17
Loading
added 1 character in body
Source Link
user202729
  • 17.6k
  • 14
  • 17
Loading
Source Link
user202729
  • 17.6k
  • 14
  • 17
Loading