Timeline for Make me a fake loader
Current License: CC BY-SA 3.0
3 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 13, 2016 at 16:45 | history | edited | Tom Lazar | CC BY-SA 3.0 |
added 157 characters in body
|
Dec 13, 2016 at 16:36 | comment | added | manatwork |
Given you have a single line of output to overwrite, the system'clear' is overkill here. Also the use of the separate variable i. Oh, and precalculate where possible: 0.750-0.01 → 0.749 (also note that you lack one decimal place in 0.01 – should be 0.001). The resulting 101.times{|c|$><<"\rloading #{'-\|/'[c%4]} #{c} %";sleep rand*0.749+0.001} becomes very similar to Conor O'Brien's Ruby answer in Loading… Forever but so is the challenge.
|
|
Dec 13, 2016 at 16:10 | history | answered | Tom Lazar | CC BY-SA 3.0 |