Skip to content

Commit

Permalink
created infographic
Browse files Browse the repository at this point in the history
  • Loading branch information
yashrajbharti committed Jan 1, 2024
1 parent 8efc2d2 commit 991c1ab
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ let weaknessMap = new Map([
["Dark", ["Fighting", "Bug", "Fairy"]],
["Fairy", "Poison", "Steel"],
]);
console.log(weaknessMap);

const getRocketLeaderData = async (leader, format = ".txt") => {
// Replace ./data.json with your JSON feed
Expand All @@ -29,15 +28,25 @@ const getRocketLeaderData = async (leader, format = ".txt") => {
.then((data) => {
// Work with JSON data here
rawText = data;
console.log(rawText);
buildSlots(rawText);
})
.catch((err) => {
console.log(err);
// Do something for an error here
});
};
getRocketLeaderData("arlo");
getRocketLeaderData("cliff");
getRocketLeaderData("sierra");
getRocketLeaderData("giovanni");
// getRocketLeaderData("cliff");
// getRocketLeaderData("sierra");
// getRocketLeaderData("giovanni");
// getRocketLeaderData("pokedex", ".json");

const buildSlots = (data) => {
let slots = [];
const refinedData = data.split(/[\n\r\ ]/g);
for (const datum of refinedData.slice(1)) {
if (datum === "" || datum === "-") continue;
slots.push(datum.replace(/[:]/g, "").replace("shiny", ""));
}
console.log(slots);
};

0 comments on commit 991c1ab

Please sign in to comment.