10 REM **************************************************************************
15 REM *                              GEO                                       *
20 REM *                    Phil Grier - Laurel MD                              *
25 REM *                        (301) 498-2226                                  *
30 REM *                              9-83                                      *
35 REM **************************************************************************
40 REM
45 REM (C) COPYRIGHT 1983, PHIL GRIER, LAUREL, MARYLAND
50 REM
55 REM Permission to copy without fee all or part of this program is granted
60 REM provided that the copies are not made or distributed for commercial
65 REM advantage, the copyright notice appears, and notice is given that
70 REM copying is by permission.
75 REM
80 REM **************************************************************************
85 REM
100 CLEAR
110 OPTION BASE 1
120 DIM X$(500),FOUND$(500):REM REMEMBER TO CHANGE LINE # 360 ALSO.
130 SCREEN 0,0,0,0
150 WIDTH 80
160 CLS
170 SP$=STRING$(15," ")
180 KEY OFF
190 RANDOMIZE (VAL(RIGHT$(TIME$,2))*555)
200 GOTO 280
210 LOCATE 25,60
220 PRINT"PRESS ";
240 PRINT"<ENTER>";
260 PHIL$=INKEY$
270 IF PHIL$="" THEN 260 ELSE RETURN
280 REM***********************  G E O G R A P H Y  *******************************
290 REM the aprostophy (REM) and REM mean the same thing - remark.
300 DEFINT A-Z
310 CLS
320 KEY OFF
330 GOSUB 1670
340 ON ERROR GOTO 2880
350 REM
360 FINIS=500
370 FOR I=1 TO FINIS
380 READ X$(I)
390 NEXT I
400 FINIS=I
410 PRINT
420 PRINT"I know of"FINIS"locations.";
430 PRINT"  Press ";
450 PRINT"<ENTER>";
470 PRINT"."
480 IN$=INKEY$
490 IF IN$<>CHR$(13) THEN 480
500 CLS
510 BEEP
520 INPUT "Make your initial selection: ",IN$
530 IF IN$="" THEN LOCATE CSRLIN-1:GOTO 510
540 IF ASC(LEFT$(IN$,1))>90 THEN PRINT"Enter in upper case only.  Press the <CAPS LOCK> button once.":PRINT,"(to the right of the spacebar)":GOSUB 210:CLS:GOTO 510
550 FOR I=1 TO FINIS
560 IF IN$=X$(I) THEN PRINT TAB(30):LOCATE CSRLIN-1:PRINT "-Ok, good.  "IN$" is a match.":GOSUB 1260:GOTO 1010
570 NEXT I
580 PRINT IN$" is not in my vocabulary."
590 GOSUB 2070
600 GOTO 510
610 REM
620 REM
630 REM********************** players selection *********************************
640 USED=0
650 GOSUB 1480
660 BEEP
670 INPUT "You Select: ",IN$
680 GOSUB 1480
690 IF IN$="CHALLENGE" OR IN$="CHALLANGE" THEN 1370
700 IF IN$="QUIT" OR IN$="END" THEN 1950
710 IF IN$="STOP" THEN PRINT"You entered STOP.  To resume, press REMRREM.  Any other key will end this game." ELSE 750
720 PHIL$=INKEY$
730 IF PHIL$="" THEN 720
740 IF PHIL$="R" THEN 610 ELSE 1950
750 IF LEN(IN$)<2 THEN LOCATE CSRLIN-1:GOTO 610
760 IF ASC(LEFT$(IN$,1))>90 THEN PRINT"Enter in upper case only.  Press the <CAPS LOCK> button once.":GOSUB 2070:GOTO 610
770 IF IN$="" THEN LOCATE CSRLIN-1:GOTO 610
780 PRINT TAB(LEN(IN$)+14);
790 LOCATE CSRLIN-1
810 PRINT"searching";
830 PRINT
840 IF LEFT$(IN$,1)<>RIGHT$(FOUND$(FOUND),1) THEN PRINT TAB(14+LEN(IN$));:LOCATE CSRLIN-1:PRINT"*";::PRINT"*";:PRINT"* Your first letter doesn't match my last one.":GOSUB 2070:GOTO 610
850 GOSUB 1180
860 IF USED=1 THEN 610
870 I=1
880 WHILE I<FINIS
890 IF IN$=X$(I) THEN GOSUB 1000:GOSUB 1260:GOTO 1010
900 I=I+1
910 WEND
920 LOCATE CSRLIN-1,14+LEN(IN$)
930 PRINT"*";
950 PRINT"*";
970 PRINT"* "IN$" not found"
980 GOSUB 2070
990 GOTO 610
1000 IF IN$=X$(I) THEN PRINT TAB(13):LOCATE CSRLIN-1:PRINT" ";IN$;" ";:PRINT" IS A MATCH.":RETURN:REM***inform user that input value was valid
1010 REM
1020 REM
1030 REM********************* computers selection ********************************
1040 START=RND(1)*(FINIS-1)
1050 FOR I=START TO FINIS
1060 IF LEFT$(X$(I),1)=RIGHT$(IN$,1) THEN GOSUB 1260:GOTO 1160
1070 NEXT I
1080 FOR I=START TO 1 STEP -1
1090 IF LEFT$(X$(I),1)=RIGHT$(IN$,1) THEN GOSUB 1260:GOTO 1160
1100 NEXT I
1110 PRINT
1120 PRINT"*** I can't find any more locations starting with ";RIGHT$(FOUND$(FOUND),1);"."
1130 PRINT
1140 PRINT"You did a good job.  You win........this time."
1150 GOTO 1950
1160 PRINT"I selected: "FOUND$(FOUND)
1170 GOTO 610
1180 REM
1190 REM
1200 REM********************  Locate in found list  ******************************
1210 USED=0
1220 FOR J=1 TO FOUND
1230 IF IN$=FOUND$(J) THEN PRINT TAB(14+LEN(IN$));:LOCATE CSRLIN-1:PRINT"*";:PRINT"*";:PRINT"* Is already used!":GOSUB 2070:USED=1:GOTO 1250
1240 NEXT J
1250 RETURN
1260 REM
1270 REM
1280 REM******** decrement the supply list & increment the FOUND list by one *****
1290 FOUND=FOUND+1
1300 FOUND$(FOUND)=X$(I)
1310 FOR J=I TO FINIS-1
1320 X$(J)=X$(J+1)
1330 NEXT J
1340 FINIS=FINIS-1
1350 GOSUB 1500
1360 RETURN
1370 REM
1380 REM
1390 REM************************* Challenge routine ******************************
1400 J=1
1410 WHILE J<FINIS
1420 IF LEFT$(X$(J),1)=RIGHT$(FOUND$(FOUND),1) THEN PRINT:PRINT " ";X$(J);" ";:PRINT" remained to be selected!  You lose!":GOSUB 2070:GOTO 1470
1430 J=J+1
1440 WEND
1450 PRINT
1460 PRINT"You won!  I can't find another selection to match you."
1470 GOTO 1950
1480 REM
1490 REM
1500 REM**********************  print points  ***********************************
1510 THISROW=CSRLIN
1520 THISCOL=POS(0)
1530 LOCATE 1,65
1550 PRINT SP$
1560 LOCATE 1,65
1570 PRINT FOUND"SELECTED  ";
1590 LOCATE 2,65
1610 PRINT SP$
1620 LOCATE 2,65
1630 PRINT FINIS"REMAINING";
1650 LOCATE THISROW,THISCOL
1660 RETURN
1670 REM
1680 REM
1690 REM**********************  Heading instructions  ****************************
1700 CLS
1710 LOCATE 2,30
1730 PRINT" G E O G R A P H Y ";
1750 PRINT
1760 LOCATE 5,1,0
1770 PRINT"The object of this game is to name:"
1780 PRINT
1790 PRINT,"1) A CONTINENT"
1800 PRINT,"2) A COUNTRY"
1810 PRINT,"3) A COUNTRY'S CAPITOL CITY"
1820 PRINT,"4) A STATE"
1830 PRINT,"5) A STATE CAPITOL"
1840 PRINT,"6) AN OCEAN OR SEA"
1850 PRINT
1860 PRINT"Enter your selection with your word's first character matching the last"
1870 PRINT"character of my last selected word, and I'll select mine likewise."
1880 PRINT
1890 PRINT"If you suspect no more names can be matched, enter CHALLENGE.  If I find"
1900 PRINT"a match, I'll tell you what you missed, and you lose.  If I can't find a"
1910 PRINT"match for your word, then you win."
1920 PRINT
1930 PRINT"example: marylan(D) -> (D)enve(R) -> (R)ussi(A) -> (A)tlantic ocea(N), etc."
1940 RETURN
1950 REM
1960 REM
1970 REM***********************  exit routine  ***********************************
1980 PRINT
1990 PRINT
2000 PRINT"You made"INT(FOUND/2)"responses, and there are"FINIS"names you haven't used."
2010 PRINT
2020 PRINT"Play again?  (Y or N)";
2030 PHIL$=INKEY$
2040 IF PHIL$="" THEN 2030
2050 IF PHIL$="Y" THEN 100
2060 GOTO 2950
2070 REM
2080 REM
2090 REM*********************** BRAAP ERROR SOUND *****************************
2100 SOUND 40,15
2110 RETURN
2120 REM
2130 REM
2140 REM***********************  States  ****************************************
2150 DATA ALABAMA,ARKANSAS,ALASKA,ARIZONA,CALIFORNIA,MAINE,NEW HAMPSHIRE
2160 DATA VERMONT,MASSACHUSETTS,CONNECTICUT,RHODE ISLAND,NEW YORK
2170 DATA NEW JERSEY,PENNSYLVANIA,DELAWARE,MARYLAND,VIRGINIA,WEST VIRGINIA
2180 DATA NORTH CAROLINA,SOUTH CAROLINA,GEORGIA,FLORIDA,MISSISSIPPI
2190 DATA LOUISIANA,TEXAS,NEW MEXICO,OREGON,WASHINGTON,IDAHO,NEVADA
2200 DATA MONTANA,UTAH,COLORADO,KANSAS,MISSOURI,NORTH DAKOTA,MINNESOTA
2210 DATA SOUTH DAKOTA,ILLINOIS,OHIO,KENTUCKY,TENNESSEE,IOWA,HAWAII
2220 DATA WISCONSIN,MICHIGAN,NEBRASKA,INDIANA,OKLAHOMA,WYOMING
2230 DATA WASHINGTON D.C.,UNITED STATES
2240 REM
2250 REM
2260 REM*********************  State Capitols  **********************************
2270 DATA MONTGOMERY,JUNEAU,PHOENIX,LITTLE ROCK,SACRAMENTO,DENVER
2280 DATA HARTFORD,DOVER,TALLAHASSEE,ATLANTA,HONOLULU,BOISE,SPRINGFIELD
2290 DATA DES MOINES,TOPEKA,FRANKFORT,BATON ROUGE,AUGUSTA,ANNAPOLIS
2300 DATA BOSTON,LANSING,ST. PAUL,JACKSON,JEFFERSON CITY,HELENA
2310 DATA LINCOLN,CARSON CITY,CONCORD,TRENTON,SANTE FE,ALBANY,INDIANAPOLIS
2320 DATA RALEIGH,BISMARK,COLUMBUS,OKLAHOMA CITY,SALEM,HARRISBURG
2330 DATA PROVIDENCE,COLUMBIA,PIERRE,NASHVILLE,AUSTIN,SALT LAKE CITY
2340 DATA MONTPELIER,RICHMOND,OLYMPIA,CHARLESTON,MADISON,CHEYANNE
2350 REM
2360 REM
2370 REM********************  Canada  *******************************************
2380 DATA ALBERTA,BRITISH COLUMBIA,MANITOBA,NEW BRUNSWICK,NEWFOUNDLAND
2390 DATA NORTHWEST TERRITORIES,NOVA SCOTIA,ONTARIO,QUEBEC,CANADA
2400 DATA PRINCE EDWARD ISLAND,SASKATCHEWAN,YUKON TERRITORY,CANADA
2410 DATA OTTOWA,HALIFAX,MONTREAL,VANCOUVER,VICTORIA
2420 REM
2430 REM
2440 REM****************** Western Hemisphere ***********************************
2450 DATA UNITED STATES,MEXICO,EL SALVADOR,SAN SALVADOR,GUATAMALA
2460 DATA NICARAGUA,PANAMA,COLUMBIA,PERU,BOLIVIA,BRAZIL,ARGENTINA
2470 DATA CUBA,COSTA RICA,HONDURAS,VENESUALA,URUGUAY,PARAGUAY,LA PAS
2480 DATA MEXICO CITY,BRAZILIA,CHILE,SANTIAGO,CARRACUS,NEW GUINEA
2490 DATA ANTIGUA,EQUADOR,GHANA,BUENOS AIRES
2500 REM
2510 REM
2520 REM************************  Countries  ************************************
2530 DATA EUROPE,ASIA,ENGLAND,WALES,IRELAND,SCOTLAND,FINLAND,NORWAY,SWEDEN
2540 DATA LUXEMBOURG,FRANCE,GERMANY,BELGIUM,SWITZERLAND,ITALY,SPAIN,MALTA
2550 DATA PORTUGAL,HUNGARY,CZECHOSLOVAKIA,ALBANIA,TIBET,INDIA,LITHUANIA
2560 DATA AUSTRALIA,SOUTH AMERICA,NORTH AMERICA,AFRICA,MOSAMBIQUE,YEMEN
2570 DATA POLAND,RUSSIA,CHINA,JAPAN,BURMA,INDONESIA,HOLLAND,NEW ZEALAND
2580 DATA SOUTH AFRICA,ZAMBIA,KENYA,ISRAEL,PALESTINE,IRAN,VIET NAM,SIAM
2590 DATA GREECE,CENTRAL AMERICA,LEBANON,PAKISTAN,SYRIA,FORMOSA,EGYPT,DENMARK
2600 DATA YALTA,SINGAPORE,ROMANIA,JAVA,AUSTRIA,TANZANIA,AMSTERDAM,AZORES
2610 DATA KOREA,CAMBODIA,THAILAND,CAMPOCHIA,TOKYO,MOSCOW,PEKING,LOAS,MALAYSIA
2620 DATA WARSAW,LONDON,NORTHERN IRELAND,BELFAST,OSLO,PARIS,EAST GERMANY
2630 DATA BRUSSELS,ZURICH,ROME,SYDNEY,MADRID,NEPAL,NETHERLANDS,ATHENS,CHAD
2640 DATA ANTARCTICA,TURKEY,ARMENIA,AFGHANASTAN,TIWAN,ETHIOPIA,MADAGASCAR
2650 DATA NORTH KOREA,SOUTH KOREA,RHODESIA,KUWAIT,YUGOSLAVIA,ANGLOA,DAKAR
2660 DATA SAUDI ARABIA,SAMOA,SUDAN,LIBYA,ARABIA,JORDAN,BEIRUT,JERUSALEM
2670 DATA RANGOON,TRIPOLI,ALGERIA,ANDORRA,ANGOLIA,BARBADOS,BANGLADESH,CYPRUS
2680 DATA BAHRAIN,BHUTAN,BOTSWANA,BULGARIA,BURUNDI,CAMEROON,CEYLON,CONGO
2690 DATA DAHOMEY,DOMINICAN REPUBLIC,ECUADOR,FIJI,GABON,GAMBIA,HAITI,ICELAND
2700 DATA IVORY COAST,IRAQ,JAMACA,LAOS,LIBERIA,MALAWI,MALAYA,MALI,MONGOLIA
2710 DATA MOZAMBIQUE,NIGER,NIGERIA,OMAN,PHILIPPINES,QUATAR,RWANDA,SOMALIA
2720 DATA SENEGAL,SIERRA LEONE,SWAZILAND,TOGO,TUNISIA,TRINIDAD,ZAYRE
2730 DATA USSR,UPPER VOLTA,SHANGHAI,CALCUTTA,SAO PAULO,BOMBAY,DJAKARTA
2740 DATA SEOUL,RIO DE JANERIO,CAIRO,HONG KONG,BERLIN,MANILA,NEW DELHI
2750 DATA KARACHI,MILAN,LIMA,BARCELONA,BUDAPEST,BANKOK,JOHANNESBURG,ANGOLA
2760 DATA ISTANBUL,VIENNA,HAVANA,GLASGOW,LISBON,COPENHAGEN,STOCKHOLM
2770 DATA PRAGUE,YOKOHAMA,MOROCCO,SOMALI,DAKARTA,NAIROBI,UGANDA,MADAGASCAR
2780 REM
2790 REM******************** Oceans & Seas **************************************
2800 DATA ATLANTIC OCEAN,PACIFIC OCEAN,INDIAN OCEAN,ASIATIC SEA,CASPEAN SEA
2810 DATA YELLOW SEA,BALTIC SEA,RED SEA,DEAD SEA,BLACK SEA,AEGEAN SEA
2820 DATA SOUTH CHINA SEA,CHINA SEA,MEDITERRANEAN SEA,ARCTIC OCEAN
2830 DATA ADRIATIC SEA,BERING SEA,NORTH SEA,CARIBBEAN SEA,SEA OF JAPAN
2840 DATA BEAUFORT SEA,CHUKCHI SEA,EAST SIBERIAN SEA,LAPTEV SEA,KARA SEA
2850 DATA BARENTS SEA,NORWEGIAN SEA,GREENLAND SEA,LINCOLN SEA,LABRADOR SEA
2860 DATA WHITE SEA,BALEARIC SEA,ALBORAN SEA,LIGURIAN SEA,TYRRHENIAN SEA
2870 DATA IONIAN SEA,SEA OF CRETE,SEA OF MARMARA,SEA OF AZOV,ARABIAN SEA
2871 DATA WEDDELL SEA,SCOTIA SEA,BELLINGSHAUSEN SEA,AMUNDSEN SEA,ROSS SEA
2872 DATA SEA OF OKHOTSK,CORAL SEA,TASMAN SEA,ARAFURA SEA,BANDA SEA
2873 DATA FLORES SEA,CELEBES SEA,JAVA SEA,SULU SEA,EAST CHINA SEA
2880 REM
2890 REM
2900 REM**********  Error handler for read end of array  ************************
2910 IF ERR=4 THEN RESUME 400:REM** error code received if out of data statements
2920 IF ERR<>0 THEN PRINT "THE ERROR IS #"ERR"IN LINE"ERL:REM***** if error wasn't handled by above line
2930 PRINT
2940 GOSUB 210
2950 CLS
2960 END
