Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Required fields*

Write some Random English

Your Goal:

Given an odd integer input n greater than 1, generate a random English word of length n. An English word is one in which the odd (1-based) indices are consonants and the even (1-based) indices are vowels, the vowels being aeiou.

Random

For the purposes of this challenge, you are to sample from the vowels and consonants uniformly, with replacement. In other words, each possible English word must be equally likely to appear as an output.

Example Inputs/Outputs

3 -> bab, tec, yiq
5 -> baron, nariz, linog
7 -> murovay, fanafim

Winner:

Winner is the Lowest Byte Count.

Answer*

Draft saved
Draft discarded
Cancel
3
  • 1
    \$\begingroup\$ ØḄØẹḂ?X) for 8 bytes by using (modulo 2) instead of checking for divisibility by 2. \$\endgroup\$ Commented Oct 1, 2022 at 15:32
  • 1
    \$\begingroup\$ Another interesting 8-byter with ƭ (tie): ØḄØẹ2ƭX) \$\endgroup\$ Commented Oct 1, 2022 at 15:34
  • \$\begingroup\$ @Steffan Thank you! Didn't know was a thing \$\endgroup\$ Commented Oct 1, 2022 at 19:52

AltStyle によって変換されたページ (->オリジナル) /