« first day (639 days earlier)      last day (603 days later) » 

18:18
@user56656 @Riley @Pavel Since you three helped out last year, we could use your help again this year. So dust off your brain-flak-themed-challenge-writing-hats, and try to see if you can come up with any more brain-flak themed challenges for the second birthday!
However, this year is extra special. Not only is brain-flak's 2nd birthday on the 30th, but the whole site will be celebrating with us too! At this point, unless a ton of votes come in at the last minute, Brain-flak will be the language of the month.
(Oh, I just realized that didn't ping Pavel...)
18:35
@DJMcMayhem so, first question: how does input work on TIO?
(so I can push the input to the stack)
List of numbers separated by whitespace
The first number will be on the top of the stack
Do I need any argument or anything like that? Or just passing a number in the input field will automatically push it?
The latter
The input implicitly pushes 1, 2, 3 onto the stack (with the 3 on top). The {} pops the 3. And brain-flak implicitly prints the stack
Ah, I see. I tried with only one number and the output was blank so I got confused :p
It helps to separate the numbers of the input with newlines and then visualize the IO fields as vertical stacks
18:44
Okay so this is sum; this is subtraction; trying to push 60 now
@user56656 Still waiting on that brain-flak solution to codegolf.stackexchange.com/questions/114219/… :P
You might be waiting for a long while.
So, if ((()()())) pushes 3, 3, why doesn't ({(()()())}) do anything?
Well it actually pushes 0
{...} evaluates to the sum of all runs
Shouldn't it push 6 then?
18:51
No. The stack is initially 0, so the inside is never executed
@J.Sallé ^ additionally, if it did execute, it would loop forever
I thought so too, but doing ((){((()()()))}) still returns 0?
1* actually
@J.Sallé () doesn't push anything. (()) would
((()){((()()()))}) runs forever
I noticed >.>
I can't seem to make anything with {} halt other than {} itself >.>
like ((()()()){}) sums to 6 but that's it, I can't put anything else inside the {}
Remember that {} and {...} are radically different commands (as well as every other bracket type)
19:04
I kinda get it. Why does (((()()())){(){}}) evaluate to 11 though? (((()()()))...) pushes 3, 3 times. Then {}{} pops twice to give me 9. Why does that () sum 2 instead of 1?
@J.Sallé I think you misunderstand {...}. It doesn't pop anything, it simply loops as long as the top of the stack is non-zero
So {(){}} means while true: pop() + 1
If that has 3 3's on top of the stack, then it's pop() + 1 3 times, so it should evaluate to pop() + 1 + pop() + 1 + pop() + 1 which is 12
Does that make sense?
push(push(push(3)) + (while true: pop() + 1))
So by the time you get to the loop, there are only 2 3's on the stack. The second push evaluates to 3, and the while loop evaluates to pop() + 1 + pop() + 1
So it becomes 3 + 4 + 4
Ah, I see
Also, I just now realized I don't need to enclose everything in the same () facepalm
FWIW, you can make a pretty short push(60) snippet without using any loops
19:14
Define "pretty short". I've no idea what a short program is like
@J.Sallé The integer metagolfer comes up with a 28 byte solution
Okay, I'll see what I can do
Pro tip: (("n"){}) evaluates to n * 2, which is highly nestable
@J.Sallé CMC (that will you help with 60): Multiply the top of the stack by 3
@DJMcMayhem yup, I just discovered that myself. Managed to push 80 in 28 bytes >.>
Nice! You're pretty close
19:20
Got to 60 in 32 bytes >.>
Can I see?
Hmm, that's an interesting approach.
Here's a 28 byter (out of many): Try it online!
@DJMcMayhem I was sure I tried that before. Probably did it with 4 instead of 5 I guess >.>
Integer golfing is pretty tough. I do it with a lot of trial and error.
19:28
@DJMcMayhem aaaaah that's a nice hax :p
Okay now I'm trying to reverse the input, and I assume I need to toggle the stacks to do that, but I don't quite get it how the whole stack-toggling thing works
I'm trying to pop a value, toggle the stack, then push it back, which is the basics of inverting stacks
Well, I'll keep trying later tonight/tomorrow, gotta go home now.
20:10
@J.Sallé That is the basic idea. You can do that with ({}<>)

« first day (639 days earlier)      last day (603 days later) »