Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

11
  • 3
    \$\begingroup\$ That's an nice way to separate statements! It's certainly much more readable than putting everything on one line and separating them with semicolons. If I may offer my suggestion: you could save a byte by moving your i++ from the for loop to the last place it's used, in this case c=i++>r-2?"X":c. \$\endgroup\$ Commented Aug 6, 2015 at 18:50
  • 1
    \$\begingroup\$ Also, since you're using ES6, I would suggest using v[0].repeat(+v.slice(1)) in place of Array(v.slice(1)- -1).join(v[0]), and " ".repeat(j-p-1) in place of Array(j-p).join(" "), saving 11 bytes overall. I think you could also place F='forEach' at the beginning of the function, then change each .forEach from there on to [F], saving another 4. \$\endgroup\$ Commented Aug 6, 2015 at 18:58
  • 1
    \$\begingroup\$ Try using .map instead of .forEach. It's so short you should not even shorten it to F \$\endgroup\$ Commented Aug 7, 2015 at 13:29
  • 1
    \$\begingroup\$ @UndefinedFunction you might want to use shorthands for the ifs, it might help if you decrement variables at the same time also \$\endgroup\$ Commented Aug 7, 2015 at 21:38
  • 1
    \$\begingroup\$ If my understanding is correct, does q=x=y=2e3 mean that the output would be incorrect if I did, say, W9999? \$\endgroup\$ Commented Aug 8, 2015 at 5:53