Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // JavaScript solution to codeabbey challenge 72
- process.stdin.resume();
- process.stdin.setEncoding('utf8');
- const v1 = "22 1838911";
- const v2 = "3 5 5 4 6 8 8 5 3 5 4 7 6 4 3 5 5 7 7 5 8 6";
- const INP1 = v1.split(' ').map(Number);
- const INP2 = v2.split(' ').map(Number);
- const CON = 'bcdfghjklmnprstvwxz';
- const VOW = 'aeiou';
- const A = 445;
- const C = 700001;
- const M = 2097152;
- var XN = INP1[1];
- var LI = 0;
- var RSP = [];
- for(var wl of INP2){
- WORD = "";
- for (var i = 1; i <= wl; i++) {
- XN = (A*XN + C) % M;
- if (i % 2 === 0) {
- LI = XN % 5;
- WORD += VOW[LI];
- } else {
- LI = XN % 19;
- WORD += CON[LI];
- }
- }
- RSP.push(WORD);
- }
- console.log(RSP.join(" "));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement