Skip to main content
4 of 4
deleted 117 characters in body
Business Cat
  • 9.2k
  • 1
  • 17
  • 37

CJam, 21 17 12 bytes

Thanks to Martin Ender for saving me 5 bytes!

New version

'\,:,s_el-mR

This forms an array of strings following the pattern A, AB, ABC, and so on. It flattens it and chooses a random character. Since this string contains 26 A's, 25 B's, 24 C's, and so on, each letter has a distinct probability of being chosen.

Try it online!

Explanation

'\,          e# Push the range of all characters up to 'Z'
   :,        e# For each one, take the range of all characters up to it
     s       e# Convert the array of ranges to one string
      _el-   e# Subtract the lower case version of the string from itself
             e# This leaves only capital letters in the string
          mR e# Take a random character from it

Old version

26,:)'[,'A,- .*M*mr0=

Gets distinct probabilities by making a string in which each letter appears a number of times equal to its position in the alphabet.

26,:)                 e# Push 1, 2, ... 26
     '[,'A,-          e# Push 'A', 'B', ... 'Z'
             .*       e# Vectorize: repeat each letter the corresponding number of times
               M*     e# Join with no separator
                 mr   e# Shuffle the string
                   0= e# Get the first character
Business Cat
  • 9.2k
  • 1
  • 17
  • 37