Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function bossRush(input) {
- let pattern = /(\|)(?<name>[A-Z]+)\1:#(?<title>[A-Za-z]+ [A-Za-z]+)#/gm
- let inpustCount = input.shift()
- for (let i = 0; i < inpustCount; i++) {
- let match;
- if (input[i].match(pattern)) {
- match = pattern.exec(input)
- console.log(`${match.groups.name}, The ${match.groups.title}`)
- console.log(`>> Strength: ${match.groups.name.length}`)
- console.log(`>> Armor: ${match.groups.title.length}`)
- } else {
- console.log(`Access denied!`)
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment