A script that will generate a word to follow any input word, based on a Markov transition matrix computed from a corpus text.
For example, if using Lincoln's Gettysburg Address as a corpus, entering the word "four" will cause the script to output "score". Entering the word "and" will cause the script to output either "seven", "that", dedicated", "proper", "so", or "dead" with equal probability.
I used this script as a tool for college-level math students to explore a simple Markov Chain on their devices.