/* "The Official Movie Plot Generator" by Jason and Justin Heimberg http://www.movieplotgenerator.com/ */ #include #include #include #include //for chrono::system_clock #include //for default_random_engine #include //for bind using namespace std; int main() { //Although the three arrays just happen to have the same number of //elements, they are not parallel arrays. const string height[] { "Under 6 feet", "Between 6'1 and 6'6", "Taller than 6'7", }; const size_t nheight {size(height)}; //number of elements in array const string shooting[] { "Terrible 3 point shooter", "Average 3 point shooter", "Excellent 3 point shooter", }; const size_t nshoot {size(shooting)}; const string dribble[] { "Not capable of dribbling", "Can dribble on fast break with little pressure", "Handles pressure with ease", }; const size_t ndribble {size(dribble)}; //The value of each expression r() is a random int. unsigned seed = chrono::system_clock::now().time_since_epoch().count(); default_random_engine engine {seed}; uniform_int_distribution distribution; auto r {bind(distribution, engine)}; cout << height[r() % nheight] << "\n" << shooting[r() % nshoot] << "\n" << dribble[r() % ndribble] << ".\n"; return EXIT_SUCCESS; }