« first day (2927 days earlier)      last day (1916 days later) » 

12:21 AM
@BMO um... why doesn't this work?
 
0
Q: A well linked challenge

TRITICIMAGVSAn activity I sometimes do when I'm bored is to write a couple of characters in matching pairs. I then draw lines (over the tops never below) to connect these characters. For example I might write \$abcbac\$ and then I would draw the lines as: Or I might write \$abbcac\$ Once I've drawn t...

 
12:53 AM
@TRITICIMAGVS Mwahahaha
Wait I'm stupid
 
@NewMainPosts Does this not just reduced to whether there's 2 of the same character in a row?
 
@feersum No.
abcbca, for example
(As implied by the hint. Although I still haven't completely convinced myself the hint is true.)
 
It's not too clear to me what the hint is supposed to mean.
 
Well like in my example, bcbc is such a substring. You can connect it internally, and then all the connections elsewhere (just between a and a in this case) can just pass over it.
So one direction of the hint is clear.
 
Yes, instead of "a loop can be drawn over it" it would make more sense if it said that no external loops need to intersect it.
 
1:05 AM
I think you mean lines, not loops.
 
Indeed, I was using "loop" as a synonym for line.
 
but they're different things here
 
That's why I didn't understand the hint.
I instantly forgot about loops because they seemed irrelevant to the problem.
 
Oh the hint is true actually. What I've not entirely convinced myself about is that you can assume the substring with a loop must be contiguous.
Hm but if it's not, then a line must pass over between two of its parts. Which means that line isolates a contiguous substring between them.
 
Any two valid loops could be joined into one, I suppose.
 
1:15 AM
No wait, a line must pass over unless everything's even on one side
 
1:25 AM
@Deadcode ah, nice prime test check... with that, I can do it in 61 bytes (including decimal conversion and balancing groups): ^((1{14})1(1)+)(?<=(?<!^\4+(..+))\2?)(?<-3>\1)+$(?(3)1)
@ASCII-only is it me or is the astifier broken right now? I haven't been able to use -a at all today
 
OK I convinced myself. If the looped region has more than one contiguous substring, and B and D are the two leftmost components, with C the contiguous substring between them, then either C is even and so can be looped itself, or it as an outward connection separating B from D, so B can be looped alone.
So it is enough to look at loops around contiguous substrings.
 
@Neil :/
well i haven't updated recently
so i guess it's just something i must have missed
@ØrjanJohansen :| i see what you did there
 
@Neil Cool, but how can \3 ever be unset in that? It's (x)+ and it's inside a {1} group, so it can never be unset, no? Or does the balancing group construction unset it? (I still have a very limited understanding of balancing groups)
 
@Deadcode yeah the -3 pops the most recent \3 iirc?
 
1:46 AM
right, each time I match the \1 I pop a \3, and I want there to be none left when I finish matching
.net allows multiple named capturing groups with the same name, which, combined with balancing groups, makes matching balanced constructs very easy
something like (\((?=.*(?<b>\)))|\[(?=.*(?<b>]))|\{(?=.*(?<b>\}))|<(?=.*(?<b>>))|(?<-b>\k<b>))‌​+ (I may have misremembered the syntax)
each time you hit an open bracket you peek ahead for a close bracket so it's on the balancing group ready to be matched and popped when you run out of open brackets
 
2:07 AM
@Neil Does that mean it could be an actually Accept-able answer to my SO question Is it possible to erase a capture group that has already matched, making it non-participating??
 
2:28 AM
@Deadcode yes
iirc balancing groups is .NET's answer to PCRE's recursion or something like that
might want to look into .NET regex, it's basically about as powerful as PCRE
 
Well, if you write it up nicely as an answer to that question I'll give it at least 150 bounty.
 
2:49 AM
@Neil Are you going to edit your answer? Also, how is this not 60 bytes? (55 + 5 for decimal to unary)
@Neil And also, how does it have anything to do with my prime check? I don't see any resemblance.
 
 
1 hour later…
4:15 AM
hmm
how bad of an idea would it be to have macros with different numbers of args based on their argument?
e.g. new takes 1 argument (type) -> new foo, which then becomes a function that takes as many arguments as the type's constructor does (well, because it is the constructor syntax)
 
 
1 hour later…
5:21 AM
@ØrjanJohansen I think my hint was wrong or at least not worded very clearly. I've rewritten it to be right. (Also your thought process here is pretty much the exact one I went through :))
 
 
2 hours later…
6:52 AM
how tf are there so many progamming languages being designed
 
 
1 hour later…
7:53 AM
@ASCII-only Ah yes, r/ProgrammingLanguages.
The subreddit for discussion of random hobby projects that no one cares about, along with confused people from r/programming.
At least it doesn't get as many off-topic posts as r/rust.
 
 
1 hour later…
9:18 AM
@flawr We failed to celebrate TNB's 8th birthday D:
 
9:49 AM
@ØrjanJohansen coc?
 
10:04 AM
oh
 
10:33 AM
if anyone's still here: in an ideal language, what should compare_to return?
an enum value of either less, equal, or greater? if so, what to name the enum?
 
@Deadcode thanks for the information; this in turn implies that a backreference is always a substring of the string being matched, which looks like a fact that would be useful in writing optimized regex engines that handle backreferences (which is what I was interested in)
@ASCII-only the normal name seems to be something along the lines of "ordering"
 
hmm. i was going to go for comparison_result - not entirely sure ordering describes it well/is a good word to describe it
also... would simple enums (just the values) or java-style enums be better
 
Java-style enums are broken, at least the way Java does it
 
assume not the way java does it :P
 
@Deadcode I wrote up stackoverflow.com/a/54502001/182705 as nicely as I could.
 
10:40 AM
@ais523 i guess i mean... enums that contain more than just a list of names
 
@Deadcode it was 61 because I was using Retina 0.8.2 at the time and that takes 6 bytes for decimal to unary
 
do something like Rust or C#, where you can attach methods to arbitrary classes after the fact (but the methods are in the namespace of the person attaching them)
that way you can have all your enums just being enums without having to work out all the functionality they'd need in advance
 
@ais523 in c# enums aren't classes :P
 
can you attach methods to them anyway? if not, that seems wrong
(rust lets you attach methods to primitives, but it's not monkeypatching because the methods are in your own namespace and so they won't interfere with anyone who's not trying to use them)
 
@ais523 extension method in C#? yes
also well... actually in this language every method is just essentially a global function in disguise >_>
would there me a nice alternative to java's attaching values to the enum members? hmm
as in Day.THURSDAY could have "Thursday" as a member in Java (so day.getName() would return the string the value was constructed with)
 
10:45 AM
@Deadcode it was the way you reinterpreted <p is prime and p times (p <plus or minus> 14) equals n> as <p <maybe plus 14> is prime and p times (p plus 14) equals n>
 
well actually. what are the advantages/disadvantages of sum types and enums?
 
@Neil Thank you :)
I tested it and it works.
I think in most circumstances there would only be one to delete at a time.
 
yeah, well I wasn't sure with your crazy regexes ;-)
 
11:33 AM
@ais523 You want to write a regex engine? Did you look at mine?
@Neil I'm actually curious about that – why did you stick with 0.8.2 for as long as you did?
 
@Deadcode I've got it bookmarked on tio, haven't got around to updating
I only use Retina 1 when I need a feature 0.8.2 doesn't have
 
The 1 byte savings for decimal-to-unary seems like reason enough :)
Unless you want the scores of new Retina programs to be directly comparable with those of older ones
 
 
3 hours later…
2:18 PM
@BMO so... regarding the last ping, I discovered that rules don't work at all
 
 
2 hours later…
4:11 PM
also... FR: make xA + 0A mean that there must be no more than x A, but there must be x A
 
