Created helper function that crates a random pattern on the canvas