Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function wallBuilder(input) {
- let separator = input.length / 3;
- for (let index in input) {
- if ((Number(index) + 1) / separator <= 1) {
- let pattern = /\b[A-Z]{1,}[0-9]{4,}?([A-Z]{1,}[0-9]{4,})*\b/g;
- if (input[index].match(pattern)) {
- console.log('SOLID BASE!');
- } else {
- console.log('WEAK BASE!');
- }
- } else if ((Number(index) + 1) / separator <= 2) {
- let pattern = /^[a-z]{3}[a-z#@$%]+[#@$%]$/gi;
- if (input[index].match(pattern)) {
- console.log('SOLID MIDDLE!');
- } else {
- console.log('WEAK MIDDLE!');
- }
- } else if ((Number(index) + 1) / separator <= 3) {
- let pattern = /\b0+([a-z]{0,5}[0])+\1+[a-z]{1,5}\b/g;
- if (input[index].match(pattern)) {
- console.log('SOLID TOP!');
- } else {
- console.log('WEAK TOP!');
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment