Skip to main content
deleted 35 characters in body
Source Link
SomoKRoceS
  • 1.4k
  • 9
  • 16

Javascript (Babel Node), 145131 bytes

   d=>{s=0;Array.from(d)s=0,[...d].map(c=>{s+=/[AV]/.test(c)?1:(/[NZ]/.test(c)?2:(/[MW]/.test(c)?3:(/[CU]/.test(c)?-1:(c=='S'?-2:(c=='O'?-3:0)))))});return ,s})

Try it online!Try it online!

This is my first code golfing. I hope I'm doing it right.

I'll be glad to get some js golfing tips (before exploring new golfing languages) and overall golfing tips.

Javascript (Babel Node), 145 bytes

   d=>{s=0;Array.from(d).map(c=>{s+=/[AV]/.test(c)?1:(/[NZ]/.test(c)?2:(/[MW]/.test(c)?3:(/[CU]/.test(c)?-1:(c=='S'?-2:(c=='O'?-3:0)))))});return s}

Try it online!

This is my first code golfing. I hope I'm doing it right.

I'll be glad to get some js golfing tips (before exploring new golfing languages) and overall golfing tips.

Javascript (Babel Node), 131 bytes

d=>(s=0,[...d].map(c=>{s+=/[AV]/.test(c)?1:(/[NZ]/.test(c)?2:(/[MW]/.test(c)?3:(/[CU]/.test(c)?-1:(c=='S'?-2:(c=='O'?-3:0)))))}),s)

Try it online!

This is my first code golfing. I hope I'm doing it right.

I'll be glad to get some js golfing tips (before exploring new golfing languages) and overall golfing tips.

deleted 39 characters in body; deleted 6 characters in body
Source Link
SomoKRoceS
  • 1.4k
  • 9
  • 16

Javascript (Babel Node), 179 bytes

Javascript (Babel Node), 145 bytes

process.stdin.on('data',   d=>{s=0;Array.from(d+''d).map(c=>{s+=/[AV]/.test(c)?1:(/[NZ]/.test(c)?2:(/[MW]/.test(c)?3:(/[CU]/.test(c)?-1:(c=='S'?-2:(c=='O'?-3:0)))))});console.log(;return s)})

Try it online!Try it online!

This is my first code golfing. I hope I'm doing it right.

I'll be glad to get some js golfing tips (before exploring new golfing languages) and overall golfing tips.

Javascript (Babel Node), 179 bytes

process.stdin.on('data',d=>{s=0;Array.from(d+'').map(c=>{s+=/[AV]/.test(c)?1:(/[NZ]/.test(c)?2:(/[MW]/.test(c)?3:(/[CU]/.test(c)?-1:(c=='S'?-2:(c=='O'?-3:0)))))});console.log(s)})

Try it online!

This is my first code golfing. I hope I'm doing it right.

I'll be glad to get some js golfing tips (before exploring new golfing languages) and overall golfing tips.

Javascript (Babel Node), 145 bytes

   d=>{s=0;Array.from(d).map(c=>{s+=/[AV]/.test(c)?1:(/[NZ]/.test(c)?2:(/[MW]/.test(c)?3:(/[CU]/.test(c)?-1:(c=='S'?-2:(c=='O'?-3:0)))))});return s}

Try it online!

This is my first code golfing. I hope I'm doing it right.

I'll be glad to get some js golfing tips (before exploring new golfing languages) and overall golfing tips.

deleted 13 characters in body
Source Link
SomoKRoceS
  • 1.4k
  • 9
  • 16

Javascript (Babel Node), 186179 bytes

process.stdin.on('data',(d)=>d=>{s=0;Array.from(d+'').forEachmap(c=>{s+=/[AV]/.test(c)?1:(/[NZ]/.test(c)?2:(/[MW]/.test(c)?3:(/[CU]/.test(c)?-1:(c=='S'?-2:(c=='O'?-3:0)))))});console.log(s)});

Try it online!Try it online!

This is my first code golfing. I hope I'm doing it right.

I'll be glad to get some js golfing tips (before exploring new golfing languages) and overall golfing tips.

Javascript (Babel Node), 186 bytes

process.stdin.on('data',(d)=>{s=0;Array.from(d+'').forEach(c=>{s+=/[AV]/.test(c)?1:(/[NZ]/.test(c)?2:(/[MW]/.test(c)?3:(/[CU]/.test(c)?-1:(c=='S'?-2:(c=='O'?-3:0)))))});console.log(s)});

Try it online!

This is my first code golfing. I hope I'm doing it right.

I'll be glad to get some js golfing tips (before exploring new golfing languages) and overall golfing tips.

Javascript (Babel Node), 179 bytes

process.stdin.on('data',d=>{s=0;Array.from(d+'').map(c=>{s+=/[AV]/.test(c)?1:(/[NZ]/.test(c)?2:(/[MW]/.test(c)?3:(/[CU]/.test(c)?-1:(c=='S'?-2:(c=='O'?-3:0)))))});console.log(s)})

Try it online!

This is my first code golfing. I hope I'm doing it right.

I'll be glad to get some js golfing tips (before exploring new golfing languages) and overall golfing tips.

Source Link
SomoKRoceS
  • 1.4k
  • 9
  • 16
Loading