Learn how to create a command-line interface for the program.
- [Instructor] In this video,…we'll add a simple command line interface…to complete our program.…To do that, first I'd like to write a small utility function…that finds the matches in the pairings that we ran.…I'll just find-matches and it doesn't need any arguments.…Now I'll create a let body,…and inside of it, I'll create a variable called results…that I'll call run-pairings.…Run-pairings uses map which will return a lazy sequence.…So I'll wrap it here using vec to create a vector.…I'm forcing eagerness here,…because I'd like to compare all of the images…before printing those that match.…
Otherwise, the output in the run-match function…could conflict with our output…where we save the files that match.…Inside the let body, I'll now filter the results…for those that match.…To accomplish this, for my predicate,…I'll use the match keyword…and then I'll pull the first of the argument…that this function was given.…I'm using first because run-match returns a vector…where the result of the best match is first.…With find-matches in place,…
Skill Level Intermediate
1. Problem 1: Exploring Lake Pend Oreille
2. Problem 2: Image Analysis
3. Problem 3: Eight Queens
4. Problem 4: Accessing Peripherals
5. Problem 5: Recursion and Directories
6. Problem 6: Building the Web
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.