+
+
+
+
+
+
+
+
+
diff --git a/assignments/final/project source code/docs/images/back-arrow.svg b/assignments/final/project source code/docs/images/back-arrow.svg
new file mode 100644
index 0000000..bbcd50c
--- /dev/null
+++ b/assignments/final/project source code/docs/images/back-arrow.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assignments/final/project source code/docs/images/down-arrow.svg b/assignments/final/project source code/docs/images/down-arrow.svg
new file mode 100644
index 0000000..b2f8463
--- /dev/null
+++ b/assignments/final/project source code/docs/images/down-arrow.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assignments/final/project source code/docs/images/hangman.png b/assignments/final/project source code/docs/images/hangman.png
new file mode 100644
index 0000000..d406a6a
Binary files /dev/null and b/assignments/final/project source code/docs/images/hangman.png differ
diff --git a/assignments/final/project source code/docs/images/hangman/HangmanPole.png b/assignments/final/project source code/docs/images/hangman/HangmanPole.png
new file mode 100644
index 0000000..969532a
Binary files /dev/null and b/assignments/final/project source code/docs/images/hangman/HangmanPole.png differ
diff --git a/assignments/final/project source code/docs/images/hangman/HangmanPoleWithHangMan.png b/assignments/final/project source code/docs/images/hangman/HangmanPoleWithHangMan.png
new file mode 100644
index 0000000..99b1ad3
Binary files /dev/null and b/assignments/final/project source code/docs/images/hangman/HangmanPoleWithHangMan.png differ
diff --git a/assignments/final/project source code/docs/images/hangman/HangmanPoleWithHead.png b/assignments/final/project source code/docs/images/hangman/HangmanPoleWithHead.png
new file mode 100644
index 0000000..377ae00
Binary files /dev/null and b/assignments/final/project source code/docs/images/hangman/HangmanPoleWithHead.png differ
diff --git a/assignments/final/project source code/docs/images/hangman/HangmanPoleWithHeadAndBody.png b/assignments/final/project source code/docs/images/hangman/HangmanPoleWithHeadAndBody.png
new file mode 100644
index 0000000..2dd87be
Binary files /dev/null and b/assignments/final/project source code/docs/images/hangman/HangmanPoleWithHeadAndBody.png differ
diff --git a/assignments/final/project source code/docs/images/hangman/HangmanPoleWithHeadAndBodyAndBothHands.png b/assignments/final/project source code/docs/images/hangman/HangmanPoleWithHeadAndBodyAndBothHands.png
new file mode 100644
index 0000000..ed289e8
Binary files /dev/null and b/assignments/final/project source code/docs/images/hangman/HangmanPoleWithHeadAndBodyAndBothHands.png differ
diff --git a/assignments/final/project source code/docs/images/hangman/HangmanPoleWithHeadAndBodyAndBothHandsAndLeftLeg.png b/assignments/final/project source code/docs/images/hangman/HangmanPoleWithHeadAndBodyAndBothHandsAndLeftLeg.png
new file mode 100644
index 0000000..2477339
Binary files /dev/null and b/assignments/final/project source code/docs/images/hangman/HangmanPoleWithHeadAndBodyAndBothHandsAndLeftLeg.png differ
diff --git a/assignments/final/project source code/docs/images/hangman/HangmanPoleWithHeadAndBodyAndLeftHand.png b/assignments/final/project source code/docs/images/hangman/HangmanPoleWithHeadAndBodyAndLeftHand.png
new file mode 100644
index 0000000..204e8d5
Binary files /dev/null and b/assignments/final/project source code/docs/images/hangman/HangmanPoleWithHeadAndBodyAndLeftHand.png differ
diff --git a/assignments/final/project source code/docs/images/menu.svg b/assignments/final/project source code/docs/images/menu.svg
new file mode 100644
index 0000000..53cc227
--- /dev/null
+++ b/assignments/final/project source code/docs/images/menu.svg
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/assignments/final/project source code/docs/images/minesweeper.png b/assignments/final/project source code/docs/images/minesweeper.png
new file mode 100644
index 0000000..586ffe1
Binary files /dev/null and b/assignments/final/project source code/docs/images/minesweeper.png differ
diff --git a/assignments/final/project source code/docs/images/profile.jpeg b/assignments/final/project source code/docs/images/profile.jpeg
new file mode 100644
index 0000000..7857061
Binary files /dev/null and b/assignments/final/project source code/docs/images/profile.jpeg differ
diff --git a/assignments/final/project source code/docs/images/up-arrow.svg b/assignments/final/project source code/docs/images/up-arrow.svg
new file mode 100644
index 0000000..58e2020
--- /dev/null
+++ b/assignments/final/project source code/docs/images/up-arrow.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assignments/final/project source code/docs/images/x.svg b/assignments/final/project source code/docs/images/x.svg
new file mode 100644
index 0000000..f2b2cc8
--- /dev/null
+++ b/assignments/final/project source code/docs/images/x.svg
@@ -0,0 +1,4 @@
+
+
\ No newline at end of file
diff --git a/assignments/final/project source code/docs/index.html b/assignments/final/project source code/docs/index.html
new file mode 100644
index 0000000..5617e7c
--- /dev/null
+++ b/assignments/final/project source code/docs/index.html
@@ -0,0 +1,72 @@
+
+
+
+ Home - UMGC Educational Hangman
+
+
+
+
+
+
+
+
+
+
+
+
+
Welcome to the UMGC Educational Hangman Game
+
This project is a collaborative effort by a team of students focused on combining education with entertainment through an interactive Hangman game that teaches programming concepts.
+
+
+
+
+
Interactive Learning Tool
+
Engage with programming terminology in a fun and interactive way. Each correctly guessed word teaches a new concept.
+
+
+
Responsive Design
+
Our website adapts to various devices, ensuring a seamless user experience whether on a desktop, tablet, or smartphone.
+
+
+
Educational Content
+
Each successful guess is not just a win—it's a learning opportunity, providing explanations and insights into programming.
+
+
+
+
+
+
+
+
diff --git a/assignments/final/project source code/docs/js/hangman.js b/assignments/final/project source code/docs/js/hangman.js
new file mode 100644
index 0000000..afb4310
--- /dev/null
+++ b/assignments/final/project source code/docs/js/hangman.js
@@ -0,0 +1,237 @@
+// words
+const words = [
+ "algorithm", "function", "variable", "loop", "array", "boolean", "string", "integer", "float",
+ "exception", "pointer", "recursion", "binary", "syntax", "compile", "debugging", "inheritance",
+ "encapsulation", "abstraction", "polymorphism", "interface", "constructor", "destructor",
+ "method", "module", "library", "framework", "database", "devops", "agile", "scrum", "kanban",
+ "github", "markdown", "asynchronous", "callback", "closure", "prototype", "promise", "event",
+ "concurrency", "parallelism", "deadlock", "mutex", "semaphore",
+ "thread", "process", "dead code", "refactoring", "sprint"
+];
+
+// definitions
+const wordDefinitions = {
+ "algorithm": "A step-by-step procedure to solve a problem.",
+ "variable": "A container for storing data values.",
+ "function": "A block of reusable code that performs a specific task.",
+ "array": "A data structure that stores a collection of elements.",
+ "boolean": "A data type that represents true or false values.",
+ "loop": "A control flow statement that executes a block of code repeatedly.",
+ "string": "A sequence of characters.",
+ "integer": "A data type representing whole numbers.",
+ "float": "A data type representing numbers with a fractional part.",
+ "exception": "An error that occurs during the execution of a program.",
+ "pointer": "A variable that stores the memory address of another variable.",
+ "recursion": "A programming technique where a function calls itself.",
+ "binary": "A numbering system with a base of 2.",
+ "syntax": "The rules that govern the structure of statements in a programming language.",
+ "compile": "The process of translating source code into machine code.",
+ "debugging": "The process of finding and fixing errors in a program.",
+ "inheritance": "A mechanism in OOP where a class can inherit properties and behaviors from another class.",
+ "encapsulation": "The bundling of data and methods that operate on the data into a single unit.",
+ "abstraction": "The process of hiding the implementation details and showing only the essential features of an object.",
+ "polymorphism": "The ability of a single interface to represent multiple underlying data types.",
+ "interface": "A contract that specifies the methods a class must implement.",
+ "constructor": "A special type of method used to initialize objects.",
+ "destructor": "A special type of method used to destroy objects.",
+ "method": "A function associated with a class or object.",
+ "module": "A self-contained unit of code that can be reused and imported into other modules.",
+ "library": "A collection of reusable code and resources.",
+ "framework": "A reusable, prewritten code or set of libraries that provide generic functionality.",
+ "database": "A structured set of data stored and organized for easy access and retrieval.",
+ "devops": "A set of practices that combines software development and IT operations to shorten the systems development life cycle and provide continuous delivery with high software quality.",
+ "agile": "A set of principles for software development under which requirements and solutions evolve through the collaborative effort of self-organizing cross-functional teams.",
+ "scrum": "An Agile framework for completing complex projects, typically used in software development.",
+ "kanban": "A method for managing knowledge work with an emphasis on just-in-time delivery while not overloading the team members.",
+ "github": "A web-based platform for hosting and collaborating on Git repositories.",
+ "markdown": "A lightweight markup language with plain-text formatting syntax.",
+ "asynchronous": "A programming pattern that allows operations to run separately from the main program flow.",
+ "callback": "A function passed as an argument to another function, to be executed later.",
+ "closure": "A function bundled together with its lexical environment.",
+ "prototype": "An object used as a template from which to create other objects.",
+ "promise": "An object representing the eventual completion or failure of an asynchronous operation.",
+ "event": "A signal that indicates that something has happened.",
+ "concurrency": "The ability of different parts or units of a program to be executed out-of-order or in partial order.",
+ "parallelism": "The simultaneous execution of multiple tasks.",
+ "deadlock": "A situation where two or more processes are unable to proceed because each is waiting for the other to do something.",
+ "mutex": "A synchronization primitive used to control access to a shared resource by multiple threads.",
+ "semaphore": "A synchronization primitive that restricts the number of simultaneous users of a shared resource.",
+ "thread": "The smallest unit of execution that can be scheduled by an operating system.",
+ "process": "An instance of a computer program that is being executed.",
+ "refactoring": "The process of restructuring existing computer code without changing its external behavior.",
+ "sprint": "A short, time-boxed period during which a specific task must be completed and made ready for review."
+};
+
+// game state var.
+let selectedWord, selectedDefinition;
+let guessedLetters, wrongGuesses, attempts;
+
+// max allowed incorrect guesses.
+const maxAttempts = 6;
+
+// paths to images corresponding to different stages of hangman.
+const hangmanImages = [
+ 'images/hangman/HangmanPole.png',
+ 'images/hangman/HangmanPoleWithHead.png',
+ 'images/hangman/HangmanPoleWithHeadAndBody.png',
+ 'images/hangman/HangmanPoleWithHeadAndBodyAndLeftHand.png',
+ 'images/hangman/HangmanPoleWithHeadAndBodyAndBothHands.png',
+ 'images/hangman/HangmanPoleWithHeadAndBodyAndBothHandsAndLeftLeg.png',
+ 'images/hangman/HangmanPoleWithHangMan.png'
+];
+
+
+// added to handle wrong guesses and initialize and now claling correct html for funcitonality
+function updateWrongGuesses() {
+ const wrongGuessesElement = document.getElementById('wrongGuesses');
+ console.log(wrongGuessesElement);
+ if (wrongGuessesElement !== null) {
+ wrongGuessesElement.textContent = 'Wrong guesses: ' + attempts;
+ } else {
+ console.error('Wrong guesses display element not found!');
+ }
+}
+
+
+// init game once the HTML document has fully loaded.
+document.addEventListener('DOMContentLoaded', initializeGame);
+
+// init game by setting game state and updating UI components.
+function initializeGame() {
+ try{
+ // select random word from list.
+ const randomIndex = Math.floor(Math.random() * words.length);
+ selectedWord = words[randomIndex];
+ selectedDefinition = wordDefinitions[selectedWord];
+
+ // reset game state.
+ guessedLetters = [];
+ wrongGuesses = [];
+ attempts = 0;
+
+ // init UI components.
+ createLetterButtons();
+ updateWordDisplay();
+ updateHangmanImage();
+ updateWrongGuesses();
+ } catch (error) {
+ console.error('Error Initializing game:', error);
+ }
+}
+
+// creates/displays letter buttons for user interaction.
+function createLetterButtons() {
+ // define alphabet for buttons
+ const letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
+ const letterContainer = document.getElementById('letterButtons');
+ letterContainer.innerHTML = '';
+
+ // create button for each letter in alph
+ letters.split('').forEach(letter => {
+ const button = document.createElement('button');
+ button.textContent = letter;
+ button.id = 'letter-' + letter;
+ button.onclick = function() { handleGuess(letter); };
+ letterContainer.appendChild(button);
+ });
+}
+
+// hanles guessess, added console logging and try/catch for troubleshooting....
+
+function handleGuess(letter) {
+ try {
+ console.log('Guessed letter:', letter);
+ console.log('Current state:', { guessedLetters, wrongGuesses, attempts });
+
+ const button = document.getElementById('letter-' + letter);
+ button.disabled = true;
+
+ if (selectedWord.toUpperCase().includes(letter)) {
+ if (!guessedLetters.includes(letter)) {
+ guessedLetters.push(letter);
+ }
+ button.style.backgroundColor = '#D3D3D3';
+ updateWordDisplay();
+ } else {
+ if (!wrongGuesses.includes(letter)) {
+ wrongGuesses.push(letter);
+ attempts++;
+ button.style.backgroundColor = 'red';
+ updateHangmanImage();
+ updateWrongGuesses();
+ }
+ }
+ checkGameOver();
+ } catch (error) {
+ console.error('Error handling guess:', error, { guessedLetters, wrongGuesses, attempts });
+ }
+}
+
+
+// updates display of word with correctly guessed letters.
+function updateWordDisplay() {
+ const wordDisplay = document.getElementById('wordDisplay');
+ wordDisplay.innerText = selectedWord.split('').map(letter =>
+ guessedLetters.includes(letter.toUpperCase()) ? letter : '_'
+ ).join(' ');
+}
+
+// checks if game has ended by winning or losing.
+function checkGameOver() {
+ const wordDisplay = document.getElementById('wordDisplay').innerText.replace(/\s+/g, '');
+ if (!wordDisplay.includes('_')) {
+ // If no blanks, player wins.
+ alert(`Congratulations! You won! The word was "${selectedWord}". Definition: ${selectedDefinition}`);
+ initializeGame();
+ } else if (attempts >= maxAttempts) {
+ // If max number of attempts is reached, update image before showing the game over alert.
+
+ updateHangmanImage()
+
+
+ // Delay the game over alert to allow the image to update on the screen.
+ setTimeout(() => {
+ alert(`Game Over! The correct word was "${selectedWord}". Definition: ${selectedDefinition}`);
+ initializeGame();
+ }, 500); // Delay of 500 milliseconds (0.5 seconds)
+ }
+}
+
+
+// updates hangman image to reflect current number of incorrect guesses.
+function updateHangmanImage() {
+ const hangmanImage = document.querySelector('.hangman-images');
+ if (attempts <= maxAttempts) {
+ hangmanImage.src = hangmanImages[attempts];
+ }
+}
+
+// handles logic when player submits fullword guess.
+function submitFullWordGuess() {
+ const fullWordGuess = document.getElementById('fullWordGuess');
+ const guess = fullWordGuess.value.toLowerCase();
+ fullWordGuess.value = '';
+
+ if (guess === selectedWord) {
+ // If the guess is correct, the player wins.
+ guessedLetters = selectedWord.split('');
+ updateWordDisplay();
+ alert(`Congratulations! You guessed the word: ${selectedWord}. Definition: ${selectedDefinition}`);
+ initializeGame();
+ } else {
+ // uncorrect fullword guesses count as a failed attempt(s).
+ if (!wrongGuesses.includes(document.getElementById('wordDisplay').innerText)) {
+ wrongGuesses.push(document.getElementById('wordDisplay').innerText);
+ attempts++;
+ updateHangmanImage();
+ updateWrongGuesses();
+ }
+ checkGameOver();
+ }
+}
+
+//handles reset game button onclick
+function restartGame() {
+ initializeGame()
+}
+
diff --git a/assignments/final/project source code/docs/js/minesweeper.js b/assignments/final/project source code/docs/js/minesweeper.js
new file mode 100644
index 0000000..440da83
--- /dev/null
+++ b/assignments/final/project source code/docs/js/minesweeper.js
@@ -0,0 +1,12 @@
+parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,u=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return u=t.done,t},e:function(t){s=!0,o=t},f:function(){try{u||null==n.return||n.return()}finally{if(s)throw o}}}}function r(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rj(this,d,"f")-1))for(var a=e-1;a<=e+1;a++)if(!(a<0||a>j(this,l,"f")-1||n==t&&a==e)){var i=document.querySelector("[data-x = '".concat(n,"'][data-y = '").concat(a,"']"));"unchecked"===(null==i?void 0:i.getAttribute("data-status"))&&r.push(i)}return r},k=function(){return Array.from(document.querySelectorAll("[data-type = 'notmine']")).every(function(t){return"checked"===t.getAttribute("data-status")})},A=function r(n,a){var i=document.querySelector("[data-x = '".concat(n,"'][data-y = '").concat(a,"']"));i.setAttribute("data-status","checked");var o,u=j(this,f,"m",g).call(this,n,a),s=0,c=e(u);try{for(c.s();!(o=c.n()).done;){"mine"===o.value.getAttribute("data-type")&&s++}}catch(h){c.e(h)}finally{c.f()}if(s>0)i.innerHTML=String(s),i.setAttribute("data-num-adj-mines",String(s));else for(var l=0;l0?"".concat(Number(m(this,c,"f"))," minute").concat(m(this,c,"f")>1?"s":"",", "):"").concat(Number(m(this,f,"f"))," second").concat(1!=m(this,f,"f")?"s":"")}}])}();c=new WeakMap,f=new WeakMap,u=new WeakMap,s=new WeakSet,l=function(){var t;60==p(this,f,m(this,f,"f")+1,"f")&&(p(this,f,0,"f"),p(this,c,(t=m(this,c,"f"),++t),"f")),m(this,s,"m",y).call(this)},h=function(t){return t>=10?String(t):"0".concat(t)},y=function(){t.minuteDisplay.textContent=m(this,s,"m",h).call(this,m(this,c,"f")),t.secondDisplay.textContent=m(this,s,"m",h).call(this,m(this,f,"f"))};var w=exports.default=v;
+ },{"./elements":"uIMb"}],"epB2":[function(require,module,exports) {
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.setOutcome=L,exports.startTimer=y,exports.updateInfo=E;var e=require("./elements"),t=r(require("./Board")),n=r(require("./BoardUI")),i=r(require("./Timer"));function r(e){return e&&e.__esModule?e:{default:e}}function a(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=s(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,l=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return l=e.done,e},e:function(e){o=!0,a=e},f:function(){try{l||null==n.return||n.return()}finally{if(o)throw a}}}}function s(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n30)&&i.push("Width must be between 1 and 30 cells."),(t<=0||t>30)&&i.push("Length must be between 1 and 30 cells."),(n<=0||n>=e*t)&&i.push("Number of mines must be greater than 0 and less than the total number of cells."),0===i.length&&(h=e,g=t,v=n),i}function w(){e.validationErrMsgs.innerHTML=""}function b(t){var n,i=a(t);try{for(i.s();!(n=i.n()).done;){var r=n.value,s=document.createElement("p");s.textContent=r,e.validationErrMsgs.appendChild(s)}}catch(l){i.e(l)}finally{i.f()}}function y(){f.start()}function E(){d&&n.default.renderInfo(d.getNumMines(),d.getFlaggedMines())}function L(e){f.pause(),n.default.showAllMines(),"classic"===c&&"win"===e&&m++,"classic"===c&&m>o.length?n.default.renderEndGameDialog(c,e,f.getTimeString(),!0):n.default.renderEndGameDialog(c,e,f.getTimeString(),!1)}function I(){switch(f.reset(),n.default.clearBoardAndInfo(),u){case"main":e.mainMenu.classList.remove("hidden"),e.instructions.classList.add("hidden"),e.game.classList.add("hidden");break;case"instructions":e.mainMenu.classList.add("hidden"),e.instructions.classList.remove("hidden"),e.game.classList.add("hidden");break;case"game":e.mainMenu.classList.add("hidden"),e.instructions.classList.add("hidden"),e.game.classList.remove("hidden"),d&&(n.default.renderInitialBoard(d.getLength(),d.getWidth(),d.getHandleMouseDownFunction()),e.levelInfo.textContent="classic"===c?o[m].level:"",E())}}e.startClassicButton.addEventListener("click",function(){c="classic";var e=o[m];d=new t.default(e.width,e.length,e.mines),u="instructions",I()}),e.startCustomizedButton.addEventListener("click",function(){w();var n=p(Number(e.widthInput.value),Number(e.lengthInput.value),Number(e.minesInput.value));n.length>0?b(n):(c="customized",null===e.customizationForm||void 0===e.customizationForm||e.customizationForm.reset(),d=new t.default(h,g,v),u="instructions",I())}),e.exitInstructionsButton.addEventListener("click",function(){u="game",I()}),e.restartButtons.forEach(function(i){return i.addEventListener("click",function(){if("classic"===c){var i=o[m];d=new t.default(i.width,i.length,i.mines)}"customized"===c&&(d=new t.default(h,g,v)),n.default.resetEndGameDialog(),e.endGameDialog.close(),I()})}),e.returnButtons.forEach(function(e){return e.addEventListener("click",function(){"classic"===c&&(m=0),n.default.resetEndGameDialog(),u="main",I()})}),I();
+ },{"./elements":"uIMb","./Board":"qpgg","./BoardUI":"Mwuz","./Timer":"UnlX"}]},{},["epB2"], null)
+ //# sourceMappingURL=/main.ee316cbf.js.map
\ No newline at end of file
diff --git a/assignments/final/project source code/docs/js/nav.js b/assignments/final/project source code/docs/js/nav.js
new file mode 100644
index 0000000..4f1d554
--- /dev/null
+++ b/assignments/final/project source code/docs/js/nav.js
@@ -0,0 +1,27 @@
+const navDesktopTablet = document.getElementById('nav-desktop-tablet');
+const navMobile = document.getElementById('nav-mobile');
+const navMobileButtonImg = document.querySelector('#nav-mobile button img');
+const navMobileLinks = document.querySelector('#nav-mobile div');
+
+window.addEventListener("load", adjustNavToScreenSize);
+window.addEventListener('resize', adjustNavToScreenSize);
+
+function adjustNavToScreenSize() {
+ if (window.innerWidth <= 480) {
+ navDesktopTablet.classList.add('hidden');
+ navMobile.classList.remove('hidden');
+ } else {
+ navDesktopTablet.classList.remove('hidden');
+ navMobile.classList.add('hidden');
+ }
+}
+
+navMobile.addEventListener('click', () => {
+ const link = navMobileButtonImg.getAttribute('src');
+ if (link.includes('menu')) {
+ navMobileButtonImg.setAttribute('src', 'images/x.svg');
+ } else {
+ navMobileButtonImg.setAttribute('src', 'images/menu.svg');
+ }
+ navMobileLinks.classList.toggle('hidden');
+})
\ No newline at end of file
diff --git a/assignments/final/project source code/docs/js/team.js b/assignments/final/project source code/docs/js/team.js
new file mode 100644
index 0000000..7903314
--- /dev/null
+++ b/assignments/final/project source code/docs/js/team.js
@@ -0,0 +1,52 @@
+const profiles = document.querySelectorAll(".profile");
+// profiles.forEach(profile => profile.classList.add("hidden"));
+
+const profileButtons = document.querySelectorAll(".toggle-profile");
+profileButtons.forEach(button => button.addEventListener("click", toggleProfile));
+
+const profileArrows = document.querySelectorAll(".toggle-profile img");
+
+window.addEventListener("load", adjustVisToScreenSize);
+window.addEventListener("resize", adjustVisToScreenSize)
+
+function adjustVisToScreenSize() {
+ if (window.innerWidth <= 480) {
+ profileButtons.forEach(profileButton => profileButton.classList.remove("hidden"));
+ profiles.forEach(profile => profile.classList.add("hidden"));
+ } else {
+ profileButtons.forEach(profileButton => profileButton.classList.add("hidden"));
+ profiles.forEach(profile => profile.classList.remove("hidden"));
+ }
+}
+
+function toggleProfile(e) {
+ // obtaining profile button and profile div
+ const currentProfileButton = e.target.closest("button");
+ const dataId = currentProfileButton.getAttribute("data-id");
+ const currentProfileArrow = document.querySelector(`img[data-id='${dataId}']`);
+ const currentProfile = document.querySelector(`div[data-id='${dataId}']`);
+
+ // closing/resetting any open profile buttons/divs
+ profiles.forEach(profile => {
+ if (profile != currentProfile) {
+ profile.classList.add("hidden");
+ profile.classList.remove("collapse-top-margin");
+ }
+ });
+ profileButtons.forEach(profileButton => {
+ if (profileButton != currentProfileButton) profileButton.classList.remove("collapse-bottom-margin");
+ });
+ profileArrows.forEach(profileArrow => {
+ if (profileArrow != currentProfileArrow) profileArrow.setAttribute("src", "./images/down-arrow.svg");
+ });
+
+ // opening current profile div
+ currentProfileButton.classList.toggle("collapse-bottom-margin");
+ currentProfile.classList.toggle("hidden");
+ currentProfile.classList.toggle("collapse-top-margin");
+ if (currentProfileArrow.getAttribute("src").includes("down")) {
+ currentProfileArrow.setAttribute("src", "./images/up-arrow.svg");
+ } else {
+ currentProfileArrow.setAttribute("src", "./images/down-arrow.svg");
+ }
+}
\ No newline at end of file
diff --git a/assignments/final/project source code/docs/minesweeper.html b/assignments/final/project source code/docs/minesweeper.html
new file mode 100644
index 0000000..ae06b78
--- /dev/null
+++ b/assignments/final/project source code/docs/minesweeper.html
@@ -0,0 +1,44 @@
+Minesweeper
+
+
+
+
+
+
Minesweeper
Classic
Starts with a beginner grid and mine density. Increases in difficulty with each successful round.
Customized
Choose your own grid dimensions and mine density.
Instructions
You will be presented with a grid of squares. Most of the squares will be safe,but some will conceal deadly mines.
If you click on a safe square, the number of adjacent mines will be revealed (anywhere from 1 to 8). When there are no adjacent mines, surrounding squares will automatically be revealed until mines are encountered. But if you click on a square containing a hidden mine--boom!
The game ends when you have either accidentally discovered a mine, or cleared all safe squares.
Tips + Other Info
The first click is always safe. There will never be a mine hiding under the first cell you choose.
Not loving the current grid? Click on the happy emoji above the board to generate new mine placements and start over.
Right-click to toggle between three states: uncleared, flagged (highly suspicious for mine activity), and question mark (somewhat suspicious). Although these states have no bearing on the final outcome, they can help you deduce which cells have mines.
If you use the flag feature, keep an eye on the total number of flagged mines. This can help you assess risk and track your progress.
Watch the time! The time only starts after the first click. The faster you can clear a grid, the better!
For more information and to view basic patterns, visit this minesweeper guide.
00:00
+
+
+
+
+
\ No newline at end of file
diff --git a/assignments/final/project source code/docs/team.html b/assignments/final/project source code/docs/team.html
new file mode 100644
index 0000000..01d4b3a
--- /dev/null
+++ b/assignments/final/project source code/docs/team.html
@@ -0,0 +1,116 @@
+
+
+
+
+
+ Meet the Team
+
+
+
+
+
+
+
+
+
+
+
+
+
Meet the Team
+
+
+
+
+
+
+
+
Charles Bostwick | Title
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+
+
+
+
+
+
+
Jade Pearl | Title
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+
+
+
+
+
+
+
Ada Truong | Title
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+
+
+
+
+
+
+
Holland Brawner | Title
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+
+
+
+
+
+
+
Robyn Cohen | Title
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/documents.html b/docs/documents.html
index a0d85b0..3a7d33e 100644
--- a/docs/documents.html
+++ b/docs/documents.html
@@ -33,42 +33,42 @@
Project Documentation
-
Plans and Specifications
-
+
Design Plan
+
-
Design Plan
-
+
Development Plan
+
Test Plan
-
+
Phase I
-
+
Phase II
-
+
Phase III
-
+
Final
-
+
diff --git a/docs/documents/CMSC495DesignPlan.pdf b/docs/documents/CMSC495DesignPlan.pdf
new file mode 100644
index 0000000..e6a3d04
Binary files /dev/null and b/docs/documents/CMSC495DesignPlan.pdf differ
diff --git a/docs/documents/CMSC495DevelopmentPlan.pdf b/docs/documents/CMSC495DevelopmentPlan.pdf
new file mode 100644
index 0000000..093cd63
Binary files /dev/null and b/docs/documents/CMSC495DevelopmentPlan.pdf differ
diff --git a/docs/documents/CMSC495PhaseI.pdf b/docs/documents/CMSC495PhaseI.pdf
new file mode 100644
index 0000000..95c1e5f
Binary files /dev/null and b/docs/documents/CMSC495PhaseI.pdf differ
diff --git a/docs/documents/CMSC495PhaseII.pdf b/docs/documents/CMSC495PhaseII.pdf
new file mode 100644
index 0000000..8cb33ba
Binary files /dev/null and b/docs/documents/CMSC495PhaseII.pdf differ
diff --git a/docs/documents/CMSC495PhaseIII.pdf b/docs/documents/CMSC495PhaseIII.pdf
new file mode 100644
index 0000000..8e7c726
Binary files /dev/null and b/docs/documents/CMSC495PhaseIII.pdf differ
diff --git a/docs/documents/CMSC495TestPlanUserGuide.pdf b/docs/documents/CMSC495TestPlanUserGuide.pdf
new file mode 100644
index 0000000..d4b8251
Binary files /dev/null and b/docs/documents/CMSC495TestPlanUserGuide.pdf differ
diff --git a/docs/js/hangman.js b/docs/js/hangman.js
index 9f72896..afb4310 100644
--- a/docs/js/hangman.js
+++ b/docs/js/hangman.js
@@ -5,9 +5,8 @@ const words = [
"encapsulation", "abstraction", "polymorphism", "interface", "constructor", "destructor",
"method", "module", "library", "framework", "database", "devops", "agile", "scrum", "kanban",
"github", "markdown", "asynchronous", "callback", "closure", "prototype", "promise", "event",
- "event loop", "concurrency", "parallelism", "deadlock", "race condition", "mutex", "semaphore",
- "thread", "process", "thread pool", "dead code", "refactoring", "code smell", "unit test",
- "integration test", "regression test", "sprint"
+ "concurrency", "parallelism", "deadlock", "mutex", "semaphore",
+ "thread", "process", "dead code", "refactoring", "sprint"
];
// definitions
@@ -52,22 +51,14 @@ const wordDefinitions = {
"prototype": "An object used as a template from which to create other objects.",
"promise": "An object representing the eventual completion or failure of an asynchronous operation.",
"event": "A signal that indicates that something has happened.",
- "event loop": "A mechanism that waits for and dispatches events or messages in a program.",
"concurrency": "The ability of different parts or units of a program to be executed out-of-order or in partial order.",
"parallelism": "The simultaneous execution of multiple tasks.",
"deadlock": "A situation where two or more processes are unable to proceed because each is waiting for the other to do something.",
- "race condition": "A situation in which the behavior of a program depends on the timing of uncontrollable events.",
"mutex": "A synchronization primitive used to control access to a shared resource by multiple threads.",
"semaphore": "A synchronization primitive that restricts the number of simultaneous users of a shared resource.",
"thread": "The smallest unit of execution that can be scheduled by an operating system.",
"process": "An instance of a computer program that is being executed.",
- "thread pool": "A collection of threads that are created once and reused for multiple tasks.",
- "dead code": "Code that is never executed.",
"refactoring": "The process of restructuring existing computer code without changing its external behavior.",
- "code smell": "A surface indication that usually corresponds to a deeper problem in the system.",
- "unit test": "A piece of code that tests a specific unit of functionality.",
- "integration test": "Testing performed to examine the behavior of components when integrated together.",
- "regression test": "Testing performed to verify that a recent program or code change has not adversely affected existing features.",
"sprint": "A short, time-boxed period during which a specific task must be completed and made ready for review."
};
@@ -95,7 +86,7 @@ function updateWrongGuesses() {
const wrongGuessesElement = document.getElementById('wrongGuesses');
console.log(wrongGuessesElement);
if (wrongGuessesElement !== null) {
- wrongGuessesElement.textContent = 'Wrong guesses: ' + wrongGuesses.join(', ');
+ wrongGuessesElement.textContent = 'Wrong guesses: ' + attempts;
} else {
console.error('Wrong guesses display element not found!');
}
@@ -194,7 +185,9 @@ function checkGameOver() {
initializeGame();
} else if (attempts >= maxAttempts) {
// If max number of attempts is reached, update image before showing the game over alert.
- updateHangmanImage();
+
+ updateHangmanImage()
+
// Delay the game over alert to allow the image to update on the screen.
setTimeout(() => {
@@ -227,8 +220,18 @@ function submitFullWordGuess() {
initializeGame();
} else {
// uncorrect fullword guesses count as a failed attempt(s).
- attempts++;
- updateHangmanImage();
+ if (!wrongGuesses.includes(document.getElementById('wordDisplay').innerText)) {
+ wrongGuesses.push(document.getElementById('wordDisplay').innerText);
+ attempts++;
+ updateHangmanImage();
+ updateWrongGuesses();
+ }
checkGameOver();
}
}
+
+//handles reset game button onclick
+function restartGame() {
+ initializeGame()
+}
+