(x int)
| 278 | } |
| 279 | |
| 280 | func getColor(x int) string { |
| 281 | rainbow := []string{ |
| 282 | "magenta", |
| 283 | "red", |
| 284 | "yellow", |
| 285 | "green", |
| 286 | "cyan", |
| 287 | "blue", |
| 288 | } |
| 289 | |
| 290 | ix := x % len(rainbow) |
| 291 | |
| 292 | return rainbow[ix] |
| 293 | } |
| 294 | |
| 295 | func clear() { |
| 296 | // on windows we'd do cmd := exec.Command("cmd", "/c", "cls"); unfortunately the draw speed is so |