The code with all the patterns is available at Part II.