Skip to content

Commit 1d53a91

Browse files
author
Your Name
committed
fix: resolve fibonacci-duplicate-cards
1 parent 02131ee commit 1d53a91

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

web-app/js/projects/fibonacci.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,11 @@ function initFibonacci() {
138138
Math.PI * (direction + 1) / 2);
139139
ctx.stroke();
140140

141+
const nextTerm = (fib[i+1] !== undefined ? fib[i+1] : num);
141142
switch(direction) {
142-
case 0: y -= fib[i+1] * scale; break;
143+
case 0: y -= nextTerm * scale; break;
143144
case 1: x -= size; break;
144-
case 2: y -= size; x -= fib[i+1] * scale; break;
145+
case 2: y -= size; x -= nextTerm * scale; break;
145146
case 3: x += size; break;
146147
}
147148

0 commit comments

Comments
 (0)