Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function muOnline(input) {
- let array = input.shift().split("|");
- //console.log(array);
- let newArray = array.slice(" ");
- //console.log(newArray);
- let health = 100;
- let bitcoins = 0;
- let monster = "";
- let amount = 0;
- let command = input.shift();
- while (command === "chest") {
- console.log(`You found ${amount} bitcoins.`);
- break;
- }
- if (command === "potion") {
- console.log(`You healed for ${amount} hp.`);
- console.log(`Current health: ${currentHealth} hp.`);
- }
- if (health <= 0) {
- console.log(`You slayed ${monster}.`);
- } else if (health === 0) {
- console.log(`You died! Killed by ${monster}.`);
- console.log(`Best room: ${room}`);
- } else {
- console.log(`You've made it!", "Bitcoins: ${bitcoins}", "Health: ${health}`);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment