Repeat a rhyme and loop on the vowels

Clash Royale CLAN TAG#URR8PPP
up vote
15
down vote
favorite
Vowels rhyme: Apples and Bananas
There is a traditional children's song that repeats the same text over and over, only each time every vowel is replaced with a random vowel, but constant across the current stanza.
Challenge
The objective is to propose the shortest code that performs such a transformation on an input text.
Rules
- You must print the rhyme as many times as there are distinct vowels in it.
- Each print must be separated with a line break (platform-specific combo of
nandris accepted). - For iteration
i, replace each vowel with theith distinct vowel in the original text. - The input text is a sequence of printable ASCII characters (range
[32, 126]. - Input will not contain embedded line breaks.
- Only vowels characters must be affected, other must be output exactly as input.
- Only vowels characters count: nasal vowels, although sounding like vowels (like in French "Tintin"), must not be handled as a single vowel.
- Case matters for the output, but is positional (replacing an uppercase vowel is done with the uppercase replacement vowel)
- Uppercase vowels are not distinct from their lowercase counterpart (ie
a<=>A) - Consecutive vowels are always considered separately (ie.
Boatyields bothBootandBaat) - Since the letter
yrepresents either a vowel or consonant soun (as we're speaking English), handling it as a vowel or a consonant is allowed, however answers must explicitly state whether they handleyas a vowel or not.
Examples:
Hello world
Hello world!
gives:
Helle werld!
Hollo world!
Excerpt from the original French text (translated), with y handled as a vowel:
An elephant that was rambling all gently in the woods...
gives:
An alaphant that was ramblang all gantla an tha waads...
En elephent thet wes rembleng ell gentle en the weeds...
In iliphint thit wis rimbling ill gintli in thi wiids...
Yn ylyphynt thyt wys rymblyng yll gyntly yn thy wyyds...
On olophont thot wos romblong oll gontlo on tho woods...
Note the behaviour on leading uppercase vowel: case is kept at its index (rules 8 and 9).
Vowelless example
Input that does not contain any vowel, like:
lgn@hst:~$ rm -rf ./* ~ /
must produce no output, or a single line break.
Single-vowel input
Input containing a single vowel is output as is.
Dad sat at a car and saw a fat bat.
gives:
Dad sat at a car and saw a fat bat.
This is code-golf, so fewest bytecount code wins (nothing but eternal PPCG glory)!
code-golf string
add a comment |Â
up vote
15
down vote
favorite
Vowels rhyme: Apples and Bananas
There is a traditional children's song that repeats the same text over and over, only each time every vowel is replaced with a random vowel, but constant across the current stanza.
Challenge
The objective is to propose the shortest code that performs such a transformation on an input text.
Rules
- You must print the rhyme as many times as there are distinct vowels in it.
- Each print must be separated with a line break (platform-specific combo of
nandris accepted). - For iteration
i, replace each vowel with theith distinct vowel in the original text. - The input text is a sequence of printable ASCII characters (range
[32, 126]. - Input will not contain embedded line breaks.
- Only vowels characters must be affected, other must be output exactly as input.
- Only vowels characters count: nasal vowels, although sounding like vowels (like in French "Tintin"), must not be handled as a single vowel.
- Case matters for the output, but is positional (replacing an uppercase vowel is done with the uppercase replacement vowel)
- Uppercase vowels are not distinct from their lowercase counterpart (ie
a<=>A) - Consecutive vowels are always considered separately (ie.
Boatyields bothBootandBaat) - Since the letter
yrepresents either a vowel or consonant soun (as we're speaking English), handling it as a vowel or a consonant is allowed, however answers must explicitly state whether they handleyas a vowel or not.
Examples:
Hello world
Hello world!
gives:
Helle werld!
Hollo world!
Excerpt from the original French text (translated), with y handled as a vowel:
An elephant that was rambling all gently in the woods...
gives:
An alaphant that was ramblang all gantla an tha waads...
En elephent thet wes rembleng ell gentle en the weeds...
In iliphint thit wis rimbling ill gintli in thi wiids...
Yn ylyphynt thyt wys rymblyng yll gyntly yn thy wyyds...
On olophont thot wos romblong oll gontlo on tho woods...
Note the behaviour on leading uppercase vowel: case is kept at its index (rules 8 and 9).
Vowelless example
Input that does not contain any vowel, like:
lgn@hst:~$ rm -rf ./* ~ /
must produce no output, or a single line break.
Single-vowel input
Input containing a single vowel is output as is.
Dad sat at a car and saw a fat bat.
gives:
Dad sat at a car and saw a fat bat.
This is code-golf, so fewest bytecount code wins (nothing but eternal PPCG glory)!
code-golf string
add a comment |Â
up vote
15
down vote
favorite
up vote
15
down vote
favorite
Vowels rhyme: Apples and Bananas
There is a traditional children's song that repeats the same text over and over, only each time every vowel is replaced with a random vowel, but constant across the current stanza.
Challenge
The objective is to propose the shortest code that performs such a transformation on an input text.
Rules
- You must print the rhyme as many times as there are distinct vowels in it.
- Each print must be separated with a line break (platform-specific combo of
nandris accepted). - For iteration
i, replace each vowel with theith distinct vowel in the original text. - The input text is a sequence of printable ASCII characters (range
[32, 126]. - Input will not contain embedded line breaks.
- Only vowels characters must be affected, other must be output exactly as input.
- Only vowels characters count: nasal vowels, although sounding like vowels (like in French "Tintin"), must not be handled as a single vowel.
- Case matters for the output, but is positional (replacing an uppercase vowel is done with the uppercase replacement vowel)
- Uppercase vowels are not distinct from their lowercase counterpart (ie
a<=>A) - Consecutive vowels are always considered separately (ie.
Boatyields bothBootandBaat) - Since the letter
yrepresents either a vowel or consonant soun (as we're speaking English), handling it as a vowel or a consonant is allowed, however answers must explicitly state whether they handleyas a vowel or not.
Examples:
Hello world
Hello world!
gives:
Helle werld!
Hollo world!
Excerpt from the original French text (translated), with y handled as a vowel:
An elephant that was rambling all gently in the woods...
gives:
An alaphant that was ramblang all gantla an tha waads...
En elephent thet wes rembleng ell gentle en the weeds...
In iliphint thit wis rimbling ill gintli in thi wiids...
Yn ylyphynt thyt wys rymblyng yll gyntly yn thy wyyds...
On olophont thot wos romblong oll gontlo on tho woods...
Note the behaviour on leading uppercase vowel: case is kept at its index (rules 8 and 9).
Vowelless example
Input that does not contain any vowel, like:
lgn@hst:~$ rm -rf ./* ~ /
must produce no output, or a single line break.
Single-vowel input
Input containing a single vowel is output as is.
Dad sat at a car and saw a fat bat.
gives:
Dad sat at a car and saw a fat bat.
This is code-golf, so fewest bytecount code wins (nothing but eternal PPCG glory)!
code-golf string
Vowels rhyme: Apples and Bananas
There is a traditional children's song that repeats the same text over and over, only each time every vowel is replaced with a random vowel, but constant across the current stanza.
Challenge
The objective is to propose the shortest code that performs such a transformation on an input text.
Rules
- You must print the rhyme as many times as there are distinct vowels in it.
- Each print must be separated with a line break (platform-specific combo of
nandris accepted). - For iteration
i, replace each vowel with theith distinct vowel in the original text. - The input text is a sequence of printable ASCII characters (range
[32, 126]. - Input will not contain embedded line breaks.
- Only vowels characters must be affected, other must be output exactly as input.
- Only vowels characters count: nasal vowels, although sounding like vowels (like in French "Tintin"), must not be handled as a single vowel.
- Case matters for the output, but is positional (replacing an uppercase vowel is done with the uppercase replacement vowel)
- Uppercase vowels are not distinct from their lowercase counterpart (ie
a<=>A) - Consecutive vowels are always considered separately (ie.
Boatyields bothBootandBaat) - Since the letter
yrepresents either a vowel or consonant soun (as we're speaking English), handling it as a vowel or a consonant is allowed, however answers must explicitly state whether they handleyas a vowel or not.
Examples:
Hello world
Hello world!
gives:
Helle werld!
Hollo world!
Excerpt from the original French text (translated), with y handled as a vowel:
An elephant that was rambling all gently in the woods...
gives:
An alaphant that was ramblang all gantla an tha waads...
En elephent thet wes rembleng ell gentle en the weeds...
In iliphint thit wis rimbling ill gintli in thi wiids...
Yn ylyphynt thyt wys rymblyng yll gyntly yn thy wyyds...
On olophont thot wos romblong oll gontlo on tho woods...
Note the behaviour on leading uppercase vowel: case is kept at its index (rules 8 and 9).
Vowelless example
Input that does not contain any vowel, like:
lgn@hst:~$ rm -rf ./* ~ /
must produce no output, or a single line break.
Single-vowel input
Input containing a single vowel is output as is.
Dad sat at a car and saw a fat bat.
gives:
Dad sat at a car and saw a fat bat.
This is code-golf, so fewest bytecount code wins (nothing but eternal PPCG glory)!
code-golf string
code-golf string
edited Sep 2 at 18:09
asked Sep 2 at 17:19
joH1
296210
296210
add a comment |Â
add a comment |Â
14 Answers
14
active
oldest
votes
up vote
6
down vote
Retina, 45 bytes
~(K`AEIOU
L$`\?(.)
./$1/i&$*T`Vv`5*$&$L$&
Try it online! Does not count y as a vowel. Explanation:
K`AEIOU
Replaces the text with the literal string AEIOU.
L$`\?(.)
Matches each letter optionally preceded by a backslash.
./$1/i&$*T`Vv`5*$&$L$&
Outputs a line of Retina code for each letter.
~(
Evaluates the generated code (shown below) using the original input. The . causes the code not to output the (final) buffer. The /<vowel>/i& causes the rest of the line to run only if the input contains the given vowel (case-insensitively). The * causes the result of the line to be ignored, so that the next vowel can be tested. The causes the result to be printed on its own line before it is ignored. The T`Vv`AAAAAa transliterates uppercase Vowels to AAAAAs and all lowercase vowels to a. A is an escape that refers to ASCII 07 (BEL), but E, O and o are built-in character classes that needs to be escaped to give their literal values (e is not a character class, but fortunately it is also not an escape.)
./A/i&*T`Vv`AAAAAa
./E/i&*T`Vv`EEEEEe
./I/i&*T`Vv`IIIIIi
./O/i&*T`Vv`OOOOOo
./U/i&*T`Vv`UUUUUu
Mmh, self-generating code. I don't know Retina well but that's impressive!
â joH1
Sep 2 at 18:57
@joH1 Well, for me the impressive bit is that it saved 60 bytes!
â Neil
Sep 2 at 19:19
add a comment |Â
up vote
5
down vote
Ruby, 78 bytes
->ss.downcase.scan(/[aeiou]/).uniq.map*?n
Try it online!
A quick and naive approach. Y is not considered a vowel.
add a comment |Â
up vote
4
down vote
bash, 96 bytes
Two equal-length solutions:
v=aeiouAEIOU;for x in `grep -o [$v]<<<$1|sed 's/./L&&&&&U&/'|awk !a[\$0]++`; tr $v $x<<<$1;
v=aeiouAEIOU;for x in `tr -cd $v<<<$1|sed 's/./L&&&&&U&n/g'|awk !a[\$0]++`; tr $v $x<<<$1;
Try it online!
Takes input as a command line argument and outputs to STDOUT.
add a comment |Â
up vote
4
down vote
05AB1E (legacy), 19 bytes
(Indirectly) saved one byte thanks to Kevin (printing directly inside the loop rather than joining, only work in the legacy version).
lÃ
¾MÃÂÃÂõÃ
¾MDuës5ÃÂDuëâ¡=
Try it online!
Using the Elixir rewrite, 20 bytes
lÃ
¾MÃÂÃÂõÃ
¾MDuës5ÃÂDuëâ¡}û
Try it online! (without y) | Try it online! (with y, Ã
¾M being replaced by Ã
¾O â same applies for the legacy version)
How it works
lÃ
¾MÃÂÃÂõÃ
¾MDuës5ÃÂDuëâ¡}û Full program. Example: "Hello"
l Convert the input to lowercase. "Hello" âÂÂ> "hello"
Ã
¾MàKeep only lowercase vowels. "hello" âÂÂ> "eo"
àRemove duplicates. "eo" âÂÂ> "eo"
õ } For each of the characters (example with "e"):
Ã
¾MDuë Yield "aeiouAEIOU"
s5àSwap, and repeat the current char 5 times. "e" âÂÂ> "eeeee"
Duë Duplicate, uppercase and merge. "eeeee" âÂÂ> "eeeeeEEEE"
â¡ Transliteration. For each item in B, replace it in A with
the corresponding item in C.
û Join on newlines.
Nice answer, shorter than the 21 byte answer I prepared. You can golf one more byte by looping and printing instead of mapping: 19 bytes. Your TIO withyshould also use6instead of5, btw.
â Kevin Cruijssen
Sep 3 at 9:17
@KevinCruijssen Edited, thanks! About they-vowel version, I accidentally copied the wrong TIO link when I answered :|...
â Mr. Xcoder
Sep 3 at 9:22
Ah, now I know again why I had theiin my code.. Your answer fails for inputs without vowels. Expected is an empty output, but it actually prints the input itself.. :(
â Kevin Cruijssen
Sep 3 at 9:31
1
@KevinCruijssen The 20-byter works, so I rolled back and fixed the second link.
â Mr. Xcoder
Sep 3 at 9:34
add a comment |Â
up vote
4
down vote
Japt v2.0a0 -R, 24 22 bytes
Treats y as a vowel. Change both occurences of y to v to treat it as a consonant.
v fy â ãry_Xc^H*ZøZu
Try it
Explanation
v :Lowercase
y :RegEx /[aeiouy]/gi (v is /[aeiou]/gi)
f :Get all matches as an array
â :Deduplicate
ã :Map each X
ry : Replace all matches of the RegEx above in the input
_ : Pass matches through a function as Z
Xc^ : XOR the character code of X with
H* : 32 multiplied by
Zø : Does Z contain
Zu : Uppercase Z
:Implicitly join with newlines and output
add a comment |Â
up vote
3
down vote
Jelly, Â 23 20 18Â 17 bytes
-2 Thanks to Erik the Outgolfer
ÃÂcÃ
ÂHZx5fÃÂðÃÂc,yðâ¬Y
To treat y as a vowel replace both cs with ys.
Try it online!
How?
ÃÂcÃ
ÂHZx5fÃÂðÃÂc,yðâ¬Y - Link: list of characters, S
ÃÂc - vowels -> "AEIOUaeiou"
Ã
ÂH - split in half -> ["AEIOU", "aeiou"]
Z - transpose -> ["Aa", "Ee", "Ii", "Oo", "Uu"]
x5 - times 5 -> ["AAAAAaaaaa", "EEEEEeeeee", "IIIIIiiiii", "OOOOOooooo", "UUUUUuuuuu"]
ÃÂ - filter keep if:
f - filter keep only -> those of X which have required vowels
- ...i.e. if S = "blah" then ["AAAAAaaaaa"]
ð ð⬠- dyadic chain for â¬ach:
ÃÂc - vowels -> "AEIOUaeiou"
, - pair e.g. ["AEIOUaeiou","AAAAAaaaaa"]
y - translate e.g. swap A for A, E for A, ...
Y - join with newlines
18 bytes (trivial) (à ¼/on a pair isZ, two dyads in a row where the left one is unpaired in a monad have the argument in-between implicitly)
â Erik the Outgolfer
Sep 2 at 19:40
Thanks (Z>_<), not sure what was going on with my TIO session, but removing the redundantðwasn't working; restart fixed.
â Jonathan Allan
Sep 2 at 19:54
TBH, I actually fixedxâ‰ÂÂxtoo, but you ninja'd me. :P
â Erik the Outgolfer
Sep 2 at 19:55
add a comment |Â
up vote
3
down vote
Red, 229 bytes
Taking y for a non-vowel
func[s][v: charset"aoeiu"w: charset"AOEIU"p: copy""parse s[any[[copy c[v | w](if not find p c[append p c lowercase c
parse s[any[[copy n to[v | w | end]](prin n)opt[v(prin c)|[w(prin uppercase copy c)]| skip]]]print""])]| skip]]]
Try it online!
Slightly more readable:
f: func [ s ] [
v: charset "aoeiu"
w: charset "AOEIU"
p: copy ""
parse s[
any [
[ copy c [ v | w ]
( if not find p c [
append p c
lowercase c
parse s [
any [
[ copy n to [ v | w | end ] ]
( prin n )
opt [ v ( prin c )
| [ w ( prin uppercase copy c ) ]
| skip
]
]
]
print ""
] )
]
| skip
]
]
]
add a comment |Â
up vote
3
down vote
R, 138, 129 bytes
function(x,U=utf8ToInt,a=U(V<-'aeiouAEIOU'))for(i in (which(a%in%U(x))-1)%%5)cat(chartr(V,intToUtf8(rep(a[i+c(1,6)],e=5)),x),'
')
Try it online!
yis not considered a vowel
add a comment |Â
up vote
2
down vote
Python, 129 119 112 bytes
import re
f=lambda s:'n'.join(r('[AEIOU]',v.upper(),r('[aeiou]',v,s))for v in'aeiou'if v in s.lower());r=re.sub
Try it Online!
Doesn't treat $y$ as vowel.
-7 bytes thanks to @Mr.Xcoder
Glad to see you could get it working and golfed down a bit! Nice work
â joH1
Sep 2 at 20:34
@joH1 Thanks :)
â DimChtz
Sep 2 at 20:37
112 bytes.
â Mr. Xcoder
Sep 2 at 21:53
add a comment |Â
up vote
2
down vote
JavaScript (Node.js), 99 bytes
Treats $y$ as a consonant.
s=>(g=F=>Buffer(s).map(c=>2130466>>c&c>64?F(c):c)+`
`)(v=>g[v&=31]||(g[v]=S+=g(c=>c&96|v)),S='')&&S
Try it online!
Commented
s => ( // s = input string
g = F => // g = helper function taking a callback function F
Buffer(s) // turn s into a Buffer
.map(c => // for each ASCII code c in s:
2130466 // 2130466 is a vowel bitmask: 1000001000001000100010
// u o i e a
>> c // the ECMAScript specification enforces that the shiftCount is
// the result of masking out all but the least significant 5 bits
& c > 64 // also make sure to ignore non-letter characters
? // if a vowel is identified:
F(c) // invoke F with c
: // else:
c // just yield c
) + `n` // end of map(); coerce back to a string and append a newline
)(v => // invoke g with a callback that takes v:
g[v &= 31] || ( // unless this vowel has already been encountered:
g[v] = // mark it as encountered
S += // and append to the output string S
g( // the result of another call to g:
c => c & 96 | v // where vowels are replaced with v, using the original case
) // end of inner call to g
), //
S = '' // start with S = ''
) && S // end of outer call to g; return S
add a comment |Â
up vote
2
down vote
Java 10, 196 188 bytes
s->var d=new int[99];for(var c:s.toUpperCase().replaceAll("[^AEIOU]","").toCharArray())if(d[c]++<1)System.out.println(s.replaceAll("[AEIOU]",c+"").replaceAll("[aeiou]",(char)(c+32)+""));
-8 bytes thanks to @joH1.
Without y as vowel to save bytes.
Try it online.
Explanation:
s-> // Method with String parameter and no return-type
var d=new int[99]; // Integer-array indicating which vowels we've already output
for(var c:s.toUpperCase()// Convert the input to uppercase
.replaceAll("[^AEIOU]","")
// Remove all non-vowels
.toCharArray())// Convert it to a character array)
// And loop over those vowel-characters
if(d[c]++ // Increase the vowel-count by 1
<1) // And if it was 0 this iteration:
System.out.println( // Print with trailing newline:
s // The input,
.replaceAll("[AEIOU]",c+"")
// with every uppercase vowel replace with the current vowel
.replaceAll("[aeiou]",(char)(c+32)+""));
// and every lowercase vowel replaced as well
188 bytes by inlining the variablevin the loop
â joH1
Sep 4 at 9:03
@joH1 Thanks, not sure how I missed that..
â Kevin Cruijssen
Sep 4 at 9:07
add a comment |Â
up vote
1
down vote
Python 2, 112 bytes
s=input()
V='aeiouAEIOU'
for v in V:
if v in s.lower():print''.join([c,[v.upper(),v][c>'Z']][c in V]for c in s)
Try it online!
Treats y as a consonant.
add a comment |Â
up vote
1
down vote
Perl 6, 64 bytes
m:g:i/<[aeiou]>/û.lc.uniqueû.&$^v;say S:g:ii[<[aeiou]>]=$v
Try it online!
add a comment |Â
up vote
1
down vote
Java (OpenJDK 8), 184 bytes
y is a vowel
s->s.chars().mapToObj(c->""+(char)(c>96?c:c+32)).filter("aeiouy"::contains).distinct().forEach(c->System.out.println(s.replaceAll("[aeiouy]",c).replaceAll("[AEIOUY]",c.toUpperCase())))
Try it online!
add a comment |Â
14 Answers
14
active
oldest
votes
14 Answers
14
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
Retina, 45 bytes
~(K`AEIOU
L$`\?(.)
./$1/i&$*T`Vv`5*$&$L$&
Try it online! Does not count y as a vowel. Explanation:
K`AEIOU
Replaces the text with the literal string AEIOU.
L$`\?(.)
Matches each letter optionally preceded by a backslash.
./$1/i&$*T`Vv`5*$&$L$&
Outputs a line of Retina code for each letter.
~(
Evaluates the generated code (shown below) using the original input. The . causes the code not to output the (final) buffer. The /<vowel>/i& causes the rest of the line to run only if the input contains the given vowel (case-insensitively). The * causes the result of the line to be ignored, so that the next vowel can be tested. The causes the result to be printed on its own line before it is ignored. The T`Vv`AAAAAa transliterates uppercase Vowels to AAAAAs and all lowercase vowels to a. A is an escape that refers to ASCII 07 (BEL), but E, O and o are built-in character classes that needs to be escaped to give their literal values (e is not a character class, but fortunately it is also not an escape.)
./A/i&*T`Vv`AAAAAa
./E/i&*T`Vv`EEEEEe
./I/i&*T`Vv`IIIIIi
./O/i&*T`Vv`OOOOOo
./U/i&*T`Vv`UUUUUu
Mmh, self-generating code. I don't know Retina well but that's impressive!
â joH1
Sep 2 at 18:57
@joH1 Well, for me the impressive bit is that it saved 60 bytes!
â Neil
Sep 2 at 19:19
add a comment |Â
up vote
6
down vote
Retina, 45 bytes
~(K`AEIOU
L$`\?(.)
./$1/i&$*T`Vv`5*$&$L$&
Try it online! Does not count y as a vowel. Explanation:
K`AEIOU
Replaces the text with the literal string AEIOU.
L$`\?(.)
Matches each letter optionally preceded by a backslash.
./$1/i&$*T`Vv`5*$&$L$&
Outputs a line of Retina code for each letter.
~(
Evaluates the generated code (shown below) using the original input. The . causes the code not to output the (final) buffer. The /<vowel>/i& causes the rest of the line to run only if the input contains the given vowel (case-insensitively). The * causes the result of the line to be ignored, so that the next vowel can be tested. The causes the result to be printed on its own line before it is ignored. The T`Vv`AAAAAa transliterates uppercase Vowels to AAAAAs and all lowercase vowels to a. A is an escape that refers to ASCII 07 (BEL), but E, O and o are built-in character classes that needs to be escaped to give their literal values (e is not a character class, but fortunately it is also not an escape.)
./A/i&*T`Vv`AAAAAa
./E/i&*T`Vv`EEEEEe
./I/i&*T`Vv`IIIIIi
./O/i&*T`Vv`OOOOOo
./U/i&*T`Vv`UUUUUu
Mmh, self-generating code. I don't know Retina well but that's impressive!
â joH1
Sep 2 at 18:57
@joH1 Well, for me the impressive bit is that it saved 60 bytes!
â Neil
Sep 2 at 19:19
add a comment |Â
up vote
6
down vote
up vote
6
down vote
Retina, 45 bytes
~(K`AEIOU
L$`\?(.)
./$1/i&$*T`Vv`5*$&$L$&
Try it online! Does not count y as a vowel. Explanation:
K`AEIOU
Replaces the text with the literal string AEIOU.
L$`\?(.)
Matches each letter optionally preceded by a backslash.
./$1/i&$*T`Vv`5*$&$L$&
Outputs a line of Retina code for each letter.
~(
Evaluates the generated code (shown below) using the original input. The . causes the code not to output the (final) buffer. The /<vowel>/i& causes the rest of the line to run only if the input contains the given vowel (case-insensitively). The * causes the result of the line to be ignored, so that the next vowel can be tested. The causes the result to be printed on its own line before it is ignored. The T`Vv`AAAAAa transliterates uppercase Vowels to AAAAAs and all lowercase vowels to a. A is an escape that refers to ASCII 07 (BEL), but E, O and o are built-in character classes that needs to be escaped to give their literal values (e is not a character class, but fortunately it is also not an escape.)
./A/i&*T`Vv`AAAAAa
./E/i&*T`Vv`EEEEEe
./I/i&*T`Vv`IIIIIi
./O/i&*T`Vv`OOOOOo
./U/i&*T`Vv`UUUUUu
Retina, 45 bytes
~(K`AEIOU
L$`\?(.)
./$1/i&$*T`Vv`5*$&$L$&
Try it online! Does not count y as a vowel. Explanation:
K`AEIOU
Replaces the text with the literal string AEIOU.
L$`\?(.)
Matches each letter optionally preceded by a backslash.
./$1/i&$*T`Vv`5*$&$L$&
Outputs a line of Retina code for each letter.
~(
Evaluates the generated code (shown below) using the original input. The . causes the code not to output the (final) buffer. The /<vowel>/i& causes the rest of the line to run only if the input contains the given vowel (case-insensitively). The * causes the result of the line to be ignored, so that the next vowel can be tested. The causes the result to be printed on its own line before it is ignored. The T`Vv`AAAAAa transliterates uppercase Vowels to AAAAAs and all lowercase vowels to a. A is an escape that refers to ASCII 07 (BEL), but E, O and o are built-in character classes that needs to be escaped to give their literal values (e is not a character class, but fortunately it is also not an escape.)
./A/i&*T`Vv`AAAAAa
./E/i&*T`Vv`EEEEEe
./I/i&*T`Vv`IIIIIi
./O/i&*T`Vv`OOOOOo
./U/i&*T`Vv`UUUUUu
answered Sep 2 at 18:43
Neil
75.7k744171
75.7k744171
Mmh, self-generating code. I don't know Retina well but that's impressive!
â joH1
Sep 2 at 18:57
@joH1 Well, for me the impressive bit is that it saved 60 bytes!
â Neil
Sep 2 at 19:19
add a comment |Â
Mmh, self-generating code. I don't know Retina well but that's impressive!
â joH1
Sep 2 at 18:57
@joH1 Well, for me the impressive bit is that it saved 60 bytes!
â Neil
Sep 2 at 19:19
Mmh, self-generating code. I don't know Retina well but that's impressive!
â joH1
Sep 2 at 18:57
Mmh, self-generating code. I don't know Retina well but that's impressive!
â joH1
Sep 2 at 18:57
@joH1 Well, for me the impressive bit is that it saved 60 bytes!
â Neil
Sep 2 at 19:19
@joH1 Well, for me the impressive bit is that it saved 60 bytes!
â Neil
Sep 2 at 19:19
add a comment |Â
up vote
5
down vote
Ruby, 78 bytes
->ss.downcase.scan(/[aeiou]/).uniq.map*?n
Try it online!
A quick and naive approach. Y is not considered a vowel.
add a comment |Â
up vote
5
down vote
Ruby, 78 bytes
->ss.downcase.scan(/[aeiou]/).uniq.map*?n
Try it online!
A quick and naive approach. Y is not considered a vowel.
add a comment |Â
up vote
5
down vote
up vote
5
down vote
Ruby, 78 bytes
->ss.downcase.scan(/[aeiou]/).uniq.map*?n
Try it online!
A quick and naive approach. Y is not considered a vowel.
Ruby, 78 bytes
->ss.downcase.scan(/[aeiou]/).uniq.map*?n
Try it online!
A quick and naive approach. Y is not considered a vowel.
answered Sep 2 at 18:22
Kirill L.
2,6661117
2,6661117
add a comment |Â
add a comment |Â
up vote
4
down vote
bash, 96 bytes
Two equal-length solutions:
v=aeiouAEIOU;for x in `grep -o [$v]<<<$1|sed 's/./L&&&&&U&/'|awk !a[\$0]++`; tr $v $x<<<$1;
v=aeiouAEIOU;for x in `tr -cd $v<<<$1|sed 's/./L&&&&&U&n/g'|awk !a[\$0]++`; tr $v $x<<<$1;
Try it online!
Takes input as a command line argument and outputs to STDOUT.
add a comment |Â
up vote
4
down vote
bash, 96 bytes
Two equal-length solutions:
v=aeiouAEIOU;for x in `grep -o [$v]<<<$1|sed 's/./L&&&&&U&/'|awk !a[\$0]++`; tr $v $x<<<$1;
v=aeiouAEIOU;for x in `tr -cd $v<<<$1|sed 's/./L&&&&&U&n/g'|awk !a[\$0]++`; tr $v $x<<<$1;
Try it online!
Takes input as a command line argument and outputs to STDOUT.
add a comment |Â
up vote
4
down vote
up vote
4
down vote
bash, 96 bytes
Two equal-length solutions:
v=aeiouAEIOU;for x in `grep -o [$v]<<<$1|sed 's/./L&&&&&U&/'|awk !a[\$0]++`; tr $v $x<<<$1;
v=aeiouAEIOU;for x in `tr -cd $v<<<$1|sed 's/./L&&&&&U&n/g'|awk !a[\$0]++`; tr $v $x<<<$1;
Try it online!
Takes input as a command line argument and outputs to STDOUT.
bash, 96 bytes
Two equal-length solutions:
v=aeiouAEIOU;for x in `grep -o [$v]<<<$1|sed 's/./L&&&&&U&/'|awk !a[\$0]++`; tr $v $x<<<$1;
v=aeiouAEIOU;for x in `tr -cd $v<<<$1|sed 's/./L&&&&&U&n/g'|awk !a[\$0]++`; tr $v $x<<<$1;
Try it online!
Takes input as a command line argument and outputs to STDOUT.
answered Sep 2 at 21:17
Doorknobâ¦
53.7k16112340
53.7k16112340
add a comment |Â
add a comment |Â
up vote
4
down vote
05AB1E (legacy), 19 bytes
(Indirectly) saved one byte thanks to Kevin (printing directly inside the loop rather than joining, only work in the legacy version).
lÃ
¾MÃÂÃÂõÃ
¾MDuës5ÃÂDuëâ¡=
Try it online!
Using the Elixir rewrite, 20 bytes
lÃ
¾MÃÂÃÂõÃ
¾MDuës5ÃÂDuëâ¡}û
Try it online! (without y) | Try it online! (with y, Ã
¾M being replaced by Ã
¾O â same applies for the legacy version)
How it works
lÃ
¾MÃÂÃÂõÃ
¾MDuës5ÃÂDuëâ¡}û Full program. Example: "Hello"
l Convert the input to lowercase. "Hello" âÂÂ> "hello"
Ã
¾MàKeep only lowercase vowels. "hello" âÂÂ> "eo"
àRemove duplicates. "eo" âÂÂ> "eo"
õ } For each of the characters (example with "e"):
Ã
¾MDuë Yield "aeiouAEIOU"
s5àSwap, and repeat the current char 5 times. "e" âÂÂ> "eeeee"
Duë Duplicate, uppercase and merge. "eeeee" âÂÂ> "eeeeeEEEE"
â¡ Transliteration. For each item in B, replace it in A with
the corresponding item in C.
û Join on newlines.
Nice answer, shorter than the 21 byte answer I prepared. You can golf one more byte by looping and printing instead of mapping: 19 bytes. Your TIO withyshould also use6instead of5, btw.
â Kevin Cruijssen
Sep 3 at 9:17
@KevinCruijssen Edited, thanks! About they-vowel version, I accidentally copied the wrong TIO link when I answered :|...
â Mr. Xcoder
Sep 3 at 9:22
Ah, now I know again why I had theiin my code.. Your answer fails for inputs without vowels. Expected is an empty output, but it actually prints the input itself.. :(
â Kevin Cruijssen
Sep 3 at 9:31
1
@KevinCruijssen The 20-byter works, so I rolled back and fixed the second link.
â Mr. Xcoder
Sep 3 at 9:34
add a comment |Â
up vote
4
down vote
05AB1E (legacy), 19 bytes
(Indirectly) saved one byte thanks to Kevin (printing directly inside the loop rather than joining, only work in the legacy version).
lÃ
¾MÃÂÃÂõÃ
¾MDuës5ÃÂDuëâ¡=
Try it online!
Using the Elixir rewrite, 20 bytes
lÃ
¾MÃÂÃÂõÃ
¾MDuës5ÃÂDuëâ¡}û
Try it online! (without y) | Try it online! (with y, Ã
¾M being replaced by Ã
¾O â same applies for the legacy version)
How it works
lÃ
¾MÃÂÃÂõÃ
¾MDuës5ÃÂDuëâ¡}û Full program. Example: "Hello"
l Convert the input to lowercase. "Hello" âÂÂ> "hello"
Ã
¾MàKeep only lowercase vowels. "hello" âÂÂ> "eo"
àRemove duplicates. "eo" âÂÂ> "eo"
õ } For each of the characters (example with "e"):
Ã
¾MDuë Yield "aeiouAEIOU"
s5àSwap, and repeat the current char 5 times. "e" âÂÂ> "eeeee"
Duë Duplicate, uppercase and merge. "eeeee" âÂÂ> "eeeeeEEEE"
â¡ Transliteration. For each item in B, replace it in A with
the corresponding item in C.
û Join on newlines.
Nice answer, shorter than the 21 byte answer I prepared. You can golf one more byte by looping and printing instead of mapping: 19 bytes. Your TIO withyshould also use6instead of5, btw.
â Kevin Cruijssen
Sep 3 at 9:17
@KevinCruijssen Edited, thanks! About they-vowel version, I accidentally copied the wrong TIO link when I answered :|...
â Mr. Xcoder
Sep 3 at 9:22
Ah, now I know again why I had theiin my code.. Your answer fails for inputs without vowels. Expected is an empty output, but it actually prints the input itself.. :(
â Kevin Cruijssen
Sep 3 at 9:31
1
@KevinCruijssen The 20-byter works, so I rolled back and fixed the second link.
â Mr. Xcoder
Sep 3 at 9:34
add a comment |Â
up vote
4
down vote
up vote
4
down vote
05AB1E (legacy), 19 bytes
(Indirectly) saved one byte thanks to Kevin (printing directly inside the loop rather than joining, only work in the legacy version).
lÃ
¾MÃÂÃÂõÃ
¾MDuës5ÃÂDuëâ¡=
Try it online!
Using the Elixir rewrite, 20 bytes
lÃ
¾MÃÂÃÂõÃ
¾MDuës5ÃÂDuëâ¡}û
Try it online! (without y) | Try it online! (with y, Ã
¾M being replaced by Ã
¾O â same applies for the legacy version)
How it works
lÃ
¾MÃÂÃÂõÃ
¾MDuës5ÃÂDuëâ¡}û Full program. Example: "Hello"
l Convert the input to lowercase. "Hello" âÂÂ> "hello"
Ã
¾MàKeep only lowercase vowels. "hello" âÂÂ> "eo"
àRemove duplicates. "eo" âÂÂ> "eo"
õ } For each of the characters (example with "e"):
Ã
¾MDuë Yield "aeiouAEIOU"
s5àSwap, and repeat the current char 5 times. "e" âÂÂ> "eeeee"
Duë Duplicate, uppercase and merge. "eeeee" âÂÂ> "eeeeeEEEE"
â¡ Transliteration. For each item in B, replace it in A with
the corresponding item in C.
û Join on newlines.
05AB1E (legacy), 19 bytes
(Indirectly) saved one byte thanks to Kevin (printing directly inside the loop rather than joining, only work in the legacy version).
lÃ
¾MÃÂÃÂõÃ
¾MDuës5ÃÂDuëâ¡=
Try it online!
Using the Elixir rewrite, 20 bytes
lÃ
¾MÃÂÃÂõÃ
¾MDuës5ÃÂDuëâ¡}û
Try it online! (without y) | Try it online! (with y, Ã
¾M being replaced by Ã
¾O â same applies for the legacy version)
How it works
lÃ
¾MÃÂÃÂõÃ
¾MDuës5ÃÂDuëâ¡}û Full program. Example: "Hello"
l Convert the input to lowercase. "Hello" âÂÂ> "hello"
Ã
¾MàKeep only lowercase vowels. "hello" âÂÂ> "eo"
àRemove duplicates. "eo" âÂÂ> "eo"
õ } For each of the characters (example with "e"):
Ã
¾MDuë Yield "aeiouAEIOU"
s5àSwap, and repeat the current char 5 times. "e" âÂÂ> "eeeee"
Duë Duplicate, uppercase and merge. "eeeee" âÂÂ> "eeeeeEEEE"
â¡ Transliteration. For each item in B, replace it in A with
the corresponding item in C.
û Join on newlines.
edited Sep 3 at 11:30
answered Sep 2 at 21:38
Mr. Xcoder
30.6k758194
30.6k758194
Nice answer, shorter than the 21 byte answer I prepared. You can golf one more byte by looping and printing instead of mapping: 19 bytes. Your TIO withyshould also use6instead of5, btw.
â Kevin Cruijssen
Sep 3 at 9:17
@KevinCruijssen Edited, thanks! About they-vowel version, I accidentally copied the wrong TIO link when I answered :|...
â Mr. Xcoder
Sep 3 at 9:22
Ah, now I know again why I had theiin my code.. Your answer fails for inputs without vowels. Expected is an empty output, but it actually prints the input itself.. :(
â Kevin Cruijssen
Sep 3 at 9:31
1
@KevinCruijssen The 20-byter works, so I rolled back and fixed the second link.
â Mr. Xcoder
Sep 3 at 9:34
add a comment |Â
Nice answer, shorter than the 21 byte answer I prepared. You can golf one more byte by looping and printing instead of mapping: 19 bytes. Your TIO withyshould also use6instead of5, btw.
â Kevin Cruijssen
Sep 3 at 9:17
@KevinCruijssen Edited, thanks! About they-vowel version, I accidentally copied the wrong TIO link when I answered :|...
â Mr. Xcoder
Sep 3 at 9:22
Ah, now I know again why I had theiin my code.. Your answer fails for inputs without vowels. Expected is an empty output, but it actually prints the input itself.. :(
â Kevin Cruijssen
Sep 3 at 9:31
1
@KevinCruijssen The 20-byter works, so I rolled back and fixed the second link.
â Mr. Xcoder
Sep 3 at 9:34
Nice answer, shorter than the 21 byte answer I prepared. You can golf one more byte by looping and printing instead of mapping: 19 bytes. Your TIO with
y should also use 6 instead of 5, btw.â Kevin Cruijssen
Sep 3 at 9:17
Nice answer, shorter than the 21 byte answer I prepared. You can golf one more byte by looping and printing instead of mapping: 19 bytes. Your TIO with
y should also use 6 instead of 5, btw.â Kevin Cruijssen
Sep 3 at 9:17
@KevinCruijssen Edited, thanks! About the
y-vowel version, I accidentally copied the wrong TIO link when I answered :|...â Mr. Xcoder
Sep 3 at 9:22
@KevinCruijssen Edited, thanks! About the
y-vowel version, I accidentally copied the wrong TIO link when I answered :|...â Mr. Xcoder
Sep 3 at 9:22
Ah, now I know again why I had the
i in my code.. Your answer fails for inputs without vowels. Expected is an empty output, but it actually prints the input itself.. :(â Kevin Cruijssen
Sep 3 at 9:31
Ah, now I know again why I had the
i in my code.. Your answer fails for inputs without vowels. Expected is an empty output, but it actually prints the input itself.. :(â Kevin Cruijssen
Sep 3 at 9:31
1
1
@KevinCruijssen The 20-byter works, so I rolled back and fixed the second link.
â Mr. Xcoder
Sep 3 at 9:34
@KevinCruijssen The 20-byter works, so I rolled back and fixed the second link.
â Mr. Xcoder
Sep 3 at 9:34
add a comment |Â
up vote
4
down vote
Japt v2.0a0 -R, 24 22 bytes
Treats y as a vowel. Change both occurences of y to v to treat it as a consonant.
v fy â ãry_Xc^H*ZøZu
Try it
Explanation
v :Lowercase
y :RegEx /[aeiouy]/gi (v is /[aeiou]/gi)
f :Get all matches as an array
â :Deduplicate
ã :Map each X
ry : Replace all matches of the RegEx above in the input
_ : Pass matches through a function as Z
Xc^ : XOR the character code of X with
H* : 32 multiplied by
Zø : Does Z contain
Zu : Uppercase Z
:Implicitly join with newlines and output
add a comment |Â
up vote
4
down vote
Japt v2.0a0 -R, 24 22 bytes
Treats y as a vowel. Change both occurences of y to v to treat it as a consonant.
v fy â ãry_Xc^H*ZøZu
Try it
Explanation
v :Lowercase
y :RegEx /[aeiouy]/gi (v is /[aeiou]/gi)
f :Get all matches as an array
â :Deduplicate
ã :Map each X
ry : Replace all matches of the RegEx above in the input
_ : Pass matches through a function as Z
Xc^ : XOR the character code of X with
H* : 32 multiplied by
Zø : Does Z contain
Zu : Uppercase Z
:Implicitly join with newlines and output
add a comment |Â
up vote
4
down vote
up vote
4
down vote
Japt v2.0a0 -R, 24 22 bytes
Treats y as a vowel. Change both occurences of y to v to treat it as a consonant.
v fy â ãry_Xc^H*ZøZu
Try it
Explanation
v :Lowercase
y :RegEx /[aeiouy]/gi (v is /[aeiou]/gi)
f :Get all matches as an array
â :Deduplicate
ã :Map each X
ry : Replace all matches of the RegEx above in the input
_ : Pass matches through a function as Z
Xc^ : XOR the character code of X with
H* : 32 multiplied by
Zø : Does Z contain
Zu : Uppercase Z
:Implicitly join with newlines and output
Japt v2.0a0 -R, 24 22 bytes
Treats y as a vowel. Change both occurences of y to v to treat it as a consonant.
v fy â ãry_Xc^H*ZøZu
Try it
Explanation
v :Lowercase
y :RegEx /[aeiouy]/gi (v is /[aeiou]/gi)
f :Get all matches as an array
â :Deduplicate
ã :Map each X
ry : Replace all matches of the RegEx above in the input
_ : Pass matches through a function as Z
Xc^ : XOR the character code of X with
H* : 32 multiplied by
Zø : Does Z contain
Zu : Uppercase Z
:Implicitly join with newlines and output
edited Sep 3 at 14:40
answered Sep 2 at 17:59
Shaggy
16.8k21661
16.8k21661
add a comment |Â
add a comment |Â
up vote
3
down vote
Jelly, Â 23 20 18Â 17 bytes
-2 Thanks to Erik the Outgolfer
ÃÂcÃ
ÂHZx5fÃÂðÃÂc,yðâ¬Y
To treat y as a vowel replace both cs with ys.
Try it online!
How?
ÃÂcÃ
ÂHZx5fÃÂðÃÂc,yðâ¬Y - Link: list of characters, S
ÃÂc - vowels -> "AEIOUaeiou"
Ã
ÂH - split in half -> ["AEIOU", "aeiou"]
Z - transpose -> ["Aa", "Ee", "Ii", "Oo", "Uu"]
x5 - times 5 -> ["AAAAAaaaaa", "EEEEEeeeee", "IIIIIiiiii", "OOOOOooooo", "UUUUUuuuuu"]
ÃÂ - filter keep if:
f - filter keep only -> those of X which have required vowels
- ...i.e. if S = "blah" then ["AAAAAaaaaa"]
ð ð⬠- dyadic chain for â¬ach:
ÃÂc - vowels -> "AEIOUaeiou"
, - pair e.g. ["AEIOUaeiou","AAAAAaaaaa"]
y - translate e.g. swap A for A, E for A, ...
Y - join with newlines
18 bytes (trivial) (à ¼/on a pair isZ, two dyads in a row where the left one is unpaired in a monad have the argument in-between implicitly)
â Erik the Outgolfer
Sep 2 at 19:40
Thanks (Z>_<), not sure what was going on with my TIO session, but removing the redundantðwasn't working; restart fixed.
â Jonathan Allan
Sep 2 at 19:54
TBH, I actually fixedxâ‰ÂÂxtoo, but you ninja'd me. :P
â Erik the Outgolfer
Sep 2 at 19:55
add a comment |Â
up vote
3
down vote
Jelly, Â 23 20 18Â 17 bytes
-2 Thanks to Erik the Outgolfer
ÃÂcÃ
ÂHZx5fÃÂðÃÂc,yðâ¬Y
To treat y as a vowel replace both cs with ys.
Try it online!
How?
ÃÂcÃ
ÂHZx5fÃÂðÃÂc,yðâ¬Y - Link: list of characters, S
ÃÂc - vowels -> "AEIOUaeiou"
Ã
ÂH - split in half -> ["AEIOU", "aeiou"]
Z - transpose -> ["Aa", "Ee", "Ii", "Oo", "Uu"]
x5 - times 5 -> ["AAAAAaaaaa", "EEEEEeeeee", "IIIIIiiiii", "OOOOOooooo", "UUUUUuuuuu"]
ÃÂ - filter keep if:
f - filter keep only -> those of X which have required vowels
- ...i.e. if S = "blah" then ["AAAAAaaaaa"]
ð ð⬠- dyadic chain for â¬ach:
ÃÂc - vowels -> "AEIOUaeiou"
, - pair e.g. ["AEIOUaeiou","AAAAAaaaaa"]
y - translate e.g. swap A for A, E for A, ...
Y - join with newlines
18 bytes (trivial) (à ¼/on a pair isZ, two dyads in a row where the left one is unpaired in a monad have the argument in-between implicitly)
â Erik the Outgolfer
Sep 2 at 19:40
Thanks (Z>_<), not sure what was going on with my TIO session, but removing the redundantðwasn't working; restart fixed.
â Jonathan Allan
Sep 2 at 19:54
TBH, I actually fixedxâ‰ÂÂxtoo, but you ninja'd me. :P
â Erik the Outgolfer
Sep 2 at 19:55
add a comment |Â
up vote
3
down vote
up vote
3
down vote
Jelly, Â 23 20 18Â 17 bytes
-2 Thanks to Erik the Outgolfer
ÃÂcÃ
ÂHZx5fÃÂðÃÂc,yðâ¬Y
To treat y as a vowel replace both cs with ys.
Try it online!
How?
ÃÂcÃ
ÂHZx5fÃÂðÃÂc,yðâ¬Y - Link: list of characters, S
ÃÂc - vowels -> "AEIOUaeiou"
Ã
ÂH - split in half -> ["AEIOU", "aeiou"]
Z - transpose -> ["Aa", "Ee", "Ii", "Oo", "Uu"]
x5 - times 5 -> ["AAAAAaaaaa", "EEEEEeeeee", "IIIIIiiiii", "OOOOOooooo", "UUUUUuuuuu"]
ÃÂ - filter keep if:
f - filter keep only -> those of X which have required vowels
- ...i.e. if S = "blah" then ["AAAAAaaaaa"]
ð ð⬠- dyadic chain for â¬ach:
ÃÂc - vowels -> "AEIOUaeiou"
, - pair e.g. ["AEIOUaeiou","AAAAAaaaaa"]
y - translate e.g. swap A for A, E for A, ...
Y - join with newlines
Jelly, Â 23 20 18Â 17 bytes
-2 Thanks to Erik the Outgolfer
ÃÂcÃ
ÂHZx5fÃÂðÃÂc,yðâ¬Y
To treat y as a vowel replace both cs with ys.
Try it online!
How?
ÃÂcÃ
ÂHZx5fÃÂðÃÂc,yðâ¬Y - Link: list of characters, S
ÃÂc - vowels -> "AEIOUaeiou"
Ã
ÂH - split in half -> ["AEIOU", "aeiou"]
Z - transpose -> ["Aa", "Ee", "Ii", "Oo", "Uu"]
x5 - times 5 -> ["AAAAAaaaaa", "EEEEEeeeee", "IIIIIiiiii", "OOOOOooooo", "UUUUUuuuuu"]
ÃÂ - filter keep if:
f - filter keep only -> those of X which have required vowels
- ...i.e. if S = "blah" then ["AAAAAaaaaa"]
ð ð⬠- dyadic chain for â¬ach:
ÃÂc - vowels -> "AEIOUaeiou"
, - pair e.g. ["AEIOUaeiou","AAAAAaaaaa"]
y - translate e.g. swap A for A, E for A, ...
Y - join with newlines
edited Sep 2 at 20:29
answered Sep 2 at 19:29
Jonathan Allan
48.5k534159
48.5k534159
18 bytes (trivial) (à ¼/on a pair isZ, two dyads in a row where the left one is unpaired in a monad have the argument in-between implicitly)
â Erik the Outgolfer
Sep 2 at 19:40
Thanks (Z>_<), not sure what was going on with my TIO session, but removing the redundantðwasn't working; restart fixed.
â Jonathan Allan
Sep 2 at 19:54
TBH, I actually fixedxâ‰ÂÂxtoo, but you ninja'd me. :P
â Erik the Outgolfer
Sep 2 at 19:55
add a comment |Â
18 bytes (trivial) (à ¼/on a pair isZ, two dyads in a row where the left one is unpaired in a monad have the argument in-between implicitly)
â Erik the Outgolfer
Sep 2 at 19:40
Thanks (Z>_<), not sure what was going on with my TIO session, but removing the redundantðwasn't working; restart fixed.
â Jonathan Allan
Sep 2 at 19:54
TBH, I actually fixedxâ‰ÂÂxtoo, but you ninja'd me. :P
â Erik the Outgolfer
Sep 2 at 19:55
18 bytes (trivial) (
Ã
¼/ on a pair is Z, two dyads in a row where the left one is unpaired in a monad have the argument in-between implicitly)â Erik the Outgolfer
Sep 2 at 19:40
18 bytes (trivial) (
Ã
¼/ on a pair is Z, two dyads in a row where the left one is unpaired in a monad have the argument in-between implicitly)â Erik the Outgolfer
Sep 2 at 19:40
Thanks (
Z >_<), not sure what was going on with my TIO session, but removing the redundant ð wasn't working; restart fixed.â Jonathan Allan
Sep 2 at 19:54
Thanks (
Z >_<), not sure what was going on with my TIO session, but removing the redundant ð wasn't working; restart fixed.â Jonathan Allan
Sep 2 at 19:54
TBH, I actually fixed
x⬠â x too, but you ninja'd me. :Pâ Erik the Outgolfer
Sep 2 at 19:55
TBH, I actually fixed
x⬠â x too, but you ninja'd me. :Pâ Erik the Outgolfer
Sep 2 at 19:55
add a comment |Â
up vote
3
down vote
Red, 229 bytes
Taking y for a non-vowel
func[s][v: charset"aoeiu"w: charset"AOEIU"p: copy""parse s[any[[copy c[v | w](if not find p c[append p c lowercase c
parse s[any[[copy n to[v | w | end]](prin n)opt[v(prin c)|[w(prin uppercase copy c)]| skip]]]print""])]| skip]]]
Try it online!
Slightly more readable:
f: func [ s ] [
v: charset "aoeiu"
w: charset "AOEIU"
p: copy ""
parse s[
any [
[ copy c [ v | w ]
( if not find p c [
append p c
lowercase c
parse s [
any [
[ copy n to [ v | w | end ] ]
( prin n )
opt [ v ( prin c )
| [ w ( prin uppercase copy c ) ]
| skip
]
]
]
print ""
] )
]
| skip
]
]
]
add a comment |Â
up vote
3
down vote
Red, 229 bytes
Taking y for a non-vowel
func[s][v: charset"aoeiu"w: charset"AOEIU"p: copy""parse s[any[[copy c[v | w](if not find p c[append p c lowercase c
parse s[any[[copy n to[v | w | end]](prin n)opt[v(prin c)|[w(prin uppercase copy c)]| skip]]]print""])]| skip]]]
Try it online!
Slightly more readable:
f: func [ s ] [
v: charset "aoeiu"
w: charset "AOEIU"
p: copy ""
parse s[
any [
[ copy c [ v | w ]
( if not find p c [
append p c
lowercase c
parse s [
any [
[ copy n to [ v | w | end ] ]
( prin n )
opt [ v ( prin c )
| [ w ( prin uppercase copy c ) ]
| skip
]
]
]
print ""
] )
]
| skip
]
]
]
add a comment |Â
up vote
3
down vote
up vote
3
down vote
Red, 229 bytes
Taking y for a non-vowel
func[s][v: charset"aoeiu"w: charset"AOEIU"p: copy""parse s[any[[copy c[v | w](if not find p c[append p c lowercase c
parse s[any[[copy n to[v | w | end]](prin n)opt[v(prin c)|[w(prin uppercase copy c)]| skip]]]print""])]| skip]]]
Try it online!
Slightly more readable:
f: func [ s ] [
v: charset "aoeiu"
w: charset "AOEIU"
p: copy ""
parse s[
any [
[ copy c [ v | w ]
( if not find p c [
append p c
lowercase c
parse s [
any [
[ copy n to [ v | w | end ] ]
( prin n )
opt [ v ( prin c )
| [ w ( prin uppercase copy c ) ]
| skip
]
]
]
print ""
] )
]
| skip
]
]
]
Red, 229 bytes
Taking y for a non-vowel
func[s][v: charset"aoeiu"w: charset"AOEIU"p: copy""parse s[any[[copy c[v | w](if not find p c[append p c lowercase c
parse s[any[[copy n to[v | w | end]](prin n)opt[v(prin c)|[w(prin uppercase copy c)]| skip]]]print""])]| skip]]]
Try it online!
Slightly more readable:
f: func [ s ] [
v: charset "aoeiu"
w: charset "AOEIU"
p: copy ""
parse s[
any [
[ copy c [ v | w ]
( if not find p c [
append p c
lowercase c
parse s [
any [
[ copy n to [ v | w | end ] ]
( prin n )
opt [ v ( prin c )
| [ w ( prin uppercase copy c ) ]
| skip
]
]
]
print ""
] )
]
| skip
]
]
]
edited Sep 3 at 13:56
answered Sep 3 at 13:48
Galen Ivanov
4,8471829
4,8471829
add a comment |Â
add a comment |Â
up vote
3
down vote
R, 138, 129 bytes
function(x,U=utf8ToInt,a=U(V<-'aeiouAEIOU'))for(i in (which(a%in%U(x))-1)%%5)cat(chartr(V,intToUtf8(rep(a[i+c(1,6)],e=5)),x),'
')
Try it online!
yis not considered a vowel
add a comment |Â
up vote
3
down vote
R, 138, 129 bytes
function(x,U=utf8ToInt,a=U(V<-'aeiouAEIOU'))for(i in (which(a%in%U(x))-1)%%5)cat(chartr(V,intToUtf8(rep(a[i+c(1,6)],e=5)),x),'
')
Try it online!
yis not considered a vowel
add a comment |Â
up vote
3
down vote
up vote
3
down vote
R, 138, 129 bytes
function(x,U=utf8ToInt,a=U(V<-'aeiouAEIOU'))for(i in (which(a%in%U(x))-1)%%5)cat(chartr(V,intToUtf8(rep(a[i+c(1,6)],e=5)),x),'
')
Try it online!
yis not considered a vowel
R, 138, 129 bytes
function(x,U=utf8ToInt,a=U(V<-'aeiouAEIOU'))for(i in (which(a%in%U(x))-1)%%5)cat(chartr(V,intToUtf8(rep(a[i+c(1,6)],e=5)),x),'
')
Try it online!
yis not considered a vowel
edited Sep 4 at 9:04
answered Sep 3 at 13:59
digEmAll
1,84147
1,84147
add a comment |Â
add a comment |Â
up vote
2
down vote
Python, 129 119 112 bytes
import re
f=lambda s:'n'.join(r('[AEIOU]',v.upper(),r('[aeiou]',v,s))for v in'aeiou'if v in s.lower());r=re.sub
Try it Online!
Doesn't treat $y$ as vowel.
-7 bytes thanks to @Mr.Xcoder
Glad to see you could get it working and golfed down a bit! Nice work
â joH1
Sep 2 at 20:34
@joH1 Thanks :)
â DimChtz
Sep 2 at 20:37
112 bytes.
â Mr. Xcoder
Sep 2 at 21:53
add a comment |Â
up vote
2
down vote
Python, 129 119 112 bytes
import re
f=lambda s:'n'.join(r('[AEIOU]',v.upper(),r('[aeiou]',v,s))for v in'aeiou'if v in s.lower());r=re.sub
Try it Online!
Doesn't treat $y$ as vowel.
-7 bytes thanks to @Mr.Xcoder
Glad to see you could get it working and golfed down a bit! Nice work
â joH1
Sep 2 at 20:34
@joH1 Thanks :)
â DimChtz
Sep 2 at 20:37
112 bytes.
â Mr. Xcoder
Sep 2 at 21:53
add a comment |Â
up vote
2
down vote
up vote
2
down vote
Python, 129 119 112 bytes
import re
f=lambda s:'n'.join(r('[AEIOU]',v.upper(),r('[aeiou]',v,s))for v in'aeiou'if v in s.lower());r=re.sub
Try it Online!
Doesn't treat $y$ as vowel.
-7 bytes thanks to @Mr.Xcoder
Python, 129 119 112 bytes
import re
f=lambda s:'n'.join(r('[AEIOU]',v.upper(),r('[aeiou]',v,s))for v in'aeiou'if v in s.lower());r=re.sub
Try it Online!
Doesn't treat $y$ as vowel.
-7 bytes thanks to @Mr.Xcoder
edited Sep 2 at 22:19
answered Sep 2 at 17:56
DimChtz
681111
681111
Glad to see you could get it working and golfed down a bit! Nice work
â joH1
Sep 2 at 20:34
@joH1 Thanks :)
â DimChtz
Sep 2 at 20:37
112 bytes.
â Mr. Xcoder
Sep 2 at 21:53
add a comment |Â
Glad to see you could get it working and golfed down a bit! Nice work
â joH1
Sep 2 at 20:34
@joH1 Thanks :)
â DimChtz
Sep 2 at 20:37
112 bytes.
â Mr. Xcoder
Sep 2 at 21:53
Glad to see you could get it working and golfed down a bit! Nice work
â joH1
Sep 2 at 20:34
Glad to see you could get it working and golfed down a bit! Nice work
â joH1
Sep 2 at 20:34
@joH1 Thanks :)
â DimChtz
Sep 2 at 20:37
@joH1 Thanks :)
â DimChtz
Sep 2 at 20:37
112 bytes.
â Mr. Xcoder
Sep 2 at 21:53
112 bytes.
â Mr. Xcoder
Sep 2 at 21:53
add a comment |Â
up vote
2
down vote
JavaScript (Node.js), 99 bytes
Treats $y$ as a consonant.
s=>(g=F=>Buffer(s).map(c=>2130466>>c&c>64?F(c):c)+`
`)(v=>g[v&=31]||(g[v]=S+=g(c=>c&96|v)),S='')&&S
Try it online!
Commented
s => ( // s = input string
g = F => // g = helper function taking a callback function F
Buffer(s) // turn s into a Buffer
.map(c => // for each ASCII code c in s:
2130466 // 2130466 is a vowel bitmask: 1000001000001000100010
// u o i e a
>> c // the ECMAScript specification enforces that the shiftCount is
// the result of masking out all but the least significant 5 bits
& c > 64 // also make sure to ignore non-letter characters
? // if a vowel is identified:
F(c) // invoke F with c
: // else:
c // just yield c
) + `n` // end of map(); coerce back to a string and append a newline
)(v => // invoke g with a callback that takes v:
g[v &= 31] || ( // unless this vowel has already been encountered:
g[v] = // mark it as encountered
S += // and append to the output string S
g( // the result of another call to g:
c => c & 96 | v // where vowels are replaced with v, using the original case
) // end of inner call to g
), //
S = '' // start with S = ''
) && S // end of outer call to g; return S
add a comment |Â
up vote
2
down vote
JavaScript (Node.js), 99 bytes
Treats $y$ as a consonant.
s=>(g=F=>Buffer(s).map(c=>2130466>>c&c>64?F(c):c)+`
`)(v=>g[v&=31]||(g[v]=S+=g(c=>c&96|v)),S='')&&S
Try it online!
Commented
s => ( // s = input string
g = F => // g = helper function taking a callback function F
Buffer(s) // turn s into a Buffer
.map(c => // for each ASCII code c in s:
2130466 // 2130466 is a vowel bitmask: 1000001000001000100010
// u o i e a
>> c // the ECMAScript specification enforces that the shiftCount is
// the result of masking out all but the least significant 5 bits
& c > 64 // also make sure to ignore non-letter characters
? // if a vowel is identified:
F(c) // invoke F with c
: // else:
c // just yield c
) + `n` // end of map(); coerce back to a string and append a newline
)(v => // invoke g with a callback that takes v:
g[v &= 31] || ( // unless this vowel has already been encountered:
g[v] = // mark it as encountered
S += // and append to the output string S
g( // the result of another call to g:
c => c & 96 | v // where vowels are replaced with v, using the original case
) // end of inner call to g
), //
S = '' // start with S = ''
) && S // end of outer call to g; return S
add a comment |Â
up vote
2
down vote
up vote
2
down vote
JavaScript (Node.js), 99 bytes
Treats $y$ as a consonant.
s=>(g=F=>Buffer(s).map(c=>2130466>>c&c>64?F(c):c)+`
`)(v=>g[v&=31]||(g[v]=S+=g(c=>c&96|v)),S='')&&S
Try it online!
Commented
s => ( // s = input string
g = F => // g = helper function taking a callback function F
Buffer(s) // turn s into a Buffer
.map(c => // for each ASCII code c in s:
2130466 // 2130466 is a vowel bitmask: 1000001000001000100010
// u o i e a
>> c // the ECMAScript specification enforces that the shiftCount is
// the result of masking out all but the least significant 5 bits
& c > 64 // also make sure to ignore non-letter characters
? // if a vowel is identified:
F(c) // invoke F with c
: // else:
c // just yield c
) + `n` // end of map(); coerce back to a string and append a newline
)(v => // invoke g with a callback that takes v:
g[v &= 31] || ( // unless this vowel has already been encountered:
g[v] = // mark it as encountered
S += // and append to the output string S
g( // the result of another call to g:
c => c & 96 | v // where vowels are replaced with v, using the original case
) // end of inner call to g
), //
S = '' // start with S = ''
) && S // end of outer call to g; return S
JavaScript (Node.js), 99 bytes
Treats $y$ as a consonant.
s=>(g=F=>Buffer(s).map(c=>2130466>>c&c>64?F(c):c)+`
`)(v=>g[v&=31]||(g[v]=S+=g(c=>c&96|v)),S='')&&S
Try it online!
Commented
s => ( // s = input string
g = F => // g = helper function taking a callback function F
Buffer(s) // turn s into a Buffer
.map(c => // for each ASCII code c in s:
2130466 // 2130466 is a vowel bitmask: 1000001000001000100010
// u o i e a
>> c // the ECMAScript specification enforces that the shiftCount is
// the result of masking out all but the least significant 5 bits
& c > 64 // also make sure to ignore non-letter characters
? // if a vowel is identified:
F(c) // invoke F with c
: // else:
c // just yield c
) + `n` // end of map(); coerce back to a string and append a newline
)(v => // invoke g with a callback that takes v:
g[v &= 31] || ( // unless this vowel has already been encountered:
g[v] = // mark it as encountered
S += // and append to the output string S
g( // the result of another call to g:
c => c & 96 | v // where vowels are replaced with v, using the original case
) // end of inner call to g
), //
S = '' // start with S = ''
) && S // end of outer call to g; return S
edited Sep 3 at 6:10
answered Sep 2 at 20:48
Arnauld
65k581274
65k581274
add a comment |Â
add a comment |Â
up vote
2
down vote
Java 10, 196 188 bytes
s->var d=new int[99];for(var c:s.toUpperCase().replaceAll("[^AEIOU]","").toCharArray())if(d[c]++<1)System.out.println(s.replaceAll("[AEIOU]",c+"").replaceAll("[aeiou]",(char)(c+32)+""));
-8 bytes thanks to @joH1.
Without y as vowel to save bytes.
Try it online.
Explanation:
s-> // Method with String parameter and no return-type
var d=new int[99]; // Integer-array indicating which vowels we've already output
for(var c:s.toUpperCase()// Convert the input to uppercase
.replaceAll("[^AEIOU]","")
// Remove all non-vowels
.toCharArray())// Convert it to a character array)
// And loop over those vowel-characters
if(d[c]++ // Increase the vowel-count by 1
<1) // And if it was 0 this iteration:
System.out.println( // Print with trailing newline:
s // The input,
.replaceAll("[AEIOU]",c+"")
// with every uppercase vowel replace with the current vowel
.replaceAll("[aeiou]",(char)(c+32)+""));
// and every lowercase vowel replaced as well
188 bytes by inlining the variablevin the loop
â joH1
Sep 4 at 9:03
@joH1 Thanks, not sure how I missed that..
â Kevin Cruijssen
Sep 4 at 9:07
add a comment |Â
up vote
2
down vote
Java 10, 196 188 bytes
s->var d=new int[99];for(var c:s.toUpperCase().replaceAll("[^AEIOU]","").toCharArray())if(d[c]++<1)System.out.println(s.replaceAll("[AEIOU]",c+"").replaceAll("[aeiou]",(char)(c+32)+""));
-8 bytes thanks to @joH1.
Without y as vowel to save bytes.
Try it online.
Explanation:
s-> // Method with String parameter and no return-type
var d=new int[99]; // Integer-array indicating which vowels we've already output
for(var c:s.toUpperCase()// Convert the input to uppercase
.replaceAll("[^AEIOU]","")
// Remove all non-vowels
.toCharArray())// Convert it to a character array)
// And loop over those vowel-characters
if(d[c]++ // Increase the vowel-count by 1
<1) // And if it was 0 this iteration:
System.out.println( // Print with trailing newline:
s // The input,
.replaceAll("[AEIOU]",c+"")
// with every uppercase vowel replace with the current vowel
.replaceAll("[aeiou]",(char)(c+32)+""));
// and every lowercase vowel replaced as well
188 bytes by inlining the variablevin the loop
â joH1
Sep 4 at 9:03
@joH1 Thanks, not sure how I missed that..
â Kevin Cruijssen
Sep 4 at 9:07
add a comment |Â
up vote
2
down vote
up vote
2
down vote
Java 10, 196 188 bytes
s->var d=new int[99];for(var c:s.toUpperCase().replaceAll("[^AEIOU]","").toCharArray())if(d[c]++<1)System.out.println(s.replaceAll("[AEIOU]",c+"").replaceAll("[aeiou]",(char)(c+32)+""));
-8 bytes thanks to @joH1.
Without y as vowel to save bytes.
Try it online.
Explanation:
s-> // Method with String parameter and no return-type
var d=new int[99]; // Integer-array indicating which vowels we've already output
for(var c:s.toUpperCase()// Convert the input to uppercase
.replaceAll("[^AEIOU]","")
// Remove all non-vowels
.toCharArray())// Convert it to a character array)
// And loop over those vowel-characters
if(d[c]++ // Increase the vowel-count by 1
<1) // And if it was 0 this iteration:
System.out.println( // Print with trailing newline:
s // The input,
.replaceAll("[AEIOU]",c+"")
// with every uppercase vowel replace with the current vowel
.replaceAll("[aeiou]",(char)(c+32)+""));
// and every lowercase vowel replaced as well
Java 10, 196 188 bytes
s->var d=new int[99];for(var c:s.toUpperCase().replaceAll("[^AEIOU]","").toCharArray())if(d[c]++<1)System.out.println(s.replaceAll("[AEIOU]",c+"").replaceAll("[aeiou]",(char)(c+32)+""));
-8 bytes thanks to @joH1.
Without y as vowel to save bytes.
Try it online.
Explanation:
s-> // Method with String parameter and no return-type
var d=new int[99]; // Integer-array indicating which vowels we've already output
for(var c:s.toUpperCase()// Convert the input to uppercase
.replaceAll("[^AEIOU]","")
// Remove all non-vowels
.toCharArray())// Convert it to a character array)
// And loop over those vowel-characters
if(d[c]++ // Increase the vowel-count by 1
<1) // And if it was 0 this iteration:
System.out.println( // Print with trailing newline:
s // The input,
.replaceAll("[AEIOU]",c+"")
// with every uppercase vowel replace with the current vowel
.replaceAll("[aeiou]",(char)(c+32)+""));
// and every lowercase vowel replaced as well
edited Sep 4 at 9:07
answered Sep 3 at 9:45
Kevin Cruijssen
30.5k553167
30.5k553167
188 bytes by inlining the variablevin the loop
â joH1
Sep 4 at 9:03
@joH1 Thanks, not sure how I missed that..
â Kevin Cruijssen
Sep 4 at 9:07
add a comment |Â
188 bytes by inlining the variablevin the loop
â joH1
Sep 4 at 9:03
@joH1 Thanks, not sure how I missed that..
â Kevin Cruijssen
Sep 4 at 9:07
188 bytes by inlining the variable
v in the loopâ joH1
Sep 4 at 9:03
188 bytes by inlining the variable
v in the loopâ joH1
Sep 4 at 9:03
@joH1 Thanks, not sure how I missed that..
â Kevin Cruijssen
Sep 4 at 9:07
@joH1 Thanks, not sure how I missed that..
â Kevin Cruijssen
Sep 4 at 9:07
add a comment |Â
up vote
1
down vote
Python 2, 112 bytes
s=input()
V='aeiouAEIOU'
for v in V:
if v in s.lower():print''.join([c,[v.upper(),v][c>'Z']][c in V]for c in s)
Try it online!
Treats y as a consonant.
add a comment |Â
up vote
1
down vote
Python 2, 112 bytes
s=input()
V='aeiouAEIOU'
for v in V:
if v in s.lower():print''.join([c,[v.upper(),v][c>'Z']][c in V]for c in s)
Try it online!
Treats y as a consonant.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Python 2, 112 bytes
s=input()
V='aeiouAEIOU'
for v in V:
if v in s.lower():print''.join([c,[v.upper(),v][c>'Z']][c in V]for c in s)
Try it online!
Treats y as a consonant.
Python 2, 112 bytes
s=input()
V='aeiouAEIOU'
for v in V:
if v in s.lower():print''.join([c,[v.upper(),v][c>'Z']][c in V]for c in s)
Try it online!
Treats y as a consonant.
answered Sep 2 at 21:41
Chas Brown
4,2611319
4,2611319
add a comment |Â
add a comment |Â
up vote
1
down vote
Perl 6, 64 bytes
m:g:i/<[aeiou]>/û.lc.uniqueû.&$^v;say S:g:ii[<[aeiou]>]=$v
Try it online!
add a comment |Â
up vote
1
down vote
Perl 6, 64 bytes
m:g:i/<[aeiou]>/û.lc.uniqueû.&$^v;say S:g:ii[<[aeiou]>]=$v
Try it online!
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Perl 6, 64 bytes
m:g:i/<[aeiou]>/û.lc.uniqueû.&$^v;say S:g:ii[<[aeiou]>]=$v
Try it online!
Perl 6, 64 bytes
m:g:i/<[aeiou]>/û.lc.uniqueû.&$^v;say S:g:ii[<[aeiou]>]=$v
Try it online!
answered Sep 3 at 10:33
nwellnhof
3,793715
3,793715
add a comment |Â
add a comment |Â
up vote
1
down vote
Java (OpenJDK 8), 184 bytes
y is a vowel
s->s.chars().mapToObj(c->""+(char)(c>96?c:c+32)).filter("aeiouy"::contains).distinct().forEach(c->System.out.println(s.replaceAll("[aeiouy]",c).replaceAll("[AEIOUY]",c.toUpperCase())))
Try it online!
add a comment |Â
up vote
1
down vote
Java (OpenJDK 8), 184 bytes
y is a vowel
s->s.chars().mapToObj(c->""+(char)(c>96?c:c+32)).filter("aeiouy"::contains).distinct().forEach(c->System.out.println(s.replaceAll("[aeiouy]",c).replaceAll("[AEIOUY]",c.toUpperCase())))
Try it online!
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Java (OpenJDK 8), 184 bytes
y is a vowel
s->s.chars().mapToObj(c->""+(char)(c>96?c:c+32)).filter("aeiouy"::contains).distinct().forEach(c->System.out.println(s.replaceAll("[aeiouy]",c).replaceAll("[AEIOUY]",c.toUpperCase())))
Try it online!
Java (OpenJDK 8), 184 bytes
y is a vowel
s->s.chars().mapToObj(c->""+(char)(c>96?c:c+32)).filter("aeiouy"::contains).distinct().forEach(c->System.out.println(s.replaceAll("[aeiouy]",c).replaceAll("[AEIOUY]",c.toUpperCase())))
Try it online!
edited Sep 4 at 15:26
answered Sep 4 at 15:20
Roberto Graham
1,285210
1,285210
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f171588%2frepeat-a-rhyme-and-loop-on-the-vowels%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password