You will be given a list of 9 words and your job is to search each word and find the airport codes hidden in each word. For some airport codes, a business name or person may be used in place of a word when one does not exist. For example, Concord corresponds to ORD, or Chicago O'Hare international Airport.
Relax
Mlive News Michigan
Diarrhea
Atlas
Tulsi Gabbard
Mspy
Sforzando
Santa
Algae
What immediately stand out are LAX (Los Angeles International) in "relax", SFO (San Francisco) in "sforzando", and LGA (La Guardia) in "algae".
For the rest:
words=["relax","mlivenewsmichigan","diarrhea","atlas", ...
"tulsigabbard","mspy","sforzando","santa","algae"];
for i=1:length(words)
word=words(i)
fid=fopen("c:\VB5 Projects\flooble\airport codes.txt","r");
while ~feof(fid)
l=fgetl(fid);
idx=strfind(l,'(');
if ~isempty(idx)
code=lower(l(idx+1:idx+3));
idx=strfind(word,code);
if ~isempty(idx)
disp(l)
end
end
end
close('all')
disp(' ')
end
finding
word =
"relax"
Los Angeles, CA (LAX)
Trelew, CB, Argentina (REL)
word =
"mlivenewsmichigan"
Chicago, IL - All airports (CHI)
Moline, IL (MLI)
Ende, Indonesia (ENE)
Gan Island, Maldives (GAN)
Inagua, Bahamas (IGA)
Samos, Greece (SMI)
word =
"diarrhea"
Alto Rio Senguerr, Argentina (ARR)
Yaroslavl, Russia (IAR)
word =
"atlas"
Atlanta, GA (ATL)
Las Vegas, NV (LAS)
word =
"tulsigabbard"
Tulsa, OK (TUL)
Alor Island, Indonesia (ARD)
Balmaceda, Chile (BBA)
Inagua, Bahamas (IGA)
Shetland Islands, United Kingdom - Sumburgh (LSI)
word =
"mspy"
Minneapolis, MN (MSP)
word =
"sforzando"
San Francisco, CA (SFO)
Fortaleza, Brazil (FOR)
word =
"santa"
San Diego, CA (SAN)
word =
"algae"
New York, NY - La Guardia (LGA)
Algiers, Algeria (ALG)
|
Posted by Charlie
on 2023-11-30 10:35:46 |