« first day (79 days earlier)
← previous day
last day (14 days later) »
Dennis
3:50 AM
Argh,
cumsum([])
is an error.
quartata
What's this for?
Dennis
Takewhile.
quartata
Does reduce work on empty lists? might be shorter than a ternary
doubt it
Dennis
I'm not aware of a generic cumulative reduce in Julia. Anyway, I went with something else.
0
A:
Implement Takewhile
Julia, 24 bytes !x=1∈x%2?!x[1:end-1]:x Try it online!
!x=x[cumsum(x%2).<1]
would have saved 4 bytes though.
Alex A.
@quartata no
quartata
4:05 AM
Oh cumsum doesn't do what I thought it did. Der.
Dennis
4:32 AM
@quartata What did you think it did?
« first day (79 days earlier)
← previous day
last day (14 days later) »
all rooms
Transcript for
Jun
24
Jul '16
6
Jul
20
Julia
Discussion about the Julia language and golfing in it —
julial...
code-golf
julia
join this room
about this room
00:00
06:00
12:00
18:00
all times are UTC
site design / logo © 2024 Stack Exchange Inc;
legal
mobile