(rows: number, trailMultiplier: number)
| 17 | * @param trailMultiplier Multiplier for trail length based on fade setting |
| 18 | */ |
| 19 | export function createColumn(rows: number, trailMultiplier: number): MatrixColumn { |
| 20 | const cells: MatrixCell[] = []; |
| 21 | for (let r = 0; r < rows; r++) { |
| 22 | cells.push({ val: ' ', isHead: false }); |
| 23 | } |
| 24 | |
| 25 | return { |
| 26 | cells, |
| 27 | head: 0, |
| 28 | spaceRemaining: Math.floor(Math.random() * rows) + 1, |
| 29 | lengthRemaining: Math.floor((Math.random() * (rows - 3) + 3) * trailMultiplier), |
| 30 | updateSpeed: Math.floor(Math.random() * 3) + 1 |
| 31 | }; |
| 32 | } |
| 33 | |
| 34 | /** |
| 35 | * Updates a MatrixColumn by shifting (moving head) and inserting new characters. |
no outgoing calls
no test coverage detected