Nobody knows how it works, but it works.
def magic(String result): return Math.rand() % result.length == 1
Link to file