last day (1042 days later) » 

7:59 PM
Eyes!
(Get it. Retina)
 
@CᴏɴᴏʀO'Bʀɪᴇɴ Message closed as off-topic.
(I see the potential for confusion though...)
 
I have problems with my retina. Where should I go first?
 
Hmm, did anyone ever answer the identity matrix question in retina?
 
@FryAmTheEggman link?
 
oh, that one
24
Q: Construct the Identity Matrix

SeadrusThe challenge is very simple. Given an integer input n, output the n x n identity matrix. The identity matrix is one that has 1s spanning from the top left down to the bottom right. You will write a program or a function that will return or output the identity matrix you constructed. Your output ...

 
8:00 PM
Yeah
 
I'm still learning retina, don't know quite how to tackle that
 
Looks like Digital Trauma did
 
apparently I also helped golf it
 
I wonder if $* could be used here
Of course, that was added after the challenge
 
well it already takes unary input...
 
8:03 PM
yeah
oh, wait, I misunderstood $* :P
 
Yeah and I don't think it'll help because the numbers have to be separated
Might have been a cheeky way to generate all the zeros, otherwise?
 
well you can do something like this: retina.tryitonline.net/#code=XEIKJC5fJCow&input=MTExMQ ... now how to the lines...
 
Maybe there's a way to combine it with the first line to still have a capture group with the length or something?
Although that seems like it would be too long...
 
is there a way to include $* in the first part of a replace stage?
if not, it could be kind of a cool thing to match something n times, where n is some part of the string
 
8:15 PM
Uh, you mean the pattern line? If so, then no :(
 
yeah, the pattern line
 
I dunno so far there haven't been any "exec" like things that Martin's added, they may only be coming much later or something.
Probably better to ask Martin though, I guess :P
 
True. Any input, Martin?
ninja'd
 
well yeah... that's pretty far down the line... anything that can be implemented via compiling to .NET regex is a bit more likely. but even for that I'd need to tokenise .NET regex which I'm not really looking forward to
you can match something n times (where n is something in the string) but it requires balancing groups which are too expensive in this case
so yeah I guess something like this could be compiled to .NET regex
 
my best attempts at this don't work at all :P
 
8:20 PM
well this works, but it's way too long: retina.tryitonline.net/…
I first count the number of 1s in a lookaround and then I match that many characters
 
I was working on something similar, but I noticed that the 0 that you should split on has the same number of 0s directly before it as 1s anywhere after it
 
I have this but it only works for fixed N
 
but I think it's also gonna be way to long
 
@FryAmTheEggman ohhh
hm yeah but with "exactly that many" it's hard to avoid something like (?(1)!)
 
8:25 PM
Yeah that's what I've been struggling with
 
I should probably learn .NET regex :P
 
best I'm coming up with right now: retina.tryitonline.net/…
@CᴏɴᴏʀO'Bʀɪᴇɴ I suppose you've been linked to my SO answer on balancing groups before?
 
yes, I have.
 
(or stumbled over it in one of Retina answers)
 
I get the concept, but I couldn't replicate
 
8:27 PM
the answers to the regex golf CnR also help understanding what's possible with balancing groups
a lot of them used them to implement some form arithmetic
 
It is tricky, I still mess up all the time, and then bug Martin about it :D
 
where could I practice .NET regexes?
 
In retina? :P I think maybe regexhero or something was a site that let you run them...
Also could download mono
 
here's a shorter idea: retina.tryitonline.net/… (still way too long though)
 
thanks, but I like not being sick
:P
 
8:30 PM
there's also regexstorm.net/tester which lets you inspect capturing groups
 
Ah right, that was the good one I think
 
this stuff is black magic ._.
 
regexhero is pretty powerful actually, but I think it needs silverlight or something
 
Yeah it was just a pain to get working IIRC
 
we should focus on that new challenge :P
 
8:33 PM
The date one?
 
yeah
 
Hmm, initial idea would be to do stuff like 01$ -> JAN but that seems bad
 
now how to compress it... retina.tryitonline.net/…
 
weird idea, but maybe you could have : be a character like . and stand for ..
or is that not in the spirit of retina
(Obviously not just for this challenge)
 
I think the problem with that is that usually they will be like \w or something, so that would still be 2 bytes
 
@CᴏɴᴏʀO'Bʀɪᴇɴ hm yeah, seems a bit too much like microgolfing. I'd rather add features for common but cumbersome patterns (e.g. measuring the current horizontal position) or some that actually increase Retina's expressiveness
 
ah, good idea
I'm a microgolfer I guess :P
 
@FryAmTheEggman well this golfing idea ended up at +/-0: retina.tryitonline.net/…
one byte shorter now retina.tryitonline.net/… ... this is unsatisfactory
this is somewhat better: retina.tryitonline.net/…
 
Haha, that's pretty cool!
 
8:48 PM
can save a byte with some linefeed abuse retina.tryitonline.net/…
 

  last day (1042 days later) »