DulcetAirman

recursive video

Mar 12th, 2020
335
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // https://www.facebook.com/towernter/videos/3166329563380276/
  2.  
  3. class Recording {
  4.     /** Creates an instance with the optional reference to previous recordings. */
  5.     constructor(private optional field previous : Recording) {}
  6.     /** sets up the camera and films the person shoring the previous video.*/
  7.     execute():void { ... }
  8.     /** Renders and returns the video of this recording. */
  9.     video():Video { ... }
  10. }
  11. function makeRecursiveVideo(optional argument previous : recording) : recording {
  12.     let recording = new Recording(previous);
  13.     recording.execute();
  14.     if(recording.video().length() < 30 seconds) {
  15.         recording = makeRecursiveVideo(recording);
  16.     }
  17.     return recording;
  18. }
  19. let recording = makeRecursiveVideo(null);
  20. display(recording.video())
RAW Paste Data Copied