Skip to main content
Tweeted twitter.com/StackCodeGolf/status/723082073200857088
Post Reopened by CalculatorFeline, Victor Stafusa, wizzwizz4, a spaghetto, Zach Gates
Clarified initial state of bit array
Source Link

I have a new programming language called Brussels-Sprout. Brussels-Sprout functions in an array of 256 boolean values, all initialized to zero, has one instruction pointer, and one "bit index".

After each (non-branching) instruction is executed, the instruction pointer is incremented by one. If the instruction pointer goes off the right side of the instruction array, the program terminates. Going off the left side is undefined behavior.

If the bit index is outside the bounds of the array, it should be reset to 0.

Brussels-Sprout uses the following keywords, which are always lowercase:

chew - Invert the value in the array at the bit index. (flip the bit at the bit index)

swallow - Increment the bit index.

vomit - Decrement the bit index.

complain - Output the bit at the bit index to stdout, or equivalent output log.

feedtodog - If the bit at the bit index is 0, skip the next instruction. Otherwise, increment instruction pointer by 1.

playwithfood - If the bit at the bit index is 1, jump backwards 2 instructions. Otherwise, increment instruction pointer by 1.

If an instruction not on this list is executed, undefined behavior occurs.

I'm sure that this sounds like a very certain other turing-tarpit programming language. But since this programming language operates in boolean values and not bytes, I think it is different.

Test cases:

chew complain -> 1
swallow chew swallow chew swallow vomit complain playwithfood -> 11
chew complain swallow chew complain swallow chew complain swallow complain -> 1110
chew feedtodog undefinedbehaviour complain -> 1

Your challenge is to write an interpreter for Brussels-Sprout. This is code golf, so shortest program wins!

I have a new programming language called Brussels-Sprout. Brussels-Sprout functions in an array of 256 boolean values, has one instruction pointer, and one "bit index".

After each (non-branching) instruction is executed, the instruction pointer is incremented by one. If the instruction pointer goes off the right side of the instruction array, the program terminates. Going off the left side is undefined behavior.

If the bit index is outside the bounds of the array, it should be reset to 0.

Brussels-Sprout uses the following keywords, which are always lowercase:

chew - Invert the value in the array at the bit index. (flip the bit at the bit index)

swallow - Increment the bit index.

vomit - Decrement the bit index.

complain - Output the bit at the bit index to stdout, or equivalent output log.

feedtodog - If the bit at the bit index is 0, skip the next instruction. Otherwise, increment instruction pointer by 1.

playwithfood - If the bit at the bit index is 1, jump backwards 2 instructions. Otherwise, increment instruction pointer by 1.

If an instruction not on this list is executed, undefined behavior occurs.

I'm sure that this sounds like a very certain other turing-tarpit programming language. But since this programming language operates in boolean values and not bytes, I think it is different.

Test cases:

chew complain -> 1
swallow chew swallow chew swallow vomit complain playwithfood -> 11
chew complain swallow chew complain swallow chew complain swallow complain -> 1110
chew feedtodog undefinedbehaviour complain -> 1

Your challenge is to write an interpreter for Brussels-Sprout. This is code golf, so shortest program wins!

I have a new programming language called Brussels-Sprout. Brussels-Sprout functions in an array of 256 boolean values, all initialized to zero, has one instruction pointer, and one "bit index".

After each (non-branching) instruction is executed, the instruction pointer is incremented by one. If the instruction pointer goes off the right side of the instruction array, the program terminates. Going off the left side is undefined behavior.

If the bit index is outside the bounds of the array, it should be reset to 0.

Brussels-Sprout uses the following keywords, which are always lowercase:

chew - Invert the value in the array at the bit index. (flip the bit at the bit index)

swallow - Increment the bit index.

vomit - Decrement the bit index.

complain - Output the bit at the bit index to stdout, or equivalent output log.

feedtodog - If the bit at the bit index is 0, skip the next instruction. Otherwise, increment instruction pointer by 1.

playwithfood - If the bit at the bit index is 1, jump backwards 2 instructions. Otherwise, increment instruction pointer by 1.

If an instruction not on this list is executed, undefined behavior occurs.

I'm sure that this sounds like a very certain other turing-tarpit programming language. But since this programming language operates in boolean values and not bytes, I think it is different.

Test cases:

chew complain -> 1
swallow chew swallow chew swallow vomit complain playwithfood -> 11
chew complain swallow chew complain swallow chew complain swallow complain -> 1110
chew feedtodog undefinedbehaviour complain -> 1

