/ ? n N
Search is a metal detector: / or ?, a few letters and ↵ jump to the next match, then n and N walk to the next and previous one.
Monday, 8:40 a.m. Dispatch replays Friday's last delivery for you: the rider followed the app to the harbour, to the very edge of the water, and handed two burritos to a confused fisherman. (The app wanted somewhere far out to sea; the harbour is as far as a bike goes.) Somewhere in the delivery code a latitude and a longitude have swapped places.
There are hundreds of numbers in those files. You don't read a beach to find a coin; you sweep it with a metal detector.
Warm-up from earlier chapters
Two from earlier chapters, from memory, before the new idea. Two wrong tries show the answer.
Tune it, sweep
/ opens a search at the bottom of the editor: type what you're looking for (the pattern) and every match lights up as you type, like a detector beeping over every coin of that kind. ↵ sweeps forward and stops at the first match after the cursor.
The next beep
The detector keeps the tune. n walks on to the next match, N walks back to the previous one, and at the end of the file the sweep carries on from the top. One search, then n n n past every match in the file.
Sweep the other way
? searches backwards, up the file. After a ?, n keeps going up and N comes back down: the same direction as the sweep, exactly like ; after F. Use ? when what you want is above you.
Tune it just enough
You don't need the whole word, only enough letters that nothing closer matches. /Wy finds Wynwood in four keys; /Wynwood takes nine. Type a couple of letters, watch the highlight, and press ↵ as soon as the right match is the next one.
Sweep for it
Each target starts a word. Search for it with / or ?, as few letters as you can, then ↵. n and N for the next one along.
This exercise needs a keyboard. Read on, and play it at your computer.
Which way is next?
The cursor is at the start of line 1. You search with /fee and ↵, then press N. Where does the cursor end up?
Sweeps, from memory
Press the keys.
order.order.Sweep the codebase
Twelve targets across the codebase. Search for each with as few letters as you can; n and N when the next one along is the one you want.
The first exercise of every lesson is free. Pro unlocks the rest, every track, for good.
See ProThis exercise needs a keyboard. Read on, and play it at your computer.
The zones file
zones.ts, where the coordinates live. Dispatch reads out six places in their order; the goal bar says what to check when you get there. A short search each; some are behind you, so ? or N.
The first exercise of every lesson is free. Pro unlocks the rest, every track, for good.
See ProThis exercise needs a keyboard. Read on, and play it at your computer.
Extra practice optional
The chapter is done. These rounds keep going as long as you like: stop whenever it stops being useful.
Beachcombing
Endless targets on word starts. Tune it, sweep, next.
The first exercise of every lesson is free. Pro unlocks the rest, every track, for good.
See ProThis exercise needs a keyboard. Read on, and play it at your computer.