From 3d1bdd3cea93d40ac56c09fb481278f7ce45d831 Mon Sep 17 00:00:00 2001 From: Shreshth Jaiswal <67462416+shreshth02@users.noreply.github.com> Date: Mon, 28 Mar 2022 10:32:08 +0530 Subject: [PATCH 1/4] Update app.js --- src/app.js | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/src/app.js b/src/app.js index cc43cc2..b067ce5 100644 --- a/src/app.js +++ b/src/app.js @@ -26,7 +26,21 @@ const initPlayers = (players) => { let detailedPlayers = []; // Create players using for loop // Type your code here - + for(var i=0;i { const getRandomStrength = () => { // Return a random integer (0,100] // Note: You can use Math.random() and Math.ceil() + let s = Math.ceil(Math.random() * (100-1) + 1); + return s; } const buildPlayers = (players, type) => { @@ -42,7 +58,13 @@ const buildPlayers = (players, type) => { // Loop through players and accumulate HTML template // depending of type of player(hero|villain) // Type your code here - + for(var i=0;i
${players[i].name}
${players[i].strength}
`; + } + } return fragment; } // Display players in HTML @@ -55,4 +77,4 @@ const viewPlayers = (players) => { window.onload = () => { viewPlayers(initPlayers(PLAYERS)); -} \ No newline at end of file +} From e5798366b260dc7cc6fb4e65bcb318129e6c3970 Mon Sep 17 00:00:00 2001 From: Shreshth Jaiswal <67462416+shreshth02@users.noreply.github.com> Date: Mon, 28 Mar 2022 10:32:37 +0530 Subject: [PATCH 2/4] Update style.css --- src/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/style.css b/src/style.css index dfa09a8..f4ac549 100644 --- a/src/style.css +++ b/src/style.css @@ -18,7 +18,7 @@ .player { border-radius: 5px; box-shadow: 0px 0px 2px 2px rgba(0, 0, 0, 0.2); - margin: 10px; + margin: 10px; padding: 1rem; text-align: center; width: 100px; From 4d632e467b7e765672bea5d8c76c449b676575a7 Mon Sep 17 00:00:00 2001 From: Shreshth Jaiswal <67462416+shreshth02@users.noreply.github.com> Date: Fri, 8 Apr 2022 09:39:48 +0530 Subject: [PATCH 3/4] Prograd ID : 8730 --- src/app.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app.js b/src/app.js index b067ce5..145427b 100644 --- a/src/app.js +++ b/src/app.js @@ -78,3 +78,4 @@ const viewPlayers = (players) => { window.onload = () => { viewPlayers(initPlayers(PLAYERS)); } + From 3c858f69437bbc54576aa7fc1eb5c167e4365de8 Mon Sep 17 00:00:00 2001 From: Shreshth Jaiswal <67462416+shreshth02@users.noreply.github.com> Date: Fri, 8 Apr 2022 09:40:12 +0530 Subject: [PATCH 4/4] Prograd ID : 8730 --- src/style.css | 1 + 1 file changed, 1 insertion(+) diff --git a/src/style.css b/src/style.css index f4ac549..f09ac9f 100644 --- a/src/style.css +++ b/src/style.css @@ -42,3 +42,4 @@ margin-left: 80px; font-size: 18px; } +