Skip to content

Commit

Permalink
remove popping
Browse files Browse the repository at this point in the history
  • Loading branch information
codekansas committed Sep 11, 2024
1 parent 8df7532 commit 82f773e
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions frontend/src/components/landing/HeroASCIIArt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const HeroASCIIArt = () => {
const [currentRule, setCurrentRule] = useState(0);
const [gridInitialized, setGridInitialized] = useState(false);
const [expanded, setExpanded] = useState(false);
const [noUpdateCount, setNoUpdateCount] = useState(0);

const rules = [
// Mazectric rules
Expand Down Expand Up @@ -53,7 +52,6 @@ const HeroASCIIArt = () => {
const rule = rules[currentRule];
const newGrid = currentGrid.map((row) => [...row]);
const newActiveCells = new Set<string>();
let cellsUpdated = false;

const checkAndUpdateCell = (y: number, x: number) => {
const neighbors = [
Expand Down Expand Up @@ -85,10 +83,6 @@ const HeroASCIIArt = () => {
}
}
}

if (newState !== currentGrid[y][x]) {
cellsUpdated = true;
}
};

// Check all currently active cells and their neighbors
Expand All @@ -112,12 +106,6 @@ const HeroASCIIArt = () => {
}
}

if (!cellsUpdated) {
setNoUpdateCount((prev) => prev + 1);
} else {
setNoUpdateCount(0);
}

activeCellsRef.current = newActiveCells;
return newGrid;
},
Expand Down Expand Up @@ -243,12 +231,6 @@ const HeroASCIIArt = () => {

const updateAndDraw = () => {
gridRef.current = updateGrid(gridRef.current);

if (noUpdateCount >= 2) {
gridRef.current = drawHardCodedStartingBlock(gridRef.current);
setNoUpdateCount(0);
}

drawGrid(gridRef.current);
};

Expand Down Expand Up @@ -299,7 +281,6 @@ const HeroASCIIArt = () => {
initializeGrid,
updateGrid,
gridInitialized,
noUpdateCount,
drawHardCodedStartingBlock,
]);

Expand Down

0 comments on commit 82f773e

Please sign in to comment.