revealLength returns the number of runes to show at each end.
(n int)
| 22 | |
| 23 | // revealLength returns the number of runes to show at each end. |
| 24 | func revealLength(n int) int { |
| 25 | switch { |
| 26 | case n >= 20: |
| 27 | return 4 |
| 28 | case n >= 10: |
| 29 | return 2 |
| 30 | case n >= 5: |
| 31 | return 1 |
| 32 | default: |
| 33 | return 0 |
| 34 | } |
| 35 | } |