|
Post by 128Gigabytes on Apr 30, 2017 21:25:03 GMT
I'm 99% sure that it can't be beaten in Lua
|
|
vha
New Member
Veteran
Posts: 5
|
Post by vha on Apr 30, 2017 21:34:06 GMT
I can beat it in python. Maybe a bit cheaty? Currently at 83 characters:
import requests as r;print(sum(c in"aeiou"for c in r.get("http://v.ht/Njp8").text))
|
|
|
Post by Bit on Apr 30, 2017 21:34:34 GMT
Ahem. Warn. Ahem.
|
|
|
Post by Josh on Apr 30, 2017 21:38:41 GMT
I should really start mentioning that solutions need to work offline Well done anyway vha!
|
|
zmart
New Member
Veteran
Posts: 8
|
Post by zmart on Apr 30, 2017 22:41:47 GMT
To be ran in any web console while on page 1 of this thread. JavaScript, 47 48 characters $('code')[0].innerText.match(/[aeiou]/gi).length Edit: cntkillme pointed out that that it needs to find capitals.
|
|
vha
New Member
Veteran
Posts: 5
|
Post by vha on Apr 30, 2017 23:01:13 GMT
Nice! I don't think I can beat that.
|
|
|
Post by Bit on May 1, 2017 0:39:18 GMT
Neat.
|
|
|
Post by cntkillme on May 4, 2017 6:53:50 GMT
A lot of these are not fully correct. Capitalized vowels should be included and in challenges like these the string itself shouldn't be part of the character count. Instead use `s` or something.
|
|
vha
New Member
Veteran
Posts: 5
|
Post by vha on May 5, 2017 19:03:39 GMT
I don't agree that they aren't correct, as they do the task. I do agree that the string itself shouldn't be included, it wasn't a perfectly asked question.
|
|
|
Post by cntkillme on May 5, 2017 20:11:08 GMT
By agreeing to the second and not to the first, that just makes you completely wrong. Say 's' was "Apple," those solutions would give the wrong vowel count.
|
|
yan
New Member
Posts: 3
|
Post by yan on May 12, 2017 23:17:18 GMT
Lua, 38
print(#('s'):gsub('[^AEIOUaeiou]',''))
|
|
|
Post by Josh on May 13, 2017 7:59:16 GMT
yan Thanks for contributing Your solution must contain the string provided, so you need to replace "s" with the string given.
|
|