Skip to main content
added 223 characters in body
Source Link
SuperJedi224
  • 12k
  • 1
  • 45
  • 68

Javascript, 191 bytes

t=prompt(q=[]);s=((t[m="match"](/[!?.]+/g)||q)[l="length"]||1);y=(t[m](/[aeiouy]+/g)||q)[l]-(t[m](/[^aeiou][aeiou][s\s,'.?!]/g)||q)[l]*.33;w=(t.split(/\s+/g))[l];alert(206204-1.015*w/s-84.6*y5*y/w)

First test case gives 112.9 (correct answer is 111.4, off by 1.5 points)

Second test case gives 67.4 (correct answer is 65.1, off by 2.3 points)

Third test case gives 1.7 (correct answer is 3.7, off by 2.0 points)

Javascript, 191 bytes

t=prompt(q=[]);s=((t[m="match"](/[!?.]+/g)||q)[l="length"]||1);y=(t[m](/[aeiouy]+/g)||q)[l]-(t[m](/[^aeiou][aeiou][s\s,'.?!]/g)||q)[l]*.33;w=(t.split(/\s+/g))[l];alert(206-1.015*w/s-84.6*y/w)

Javascript, 191 bytes

t=prompt(q=[]);s=((t[m="match"](/[!?.]+/g)||q)[l="length"]||1);y=(t[m](/[aeiouy]+/g)||q)[l]-(t[m](/[^aeiou][aeiou][s\s,'.?!]/g)||q)[l]*.33;w=(t.split(/\s+/g))[l];alert(204-1.015*w/s-84.5*y/w)

First test case gives 112.9 (correct answer is 111.4, off by 1.5 points)

Second test case gives 67.4 (correct answer is 65.1, off by 2.3 points)

Third test case gives 1.7 (correct answer is 3.7, off by 2.0 points)

deleted 148 characters in body
Source Link
SuperJedi224
  • 12k
  • 1
  • 45
  • 68

Javascript, 199191 bytes

t=prompt(q=[]);s=((t[m="match"](/[!?.]+/g)||q)[l="length"]||1);y=(t[m](/[aeiouy]+/g)||q)[l]-(t[m](/[^aeiou][aeiou][s\s,'.?!]/g)||q)[l]*.33;w=(t.split(/\s+/g))[l];alert(206.835-1.015*(w015*w/s)-84.6*(y6*y/w))

Results:

The "Green Eggs and Ham" excerpt: 115.7

The "1984" excerpt: 70.1

The excerpt from the Declaration of Independance: 4.8

Javascript, 199 bytes

t=prompt(q=[]);s=((t[m="match"](/[!?.]+/g)||q)[l="length"]||1);y=(t[m](/[aeiouy]+/g)||q)[l]-(t[m](/[^aeiou][aeiou][s\s,'.?!]/g)||q)[l]*.33;w=(t.split(/\s+/g))[l];alert(206.835-1.015*(w/s)-84.6*(y/w))

Results:

The "Green Eggs and Ham" excerpt: 115.7

The "1984" excerpt: 70.1

The excerpt from the Declaration of Independance: 4.8

Javascript, 191 bytes

t=prompt(q=[]);s=((t[m="match"](/[!?.]+/g)||q)[l="length"]||1);y=(t[m](/[aeiouy]+/g)||q)[l]-(t[m](/[^aeiou][aeiou][s\s,'.?!]/g)||q)[l]*.33;w=(t.split(/\s+/g))[l];alert(206-1.015*w/s-84.6*y/w)
Source Link
SuperJedi224
  • 12k
  • 1
  • 45
  • 68

Javascript, 199 bytes

t=prompt(q=[]);s=((t[m="match"](/[!?.]+/g)||q)[l="length"]||1);y=(t[m](/[aeiouy]+/g)||q)[l]-(t[m](/[^aeiou][aeiou][s\s,'.?!]/g)||q)[l]*.33;w=(t.split(/\s+/g))[l];alert(206.835-1.015*(w/s)-84.6*(y/w))

Results:

The "Green Eggs and Ham" excerpt: 115.7

The "1984" excerpt: 70.1

The excerpt from the Declaration of Independance: 4.8