Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Slugcat registry
- const activeWildlifeRegistry = [
- { name: "Hunter", hungerLevel: 7, location: "Industrial Complex" },
- { name: "Monk", hungerLevel: 2, location: "Shaded Citadel" },
- { name: "Saint", hungerLevel: 1, location: "Sky Islands" },
- { name: "Gourmand", hungerLevel: 9, location: "Shoreline" },
- { name: "Rivulet", hungerLevel: 3, location: "Submerged Superstructure" }
- ];
- // Function to pick a random slugcat
- function pickRandomSlugcat(registry) {
- const randomIndex = Math.floor(Math.random() * registry.length);
- return registry[randomIndex];
- }
- // Function to "locate" a slugcat, with a small chance to lose signal
- function locateSlugcat(slugcat) {
- const signalLost = Math.random() < 0.01; // 1% chance
- if (signalLost) {
- return {
- status: "NOT_FOUND",
- slugcat: null,
- timestamp: new Date().toISOString(),
- notes: "Signal lost! Unable to locate slugcat at this moment."
- };
- }
- return {
- status: "FOUND",
- slugcat: slugcat,
- timestamp: new Date().toISOString(),
- notes: `${slugcat.name} successfully identified within registry.`
- };
- }
- // Main program
- const randomSlugcat = pickRandomSlugcat(activeWildlifeRegistry);
- const searchResult = locateSlugcat(randomSlugcat);
- // Display the result
- if (searchResult.status === "FOUND") {
- console.log(`✅ Slugcat located: ${searchResult.slugcat.name}`);
- console.log(`📍 Current Location: ${searchResult.slugcat.location}`);
- console.log(`🍽️ Hunger Level: ${searchResult.slugcat.hungerLevel}`);
- console.log(`⏱️ Time of Detection: ${searchResult.timestamp}`);
- console.log(`ℹ️ ${searchResult.notes}`);
- } else {
- console.warn("⚠️ Slugcat detection failed!");
- console.warn(`⏱️ Time of Attempt: ${searchResult.timestamp}`);
- console.warn(`ℹ️ ${searchResult.notes}`);
- }
Advertisement
Add Comment
Please, Sign In to add comment