« first day (311 days earlier)      last day (931 days later) » 

5:38 PM
0
A: Find the First Bracket Match

MegaTomBrain-Flak, 97 bytes (96 for code, 1 for flag) {}<>(())({<(<()>)<>({<({}[()])><>([{}]())<>}{})<>(<{}>())<>{({}[()])<>([{}])<>}{}<>({}{})>()}{}) Run with the -a flag. Try it online! Explanation: {} #skip the first open bracket and <>(()) #place a 1 on stack B, representing the nesting d...

This beat the older solution by a good margin.
 
 
2 hours later…
7:25 PM
CMC: Stack-clean mod 2 snippet
 
Oh I've done this
lemme see if I can find it
 
For reference, pushing two and using the general purpose modulus is (()())({}(<>))<>{(({})){({}[()])<>}{}}{}<>([{}()]{}) which is 52 bytes, and the non stack-clean mod 2 is: (({})){({}[()]<>)}<> for 20.
I'm sure that hardcoding 2 into the algorithm can come up with something shorter than general purpose modulus
 
(()()(<>))<>{(({})){({}[()])<>}{}}{}<>([{}()]{}) is 48 (the general mod with 2 hardcoded)
 
Oh yeah, that's right, PPR
I am so bad at that
 
>0 only, and gives 0 or input
I guess that's just is_even not %2
 
7:38 PM
Yeah...
And what the heck is going on here: Try it online!
 
[({}<(())>(<>))({({}[()]<>)}{}){({}[()]<>)}{}{}<>] 48 bytes
What are you trying to do?
 
Push mod 2 of each input
But for some reason it says 3 % 2 == 2
Ahh, there we go
Mod 2 is actually ({}(<(()())><>))<>{(({})){({}[()])<>}{}}{}<>([{}()]{})
 
8:04 PM
CMC: Implement the Klein-4 group
(In brain-flak)
 
9:00 PM
On another note, I have a new, shorter set of logic operators.
It is all based on the idea of ({...}()), using an if block to get the value to push.
 
@MegaTom Nice! I'll add them to the wiki
Now to golf every answer that ever used a not
 
It's 4 bytes shorter.
 
9:16 PM
@MegaTom you should make a new answer for this question
 
@MegaTom Yep, that makes sense.
What about ((){<{}>{[()](<{}>)}}<{}{}>) for NAND? I just removed ({}) which I think will always pop and push 0.
 
jeez we have to golf xnor
 
@WheatWizard Done
50% off
 
9:32 PM
Woah.
I think I just golfed equals without realizing it
 
wait what?
then it it not xnor?
 
Xnor and equals are pretty much the same
 
It does look like you made equals
Oh for the wiki we were taking to values and seeing if their truthiness was the same
eg xnor(6,7) = 1
 
9:34 PM
Oh, I thought input was restricted to 1 and 0?
 
That's for the challenge?
 
but equals is much more useful than xnor so...
 
Yeah, a shorter equals will be really useful
I golfed it without realizing, lol
 
@DJMcMayhem I don't think so. As far as I could tell we were just golfing informally
 
9:35 PM
And it looks like there's still some PPR in there that could be removed
Not sure though
 
I doubt it
Looks solid
 
Looks good to me.
 
Ah, on the challenge it is restricted to 1 and 0, but xnor is shorter too: ({}{}[()])
Actually, I don't think that's valid cause it'll sometimes give -1
 
here is a true xnor its a little longer
 
Just added my new equals to the wiki
 
9:39 PM
Nice, I have updated the logical operators
 
@WheatWizard s/curtesy/courtesy
:P
 
I thought it looked weird but my spell checker was fine with it
we need to work on the wiki
we still haven't added that less than zero that we keep saying we need to add
 
Yeah, we still don't have a general purpose less/greater than
Ninja'd
I'd add it, but I'm not sure what the shortest one is
 
same
 
I wonder if it would be worth adding a few sections that don't have snippets, but rather go over useful concepts
 
9:42 PM
yeah that would be a good idea
 
Such as constant-multiplication, the third stack, evaluating loops, integer golfing, integer distance golfing
 
yeah all of those things seem like good ideas
though third stack is a rather complex topic
 
Yeah, maybe just the basic examples of it, e.g. ({}<foo...>)
 
I'd make an entire page, I'm just saying it ain't gonna be easy
I could probably borrow from the tips page rather heavily to make it easier
 
When should/shouldn't we credit users for coming up with snippets?
 
9:48 PM
I credit everyone but myself, you and 1000000000
 
I guess I should really ask people if I can include their snippets.
 
There's nothing wrong with that, but I wonder if it would be worthwhile to credit those three also
I think most of them are probably you though
Probably >70%
 
or ask them what license its under
Some of them are certainly not work citing, for instance add and subtract are very easy to find even for beginners
 
Yeah, sure
 
9:51 PM
I think there is only one of mine on there, but feel free to use anything of mine without credit.
 
With a short search this is the shortest less than zero I could find, I'm going to add it to the wiki if no one has any objections
 
Is there also a general purpose less than? e.g. (a < b)
 
Less than can be made pretty simply from less than zero
just subtract and run
 
I'm pretty sure that's stack clean
 
The above link is to grater than or equal to zero. in 50 bytes.
 
10:07 PM
@MegaTom Why ((<{}>)) instead of (<()>)?
 
@Riley I don't know. It has bean a bit since I wrote the code. I have no clue how it works.
 
Hmm, well I've got an 18 byte equals, but it isn't stack clean: ({}[{}]){{}}([]{})
It could probably be modified to be stack clean though
 
@DJMcMayhem looks stack clean to me. can you give a counter example?
 
It consumes every consecutive truthy on the main stack
 
10:53 PM
@Riley your last solution (46 byte) seams not to work.
 
11:06 PM
@Riley Neither does your 48 byte one
 
11:33 PM
I don't know why it worked when I was testing it. It shouldn't.
 

« first day (311 days earlier)      last day (931 days later) »