rome=N=>"M999CM899D499CD399C99XC89L49XL39X9IX8V4IV3I0".replace(/(\D+)(\d+)/g,(_,r,d)=>r.repeat(N/++d,N%=d))
-
-
-
cheap trick. golfing the logic would be harder...
- Još 1 odgovor
Novi razgovor -
-
-
@KevlinHenney had some nice implementations in one of his talks
https://youtube.com/watch?v=_M4o0ExLQCs …Hvala. Twitter će to iskoristiti za poboljšanje vaše vremenske crte. PoništiPoništi
-
-
-
really nice tricks, I love it !! Another logic, implemented few years ago before ES6+ using c^=7 :https://gist.github.com/Cycymomo/6053345 …
-
ah le bon vieux temps :) on jouait pas dans la même cour à l'époque hein cyril ?
Kraj razgovora
Novi razgovor -
-
-
Empty string is coerced to 0: Trim out the last 0 in the string and make the \d+ to be \d* (Regexps are greedy anyway): function rome(N){return"M999CM899D499CD399C99XC89L49XL39X9IX8V4IV3I".replace(/(\D+)(\d*)/g,(_,r,d)=>r.repeat(N/++d,N%=d))}
Hvala. Twitter će to iskoristiti za poboljšanje vaše vremenske crte. PoništiPoništi
-
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.