Skip to main content
Lmis's user avatar
Lmis's user avatar
Lmis's user avatar
Lmis
  • Member for 8 years, 5 months
  • Last seen more than 7 years ago
revised
Loading…
Loading…
comment
Hiccup a string
@jrich Unfortunately, afaik that string is eval'd in the global scope and will therefore not have access to s.
comment
Hiccup a string
@zeppelin Yes, this last one is very nice. Thank you very much. :)
revised
Hiccup a string
added 137 characters in body
Loading…
revised
Hiccup a string
added 7 characters in body
Loading…
comment
Hiccup a string
@ETHproductions Oh, good point. That is nicer. Thank you.
comment
Hiccup a string
@zeppelin The problem is at the other end of the spectrum: (1+0.099999*10)*999 > 1997. As you have shown yourself, this will mean n===1 for the rest of the computation, but it will wait almost twice as long, as it should :)
comment
Hiccup a string
@zeppelin I don't think I can remove |0. It's there to round down the random number. If I don't do then the timeout might be longer than the spec allows.
revised
Hiccup a string
added 12 characters in body
Loading…
revised
Hiccup a string
deleted 9 characters in body
Loading…
comment
Hiccup a string
@zeppelin Fair point, according to the standard definition it doesn't count. (meta.codegolf.stackexchange.com/a/1325/56071). I shall change it accordingly.
revised
Hiccup a string
deleted 84 characters in body
Loading…
revised
Hiccup a string
deleted 84 characters in body
Loading…
answered
Loading…
awarded
comment
Generate a cipher
I posted an attempt at a standard definition over on meta (meta.codegolf.stackexchange.com/a/10663/56071) to avoid ambiguities in the future. It is consistent with the answers I can read that have been posted so far, FWIW.
comment
Generate a cipher
The issue with not defining what distribution the samples should approximately follow is that it we need to make assumptions on what is allowed and it therefore it becomes ambigous if a solution is valid. We could for example replace String.fromCharCode(...[...Array(n)].map(_=>Math.random()*95‌​+32)) with [...Array(n)].map(_=>'TX'[+(Math.random()>.5)]).join('') and lazily outgolf the current ES6 submission by 9 bytes. According to the spec it should count because it is a random character. However, it seems unfair, doesn't it? So should that count? See where this is going?
awarded
comment
Make a "Ceeeeeeee" program
I think this produces incorrect output for f('test cases', 's') (ending with stss, rather than tsss). I think this is because replace removes the first occurance so it removes the first t rather than the second t in the fourth iteration of the map loop.