Your challenge is to write an interpreter for Brussels-Sprout. This is code golf, so shortest program wins!

added 8 characters in body
Source Link

I have a new programming language called Brussels-Sprout. Brussels-Sprout functions in an array of 256 boolean values, has one instruction pointer, and one "bit index".

After each (non-branching) instruction is executed, the instruction pointer is incremented by one. If the instruction pointer goes off the right side of the instruction array, the program terminates. Going off the left side is undefined behavior.

If the bit index is outside the bounds of the array, it should be reset to 0.

Brussels-Sprout uses the following keywords, which are always lowercase:

chew - Invert the value in the array at the bit index. (flip the bit at the bit index)

swallow - Increment the bit index.

vomit - Decrement the bit index.

complain - Output the bit at the bit index to stdout, or equivalent output log.

feedtodog - If the bit at the bit index is 0, skip the next instruction. Otherwise, increment instruction pointer by 1.

playwithfood - If the bit at the bit index is 1, jump backwards 2 instructions. Otherwise, increment instruction pointer by 1.

If an instruction not on this list is executed, undefined behavior occurs.

I'm sure that this sounds like a very certain other turing-tarpit programming language. But since this programming language operates in boolean values and not bytes, I think it is different.

Test cases:

chew complain -> 1
swallow chew swallow chew swallow vomit complain playwithfood -> 11
chew complain swallow chew complain swallow chew complain swallow complain -> 1110
chew feedtodog undefinedbehaviour complain -> 1

Your challenge is to write an interpreter for Brussels-Sprout. This is code golf, so shortest program wins!

I have a new programming language called Brussels-Sprout. Brussels-Sprout functions in an array of 256 boolean values, has one instruction pointer, and one "bit index".

After each (non-branching) instruction is executed, the instruction pointer is incremented by one. If the instruction pointer goes off the right side of the instruction array, the program terminates. Going off the left side is undefined behavior.

If the bit index is outside the bounds of the array, it should be reset to 0.

Brussels-Sprout uses the following keywords, which are always lowercase:

chew - Invert the value in the array at the bit index. (flip the bit at the bit index)

swallow - Increment the bit index.

vomit - Decrement the bit index.

complain - Output the bit at the bit index to stdout, or equivalent output log.

feedtodog - If the bit at the bit index is 0, skip the next instruction. Otherwise, increment instruction pointer by 1.

playwithfood - If the bit at the bit index is 1, jump backwards 2 instructions. Otherwise, increment instruction pointer by 1.

If an instruction not on this list is executed, undefined behavior occurs.

I'm sure that this sounds like a very certain other turing-tarpit programming language. But since this programming language operates in boolean values and not bytes, I think it is different.

Test cases:

chew complain -> 1
chew swallow chew swallow vomit complain playwithfood -> 11
chew complain swallow chew complain swallow chew complain swallow complain -> 1110
chew feedtodog undefinedbehaviour complain -> 1

Your challenge is to write an interpreter for Brussels-Sprout. This is code golf, so shortest program wins!

I have a new programming language called Brussels-Sprout. Brussels-Sprout functions in an array of 256 boolean values, has one instruction pointer, and one "bit index".

After each (non-branching) instruction is executed, the instruction pointer is incremented by one. If the instruction pointer goes off the right side of the instruction array, the program terminates. Going off the left side is undefined behavior.

If the bit index is outside the bounds of the array, it should be reset to 0.

Brussels-Sprout uses the following keywords, which are always lowercase:

chew - Invert the value in the array at the bit index. (flip the bit at the bit index)

swallow - Increment the bit index.

vomit - Decrement the bit index.

complain - Output the bit at the bit index to stdout, or equivalent output log.

feedtodog - If the bit at the bit index is 0, skip the next instruction. Otherwise, increment instruction pointer by 1.

playwithfood - If the bit at the bit index is 1, jump backwards 2 instructions. Otherwise, increment instruction pointer by 1.

If an instruction not on this list is executed, undefined behavior occurs.

I'm sure that this sounds like a very certain other turing-tarpit programming language. But since this programming language operates in boolean values and not bytes, I think it is different.

Test cases:

chew complain -> 1
swallow chew swallow chew swallow vomit complain playwithfood -> 11
chew complain swallow chew complain swallow chew complain swallow complain -> 1110
chew feedtodog undefinedbehaviour complain -> 1

Your challenge is to write an interpreter for Brussels-Sprout. This is code golf, so shortest program wins!

