(garden [][]*Cell, player *Player, io *iostreams.IOStreams)
| 440 | } |
| 441 | |
| 442 | func statusLine(garden [][]*Cell, player *Player, io *iostreams.IOStreams) string { |
| 443 | width := io.TerminalWidth() |
| 444 | statusLines := []string{garden[player.Y][player.X].StatusLine} |
| 445 | |
| 446 | if player.ShoeMoistureContent > 1 { |
| 447 | statusLines = append(statusLines, "Your shoes squish with water from the stream.") |
| 448 | } else if player.ShoeMoistureContent == 1 { |
| 449 | statusLines = append(statusLines, "Your shoes seem to have dried out.") |
| 450 | } else { |
| 451 | statusLines = append(statusLines, "") |
| 452 | } |
| 453 | |
| 454 | for i, line := range statusLines { |
| 455 | if len(line) < width { |
| 456 | paddingSize := width - len(line) |
| 457 | statusLines[i] = line + strings.Repeat(" ", paddingSize) |
| 458 | } |
| 459 | } |
| 460 | |
| 461 | return strings.Join(statusLines, "\n") |
| 462 | } |
| 463 | |
| 464 | func shaToColorFunc(sha string) func(string) string { |
| 465 | return func(c string) string { |
no test coverage detected