« first day (1 day earlier)      last day (92 days later) » 

2:49 AM
@AlexA. Is there any way to vectorize character subtraction?
 
Like subtracting the code points?
 
Yes. 'a'-'b' works, but ['a']-'b' doesn't.
 
Try .-?
 
I did.
ERROR: MethodError: `-` has no method matching -(::Array{Char,1}, ::Char)
The worst part is that I'm certain it worked in a previous version.
 
Yeah, they got stricter with how Chars work in more recent versions
map(i->i-'b',['a']) works
 
2:53 AM
Yeah, I was kinda trying to avoid the map... :P
Hm, I should be able to use digits instead.
 
Oh were you doing a ["$n"...] kind of deal?
Just note that digits returns them in reverse order
 
No, the challenge allows taking a string or a number.
 
Ah okay
 
It worked! \o/
 
Nice!
 
2:57 AM
0
A: A Numpad's Knight Numbers

DennisJulia, 51 bytes n->diff(["_1238_4765"[digits(n)+1]...]).^2⊆[9,25] Verification julia> f=n->diff(["_1238_4765"[digits(n)+1]...]).^2⊆[9,25] (anonymous function) julia> map(f, (1, 2, 3, 4, 5, 6, 7, 8, 9, 16, 18, 38, 61, 81, 294, 349, 381, 383, 729, 767, 38183, 38383, 18349276, 183492761, 618349...

 
Once I go back to being less busy with things I'll start ninja'ing the Julia answers :P
 
There's absolutely no rush. :D
 
ಠ_ಠ
2
My mistake was trying to force you to use Julia however long ago...
 
If you wanted to keep her for yourself, yes.
 
Haha
 
3:04 AM
I'm still baffled by the inconsistent behavior for character subtraction. Even diff takes characters...
 
diff should be calling - behind the scenes, so as long as -(::Char, ::Char) is defined, you're fine
 
You can't deny that's inconsistent though.
I mean, you can. But you shouldn't.
 
Idk, anything that uses - should have access to all of the methods defined for -. ¯\_(ツ)_/¯
 
Precisely. Well, it would have saved only one byte, so I'll stop complaining now.
 
:P
I guarantee the Julia devs don't give a hoot about your precious bytes. :P
 
3:14 AM
They should give one about consistency though.
 
I wonder if I can stalk them, get their contact info, and convince them to join PPCG...
 
Also, I very much preferred it when character arithmetic worked. If 'a' - 'b' is defined, there's simply no good reason not to define (let alone, deprecate) 'a' $ 'b'.
 
I wouldn't be all that surprised if 'a' - 'b' goes away in a future version. I think I read a thread of the devs discussing removing it.
 
17 mins ago, by Alex A.
ಠ_ಠ
I should probably install 0.4 and 0.3 as well, and choose the golfiest one for each task.
 
59 secs ago, by Dennis
17 mins ago, by Alex A.
ಠ_ಠ
 
3:19 AM
I do it with Python. Everyone does!
 
That's because there's no current consensus on what constitutes "Python": 2 or 3. For comparison, note that the same is never done for Ruby, for example.
 
We do it with C as well.
Most answers are in C89, since it's the golfiest.
 
Oh really? I don't recall having seen C versioned in a submission.
 
That's because everyone uses C89, so we just call it C. :P
 
._.
 
3:39 AM
Why does Julia have iseven and isodd functions? o_O
 
wynaut
 
Seems superfluous.
 
A lot of languages have them.
 
@Dennis They're really nice, especially when you want to use it in a map
 
It might be useful in a map
ninja'd
 

« first day (1 day earlier)      last day (92 days later) »