More test cases
Source Link
Victor Stafusa
  • 8.8k
  • 5
  • 40
  • 61

I have a new programming language called Brussels-Sprout. Brussels-Sprout functions in an array of 256 boolean values, has one instruction pointer, and one "bit index".

After each (non-branching) instruction is executed, the instruction pointer is incremented by one. If the instruction pointer goes off the right side of the instruction array, the program terminates. Going off the left side is undefined behavior.

If the bit index is outside the bounds of the array, it should be reset to 0.

Brussels-Sprout uses the following keywords, which are always lowercase:

chew - Invert the value in the array at the bit index. (flip the bit at the bit index)

swallow - Increment the bit index.

vomit - Decrement the bit index.

complain - Output the bit at the bit index to stdout, or equivalent output log.

feedtodog - If the bit at the bit index is 0, skip the next instruction. Otherwise, increment instruction pointer by 1.

playwithfood - If the bit at the bit index is 1, jump backwards 2 instructions. Otherwise, increment instruction pointer by 1.

If an instruction not on this list is executed, undefined behavior occurs.

I'm sure that this sounds like a very certain other turing-tarpit programming language. But since this programming language operates in boolean values and not bytes, I think it is different.

Test cases:

chew complain -> 1
chew swallow chew swallow vomit complain playwithfood -> 11
chew complain swallow chew complain swallow chew complain swallow complain -> 1110
chew feedtodog undefinedbehaviour complain -> 1

Your challenge is to write an interpreter for Brussels-Sprout. This is code golf, so shortest program wins!

I have a new programming language called Brussels-Sprout. Brussels-Sprout functions in an array of 256 boolean values, has one instruction pointer, and one "bit index".

After each (non-branching) instruction is executed, the instruction pointer is incremented by one. If the instruction pointer goes off the right side of the instruction array, the program terminates. Going off the left side is undefined behavior.

If the bit index is outside the bounds of the array, it should be reset to 0.

Brussels-Sprout uses the following keywords, which are always lowercase:

chew - Invert the value in the array at the bit index. (flip the bit at the bit index)

swallow - Increment the bit index.

vomit - Decrement the bit index.

complain - Output the bit at the bit index to stdout, or equivalent output log.

feedtodog - If the bit at the bit index is 0, skip the next instruction. Otherwise, increment instruction pointer by 1.

playwithfood - If the bit at the bit index is 1, jump backwards 2 instructions. Otherwise, increment instruction pointer by 1.

If an instruction not on this list is executed, undefined behavior occurs.

I'm sure that this sounds like a very certain other turing-tarpit programming language. But since this programming language operates in boolean values and not bytes, I think it is different.

Test cases:

chew complain -> 1
chew swallow chew swallow vomit complain playwithfood -> 11

Your challenge is to write an interpreter for Brussels-Sprout. This is code golf, so shortest program wins!

I have a new programming language called Brussels-Sprout. Brussels-Sprout functions in an array of 256 boolean values, has one instruction pointer, and one "bit index".

After each (non-branching) instruction is executed, the instruction pointer is incremented by one. If the instruction pointer goes off the right side of the instruction array, the program terminates. Going off the left side is undefined behavior.

If the bit index is outside the bounds of the array, it should be reset to 0.

Brussels-Sprout uses the following keywords, which are always lowercase:

chew - Invert the value in the array at the bit index. (flip the bit at the bit index)

swallow - Increment the bit index.

vomit - Decrement the bit index.

complain - Output the bit at the bit index to stdout, or equivalent output log.

feedtodog - If the bit at the bit index is 0, skip the next instruction. Otherwise, increment instruction pointer by 1.

playwithfood - If the bit at the bit index is 1, jump backwards 2 instructions. Otherwise, increment instruction pointer by 1.

If an instruction not on this list is executed, undefined behavior occurs.

I'm sure that this sounds like a very certain other turing-tarpit programming language. But since this programming language operates in boolean values and not bytes, I think it is different.

Test cases:

chew complain -> 1
chew swallow chew swallow vomit complain playwithfood -> 11
chew complain swallow chew complain swallow chew complain swallow complain -> 1110
chew feedtodog undefinedbehaviour complain -> 1

Your challenge is to write an interpreter for Brussels-Sprout. This is code golf, so shortest program wins!

spec attempt
Source Link
Loading
Post Closed as "Needs details or clarity" by Denker, flawr, Hannes Karppila, Zach Gates, cat
Source Link
Loading