📜  POKEdiggerprank244 - Javascript (1)

📅  最后修改于: 2023-12-03 15:18:37.040000             🧑  作者: Mango

POKEdiggerprank244 - Javascript

POKEdiggerprank244 is a Javascript program that simulates a prank game where the player has to dig and find hidden Pokemons. The game involves a map with hidden locations where Pokemons are placed randomly. The player has to click on different locations to find the hidden Pokemons.

Getting started

To get started with POKEdiggerprank244, you need to have a basic understanding of Javascript. You can download the code from [GitHub] and run it on your local machine.

// Function to generate random number between 1 to 10
function getRandNum() {
  return Math.floor(Math.random() * 10) + 1;
}

// Assigning random numbers to each location
const loc1 = getRandNum();
const loc2 = getRandNum();
const loc3 = getRandNum();

// Flag variable to check if Pokemons are found
let found = false;

// Function to check if Pokemon is found
function checkLoc(loc) {
  if (loc === loc1 || loc === loc2 || loc === loc3) {
    found = true;
    console.log('Congratulations! You found a Pokemon!');
  } else {
    console.log('Sorry, nothing found here. Try another location.');
  }
}

// Simulating the game with prompt input
const loc = parseInt(prompt(`Enter a location to dig (1-10):`));

// Checking if Pokemon is found at the given location
checkLoc(loc);

// Displaying message if all Pokemons are found
if (found) {
  console.log('All Pokemons are found! Game over.');
}
Features
  • Random generation of Pokemon locations
  • User input through prompt function
  • Real-time output through console log
  • Intuitive and interactive gameplay
Usage

POKEdiggerprank244 can be used to prank friends or family members by suggesting they play a fun and entertaining game. The program can be run on any device with a Javascript-enabled browser.

Conclusion

POKEdiggerprank244 is a fun and entertaining program that can be used to prank people. It involves a simple gameplay mechanism and can be easily modified to suit different needs. Try it out and have fun!