Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 3 additions & 27 deletions web-app/js/projects.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,11 @@
// Project Registry
// Project Registry
// Each project's HTML and logic lives in its own file under js/projects/

//To Prevent duplicate intialisation
let activeProject=null;

function getProjectHTML(projectName) {
const projects = {
'rock-paper-scissor': getRockPaperScissorHTML(),
'dice-rolling': getDiceRollingHTML(),
'coin-flip': getCoinFlipHTML(),
'number-guessing': getNumberGuessingHTML(),
'hangman': getHangmanHTML(),
'flames': getFlamesHTML(),
'emoji-memory': getEmojiMemoryGameHTML(),
'fibonacci': getFibonacciHTML(),
'progression-recognizer': getProgressionRecognizerHTML(),
'pascal-triangle': getPascalTriangleHTML(),
'armstrong': getArmstrongHTML(),
'calculator': getCalculatorHTML(),
'collatz': getCollatzHTML(),
'prime-analyzer': getPrimeAnalyzerHTML(),
'projectile-motion': getProjectileMotionHTML(),
'coordinate-polar-transform': getCoordinatePolarTransformHTML(),
'derivative-calculator': getDerivativeCalculatorHTML(),
'morse-code': getMorseCodeHTML(),
'tower-of-hanoi': getTowerOfHanoiHTML(),
'number-converter': getNumberConverterHTML(),
'typing-speed-tester': getTypingSpeedTesterHTML(),
'snake-game': getsnakeGameHTML(),
'password-forge': getPasswordForgeHTML(),
'whack-a-mole': getWhackaMoleHTML(),
'tic-tac-toe': () => getTicTacToeHTML(),
'rock-paper-scissor': () => getRockPaperScissorHTML(),
'dice-rolling': () => getDiceRollingHTML(),
Expand Down Expand Up @@ -1990,7 +1966,7 @@ function initFlames() {
name2Input.addEventListener('keypress', (e) => {
if (e.key === 'Enter') calculateFlames();
});
}
})

// ============================================
// COLLATZ CONJECTURE
Expand Down Expand Up @@ -3935,7 +3911,7 @@ function initializeProject(projectName) {
initializers[projectName]();
}
}

}
//Removed Redundant game and project Logics and seperated them to different individual files located at (web-app/js/projects/)

// ============================================================================
Expand Down
Loading