5:00 PM
can somebody teach me how .rule files work?
 
0
Q: A Turtle Finds a Portal

akoziA Turtle Finds a Portal The turtle wants to move along the grid to get to his food. He wants to know how many moves it will take for him to get there. As well since he is slow he has teleporters set up around his domain that he will utilize if it shortens his path. Or avoid them if it lengthen...

 
 
5 hours later…
9:58 PM
0
A: Sandbox for Proposed Challenges

trichoplaxHow much of the infinite board can I reach? code-golf grid The board is an infinite 2 dimensional square grid, like a limitless chess board. A piece with value N (an N-mover) can move to any square that is a distance of exactly the square root of N from its current square (measured centre to ...

 
10:10 PM
@MilkyWay90 :| read golly docs pls
@EriktheOutgolfer excuse me...
@EriktheOutgolfer magic...
@EriktheOutgolfer no thanks. that would make most things trivial... plus that is not how chemistry works (well, even less like how chemistry works). it's an esoteric language, not a non-esoteric language like ><> is
 
0A in the left part means that there must be no As for the rule to be applicable
 
yes
it is one of the few ways to get conditionals
otherwise the language wouldn't even be TC
 
however, 2A+0A currently doesn't have a meaning
so I'm suggesting that
 
@EriktheOutgolfer it does...
it's 2A...
atoms are combined as an optimization
 
oh huh didn't notice
 
10:14 PM
2A + 0A is well... just 2A >_>
@EriktheOutgolfer btw i've half done a more optimized version of alchemist
in case you might have been looking to do very long deterministic divisions :P
 
lol I've barely made a fibonacci as of yet
 
haha
well, BMO's method of keeping a state atom makes it a whole lot easier. and easy to keep deterministic
state atom being an atom that's always there to indicate which procedure you're executing rn. like m = division -> n = comparison -> o = reset -> m (switching states being like m + 0endcondition -> n)
 
10:32 PM
@ASCII-only well... with state atoms, it quickly gets messy... :P
 
@EriktheOutgolfer how
 
0A, 0B, 0C, ...
 
hmm?
 
don't you have to include a lot of zeroes in a lot of rules?
 
no like... at the end of a division it's just m+0x->n
@EriktheOutgolfer never
generally, at most twice per state. at most
if you have more... 99.99% chance you're doing something wrong. no offense
check the existing answers (note: i use bmo's method, jo king just does it without a structure. it's golfier, but you gotta make sure you know what you're doing since it's not deterministic)
 
10:36 PM
so you're saying something like detecting the end condition of a step and changing the state atom then?
also... if it's non-deterministic, then you have to be sure the result is unaffected
 
@EriktheOutgolfer exactly
@EriktheOutgolfer yes
@EriktheOutgolfer i guess... think of it (0a vs a) like pattern matching
oh yeah, anyone here have an opinion on sum types vs enums?
 
11:19 PM
I'm kind of curious, would it be permitted to gzip my answers in C, and state the language as gzip | gcc? This seems to consistently shed about 1/6 from my golfs...
 
@Rogem gzip isn't a language, you'd have to use bash to un-gzip it
but... most importantly, it's not readable. which is really bad
 
gcc will happily compile from stdin, so technically piping gzip -c to it is an extended compiler?
And I wouldn't call most machine code nor golfing languages readable either.
 
@Rogem oi
golfing languages are as readable as C
it's just a matter of learning function names...
 
@Rogem Depends on your motivation. If you just want to get a lower score by switching language, there are languages shorter still. If you want the extra challenge of running all your code through gzip to see which is shortest (the shortest C code won't always give the shortest gzipped output) then I expect you could argue it's valid (even if you still get the odd downvote)
 
Yeah, get your point. But, we also allow unary languages, which almost definitely aren't readable.
 
11:25 PM
(I would say that justifies posting gzipped code, but I don't know how it would be received)
 
@trichoplax yep. especially given the fact that it's just compressed C code
i.e. zero-effort golfing
 
Oi
 
It's only zero effort if you're the only one using it. As soon as you have a competitor in the same "language", you'll find they beat you if you only golf the C first then compress it
 
Finding the exact right types that UB in just the right way to shave off a byte from your 300 byte cat golf is an art.
 
Being horribly difficult to work with doesn't guarantee upvotes though
 
11:30 PM
I know, alright
 
holy crap charcoal has 100 stars
 
@Rogem That wasn't meant to mean you won't get upvotes (or that upvotes would necessarily be your motivation). Certainly wouldn't be the most awkward language used here, and I still can't guess in advance what will be popular...
 
@trichoplax meant that there was just a little bit irony in the statement (in the context of C being difficult to golf).
 
Oh I see. My expectation is that golfing C would be much easier than finding the C code that gives the shortest gzip output
For example you might find that unrolling a loop and making the code longer results in more repetition and a shorter gzip output
 
Yep. And variable reuse would be especially important. And possibly stdint.h, which right now goes completely unused...
Another thing I still need to try is packing the ASCII...
Because 8-bit bytes are overrated.
 
11:53 PM
Yeah, make 64 bits a byte instead
 
well, I came up with a regex restricted-source answer... that was tough!
 
Well... gcc cries murder when there's a non-ASCII in the code, so I was just planning on packing 8 chars into 56 bits.
 

« first day (2927 days earlier)      last day (1916 days later) »