Timeline for Illustrate the square of a binomial
Current License: CC BY-SA 3.0
4 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Oct 20, 2015 at 9:57 | comment | added | Martin Ender | Regardless, here are some golfing tips: I don't see why you need the rjust before doing ljust. You can shorten print to $><< (and get rid of the space after it). ARGV has an alias $*. You might be able to avoid the flatten by building your array with something like this: codegolf.stackexchange.com/a/19493/8478. Also, function-only answers are definitely allowed around here (even unnamed functions), so that function could take the integers as inputs, and you wouldn't have to do any .to_i. | |
| Oct 20, 2015 at 9:53 | comment | added | Martin Ender | Welcome to PPCG! I don't think your padding is sufficient for large numbers. Consider having a 1 and a large number like 9999. Than s will come out as 4, so you're padding to a width of s+3 = 7 but 9999^2 needs 8 digits. You might want to use 2*s instead. | |
| Oct 20, 2015 at 9:14 | review | First posts | |||
| Oct 20, 2015 at 9:57 | |||||
| Oct 20, 2015 at 9:13 | history | answered | Golgappa | CC BY-SA 3.0 |