Skip to main content
1 of 10
Umbrella
  • 897
  • 5
  • 17

##PHP, 144 bytes

<?php $p=$n=$r='';foreach(str_split(file_get_contents(__FILE__))as$w)$p=$m[$p][]=$w;do$r.=$n=$m[$n][array_rand($m[$n])];while("\n"!=$n);echo$r;

Or, formatted for readability:

<?php 
// Previous character, Next Character, Result
$p = $n = $r = '';
// Get and iterate the characters in this file
foreach (str_split(file_get_contents(__FILE__)) as $w) {
    $p = $m[$p][] = $w;
}
do {
    $r .= $n = $m[$n][array_rand($m[$n])];
} while ("\n" != $n);
echo $r;
Umbrella
  • 897
  • 5
  • 17