initial commit
This commit is contained in:
39 files changed
+1915
No files matched your search
+30
@@ -0,0 +1,30 @@
|
||||
### IntelliJ IDEA ###
|
||||
out/
|
||||
!**/src/main/**/out/
|
||||
!**/src/test/**/out/
|
||||
.kotlin
|
||||
|
||||
### Eclipse ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
bin/
|
||||
!**/src/main/**/bin/
|
||||
!**/src/test/**/bin/
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
### Mac OS ###
|
||||
.DS_Store
|
||||
Generated
+8
@@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
Generated
+13
@@ -0,0 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="lib">
|
||||
<CLASSES>
|
||||
<root url="file://$USER_HOME$/JavaFX/javafx-sdk-25.0.1/lib" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<NATIVE>
|
||||
<root url="file://$USER_HOME$/JavaFX/javafx-sdk-25.0.1/lib" />
|
||||
</NATIVE>
|
||||
<SOURCES />
|
||||
<jarDirectory url="file://$USER_HOME$/JavaFX/javafx-sdk-25.0.1/lib" recursive="false" />
|
||||
</library>
|
||||
</component>
|
||||
Generated
+12
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="MaterialThemeProjectNewConfig">
|
||||
<option name="metadata">
|
||||
<MTProjectMetadataState>
|
||||
<option name="migrated" value="true" />
|
||||
<option name="pristineConfig" value="false" />
|
||||
<option name="userId" value="335bdae2:1992ba776c5:-7ffe" />
|
||||
</MTProjectMetadataState>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
Generated
+6
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_24" default="true" project-jdk-name="24" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
Generated
+8
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/comp2522termProject.iml" filepath="$PROJECT_DIR$/comp2522termProject.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/code" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/tests" isTestSource="true" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="lib" level="project" />
|
||||
<orderEntry type="module-library" scope="TEST">
|
||||
<library name="JUnit4">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.13.1/junit-4.13.1.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" scope="TEST">
|
||||
<library name="JUnit5">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter/5.14.0/junit-jupiter-5.14.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-api/5.14.0/junit-jupiter-api-5.14.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/opentest4j/opentest4j/1.3.0/opentest4j-1.3.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-commons/1.14.0/junit-platform-commons-1.14.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-params/5.14.0/junit-jupiter-params-5.14.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-engine/5.14.0/junit-jupiter-engine-5.14.0.jar!/" />
|
||||
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-engine/1.14.0/junit-platform-engine-1.14.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
</component>
|
||||
</module>
|
||||
@@ -0,0 +1,55 @@
|
||||
|
||||
Afghanistan:Kabul
|
||||
Home to the ancient Silk Road trading route.
|
||||
Known for its mountainous terrain, including the Hindu Kush range.
|
||||
Produces some of the world's finest pomegranates and saffron.
|
||||
|
||||
Albania:Tirana
|
||||
Over 170,000 bunkers were built during the communist era.
|
||||
The national hero, Skanderbeg, resisted Ottoman rule for 25 years.
|
||||
Traditional polyphonic folk music is recognized by UNESCO as intangible cultural heritage.
|
||||
|
||||
Algeria:Algiers
|
||||
The largest country in Africa by land area.
|
||||
Home to the Sahara Desert, which covers more than 80% of its territory.
|
||||
Ancient rock art in Tassili n'Ajjer depicts a once-lush Sahara.
|
||||
|
||||
Andorra:Andorra la Vella
|
||||
One of the smallest countries in Europe, located between France and Spain.
|
||||
Has the highest life expectancy in the world at about 83 years.
|
||||
The only country with Catalan as its sole official language.
|
||||
|
||||
Angola:Luanda
|
||||
Second-largest producer of diamonds in Africa.
|
||||
Home to the Quiçama National Park, known for its "Operation Noah's Ark" wildlife reintroduction.
|
||||
Has a unique geographic feature called Kalandula Falls, one of Africa's largest waterfalls.
|
||||
|
||||
Antigua and Barbuda:Saint John's
|
||||
Comprises 365 beaches, "one for every day of the year."
|
||||
Home to the restored Nelson's Dockyard, a UNESCO World Heritage site.
|
||||
The national sport is cricket, with several famous players hailing from here.
|
||||
|
||||
Argentina:Buenos Aires
|
||||
Birthplace of tango, the passionate dance and music genre.
|
||||
Home to the Perito Moreno Glacier, one of the few advancing glaciers in the world.
|
||||
Produces some of the world's finest beef and Malbec wine.
|
||||
|
||||
Armenia:Yerevan
|
||||
One of the oldest continuously inhabited cities in the world.
|
||||
First nation to adopt Christianity as a state religion in 301 AD.
|
||||
Home to the world's oldest winery, dating back 6,100 years.
|
||||
|
||||
Australia:Canberra
|
||||
The only continent that is also a country.
|
||||
Home to unique wildlife like kangaroos, koalas, and platypuses.
|
||||
The Great Barrier Reef, the world's largest coral reef system, lies off its coast.
|
||||
|
||||
Austria:Vienna
|
||||
Birthplace of classical composers Mozart, Beethoven, and Schubert.
|
||||
Known for its coffee house culture, recognized by UNESCO.
|
||||
Home to the world's oldest zoo, Tiergarten Schönbrunn.
|
||||
|
||||
Azerbaijan:Baku
|
||||
Famous for its "Flame Towers," a modern architectural marvel.
|
||||
Has ancient Zoroastrian fire temples, reflecting its long history.
|
||||
Known for hosting the Formula 1 Grand Prix along its city streets.
|
||||
@@ -0,0 +1,85 @@
|
||||
|
||||
Bahamas:Nassau
|
||||
Composed of 700 islands and cays.
|
||||
Famous for its crystal-clear blue waters and coral reefs.
|
||||
Pirates once ruled its capital in the early 18th century.
|
||||
|
||||
Bahrain:Manama
|
||||
Known as one of the oldest centers for pearling.
|
||||
Famous for the Tree of Life, which grows in the desert with no apparent water source.
|
||||
Hosts one of the region's most significant Formula 1 Grand Prix races.
|
||||
|
||||
Bangladesh:Dhaka
|
||||
The world's largest river delta is located here.
|
||||
It is the second-largest producer of garments globally.
|
||||
Famous for its boat-building tradition, dating back over 2,000 years.
|
||||
|
||||
Barbados:Bridgetown
|
||||
The only country visited by George Washington outside North America.
|
||||
Known for producing world-class rum.
|
||||
Hosts one of the most vibrant and colorful carnivals in the Caribbean.
|
||||
|
||||
Belarus:Minsk
|
||||
Home to one of the largest remaining primeval forests in Europe.
|
||||
Known for its Soviet-era architecture and monuments.
|
||||
Major producer of tractors and agricultural machinery.
|
||||
|
||||
Belgium:Brussels
|
||||
Known for its chocolate, waffles, and beer.
|
||||
Home to the European Union's headquarters.
|
||||
Its capital has one of the most famous squares in Europe, the Grand Place.
|
||||
|
||||
Belize:Belmopan
|
||||
Home to the second-largest barrier reef in the world.
|
||||
Famous for its Mayan ruins scattered across the country.
|
||||
English is the official language, unique in Central America.
|
||||
|
||||
Benin:Porto-Novo
|
||||
Known as the birthplace of the Vodun (Voodoo) religion.
|
||||
Home to the Royal Palaces of Abomey, a UNESCO World Heritage site.
|
||||
Once part of the powerful Dahomey Kingdom.
|
||||
|
||||
Bhutan:Thimphu
|
||||
Measures Gross National Happiness as a measure of success.
|
||||
Known for its beautiful monasteries, including the famous Tiger's Nest.
|
||||
The only country in the world that absorbs more carbon than it emits.
|
||||
|
||||
Bolivia:Sucre
|
||||
Home to the world's largest salt flat, Salar de Uyuni.
|
||||
Known for Lake Titicaca, the highest navigable lake in the world.
|
||||
Has two capital cities, with La Paz being the highest administrative capital in the world.
|
||||
|
||||
Bosnia and Herzegovina:Sarajevo
|
||||
Famous for its cultural diversity, with influences from the Ottoman and Austro-Hungarian empires.
|
||||
Hosted the Winter Olympics in 1984.
|
||||
The site of the assassination that sparked World War I.
|
||||
|
||||
Botswana:Gaborone
|
||||
Known for its vast wildlife reserves and large elephant populations.
|
||||
Famous for the Okavango Delta, one of the most biodiverse areas in the world.
|
||||
One of Africa's most stable democracies.
|
||||
|
||||
Brazil:Brasília
|
||||
Known for its famous Carnival, a vibrant festival celebrated every year.
|
||||
The Amazon Rainforest, the world's largest, covers a large portion of this country.
|
||||
Home to the iconic Christ the Redeemer statue, one of the New Seven Wonders of the World.
|
||||
|
||||
Brunei:Bandar Seri Begawan
|
||||
One of the wealthiest countries in the world due to its oil and gas reserves.
|
||||
Ruled by one of the world's longest-reigning monarchs.
|
||||
Famous for its opulent mosques, including the Sultan Omar Ali Saifuddien Mosque.
|
||||
|
||||
Bulgaria:Sofia
|
||||
Home to the ancient city of Plovdiv, one of the oldest continuously inhabited cities in the world.
|
||||
Famous for producing over 80% of the world's rose oil, used in perfumes.
|
||||
Known for its rich folk music tradition, including the hauntingly beautiful women's choir.
|
||||
|
||||
Burkina Faso:Ouagadougou
|
||||
One of the top producers of cotton in Africa.
|
||||
Known for its rich cultural festivals, including FESPACO, Africa's largest film festival.
|
||||
Famous for the Domes of Fabedougou, a unique geological formation.
|
||||
|
||||
Burundi:Gitega
|
||||
Known for its traditional drumming, which is recognized by UNESCO.
|
||||
Home to Lake Tanganyika, one of the world's deepest and longest freshwater lakes.
|
||||
One of the most densely populated countries in Africa.
|
||||
@@ -0,0 +1,85 @@
|
||||
|
||||
Cabo Verde:Praia
|
||||
An archipelago off the coast of West Africa.
|
||||
Famous for its morna music, popularized by singer Cesária Évora.
|
||||
Known for its dry, desert-like climate despite being in the tropics.
|
||||
|
||||
Cambodia:Phnom Penh
|
||||
Home to Angkor Wat, the largest religious monument in the world.
|
||||
Known for the tragic history of the Khmer Rouge regime.
|
||||
Famous for its unique silk-weaving tradition, which dates back centuries.
|
||||
|
||||
Cameroon:Yaoundé
|
||||
Known for its diverse landscape, from mountains to rainforests and savannas.
|
||||
Famous for its coffee and cocoa production.
|
||||
The country has more than 230 spoken languages.
|
||||
|
||||
Canada:Ottawa
|
||||
Home to the longest coastline in the world.
|
||||
Famous for its maple syrup production, accounting for 71% of the world's supply.
|
||||
One of the most multicultural nations in the world, with more than 200 ethnic origins represented.
|
||||
|
||||
Central African Republic:Bangui
|
||||
Known for its rich biodiversity, including elephants, gorillas, and forest buffalo.
|
||||
The Dzanga-Sangha Reserve is home to one of the last remaining pygmy populations.
|
||||
Diamonds are one of the country’s major exports.
|
||||
|
||||
Chad:N'Djamena
|
||||
Lake Chad is one of the largest lakes in Africa but is shrinking rapidly.
|
||||
The Tibesti Mountains in the north are home to some of the oldest rock paintings.
|
||||
Known as the "Dead Heart of Africa" due to its central desert region.
|
||||
|
||||
Chile:Santiago
|
||||
Home to the driest desert in the world, the Atacama Desert.
|
||||
Famous for its long, narrow geography, stretching across 4,300 km.
|
||||
Known for Easter Island, home to the iconic Moai statues.
|
||||
|
||||
China:Beijing
|
||||
The most populous country in the world.
|
||||
Home to the Great Wall, the longest wall in the world.
|
||||
Known for the Forbidden City, the largest ancient palace in the world.
|
||||
|
||||
Colombia:Bogotá
|
||||
The second most biodiverse country in the world.
|
||||
Known for producing the world’s best coffee.
|
||||
Famous for its annual Flower Festival, showcasing over 500,000 blooms.
|
||||
|
||||
Comoros:Moroni
|
||||
An archipelago located in the Indian Ocean, known as "the Perfume Islands" for its ylang-ylang production.
|
||||
One of the smallest countries in Africa by land area and population.
|
||||
Famous for its volcanic landscape, particularly Mount Karthala, one of the world’s most active volcanoes.
|
||||
|
||||
Congo, Democratic Republic of the:Kinshasa
|
||||
Home to the second-largest rainforest in the world, after the Amazon.
|
||||
The Congo River is the second longest in Africa and the deepest in the world.
|
||||
Known for its rich mineral resources, including cobalt and copper.
|
||||
|
||||
Congo, Republic of the:Brazzaville
|
||||
Shares the Congo River with its neighbor, the Democratic Republic of the Congo.
|
||||
Known for its diverse wildlife, including western lowland gorillas.
|
||||
Famous for the Basilique Sainte-Anne, one of Africa’s most impressive churches.
|
||||
|
||||
Costa Rica:San José
|
||||
Famous for its biodiversity, housing 5% of the world’s species.
|
||||
Has no standing army, abolished in 1949.
|
||||
Known for its commitment to sustainability and eco-tourism.
|
||||
|
||||
Croatia:Zagreb
|
||||
Home to over 1,000 islands, only about 50 of which are inhabited.
|
||||
Famous for its picturesque Dalmatian coastline along the Adriatic Sea.
|
||||
The city of Dubrovnik is known as the "Pearl of the Adriatic."
|
||||
|
||||
Cuba:Havana
|
||||
Famous for its cigars and rum, made from local sugarcane.
|
||||
Known for its vintage cars and colonial architecture.
|
||||
The largest island in the Caribbean, with over 5,700 kilometers of coastline.
|
||||
|
||||
Cyprus:Nicosia
|
||||
The island is divided into Greek Cypriot and Turkish Cypriot regions.
|
||||
Famous for being the legendary birthplace of the goddess Aphrodite.
|
||||
Known for its Halloumi cheese, a traditional delicacy.
|
||||
|
||||
Czech Republic:Prague
|
||||
Famous for its medieval Old Town and Prague Castle, the largest ancient castle in the world.
|
||||
Known for its rich beer-brewing tradition, with the highest beer consumption per capita globally.
|
||||
Home to Charles Bridge, a historic bridge adorned with 30 statues.
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
Denmark:Copenhagen
|
||||
Known for the "happiest people in the world" according to global happiness rankings.
|
||||
Famous for its bicycle-friendly culture and having more bikes than cars.
|
||||
The birthplace of LEGO, one of the world’s most popular toys.
|
||||
|
||||
Djibouti:Djibouti
|
||||
Home to Lake Assal, the saltiest lake outside of Antarctica.
|
||||
Located on one of the busiest shipping routes in the world, the Bab-el-Mandeb Strait.
|
||||
Famous for its dramatic desert landscapes and limestone formations.
|
||||
|
||||
Dominica:Roseau
|
||||
Known as the "Nature Island" due to its lush rainforests and boiling lakes.
|
||||
Famous for Morne Trois Pitons National Park, a UNESCO World Heritage site.
|
||||
One of the few Caribbean islands with an indigenous population, the Kalinago people.
|
||||
|
||||
Dominican Republic:Santo Domingo
|
||||
Shares the island of Hispaniola with Haiti.
|
||||
The first European settlement in the Americas, founded by Christopher Columbus’s brother.
|
||||
Known for its merengue and bachata music and dance styles.
|
||||
@@ -0,0 +1,45 @@
|
||||
|
||||
East Timor:Dili
|
||||
One of the youngest countries in the world, gaining independence in 2002.
|
||||
Known for its stunning coral reefs and rich marine biodiversity.
|
||||
Coffee is one of the country’s major exports.
|
||||
|
||||
Ecuador:Quito
|
||||
The country is named after the Equator, which runs through it.
|
||||
Famous for the Galápagos Islands, home to unique wildlife species.
|
||||
Known for its colonial architecture, particularly in Quito, a UNESCO World Heritage site.
|
||||
|
||||
Egypt:Cairo
|
||||
Home to the last surviving Wonder of the Ancient World, the Pyramids of Giza.
|
||||
The Nile River, the longest in the world, runs through the country.
|
||||
Famous for its ancient history and archaeological sites, including the Valley of the Kings.
|
||||
|
||||
El Salvador:San Salvador
|
||||
The smallest and most densely populated country in Central America.
|
||||
Known for its Pacific Ocean beaches and surf spots.
|
||||
Coffee and sugarcane are key exports.
|
||||
|
||||
Equatorial Guinea:Malabo
|
||||
The only African country where Spanish is the official language.
|
||||
Oil and gas account for the majority of its GDP.
|
||||
Famous for its rich rainforests and diverse wildlife.
|
||||
|
||||
Eritrea:Asmara
|
||||
Known for its well-preserved Italian colonial architecture.
|
||||
Home to one of the world’s highest concentrations of ancient rock art.
|
||||
Gained independence from Ethiopia in 1993 after a 30-year war.
|
||||
|
||||
Estonia:Tallinn
|
||||
One of the most digitally advanced countries in the world, with e-government services.
|
||||
Known for its medieval Old Town, a UNESCO World Heritage site.
|
||||
The first country to offer e-residency, allowing foreign nationals to start businesses online.
|
||||
|
||||
Eswatini (formerly Swaziland):Mbabane
|
||||
One of the few remaining absolute monarchies in the world.
|
||||
Known for its rich cultural traditions, including the Umhlanga (reed dance) festival.
|
||||
Home to beautiful nature reserves and wildlife, including lions and rhinos.
|
||||
|
||||
Ethiopia:Addis Ababa
|
||||
The only African country never colonized (except briefly by Italy).
|
||||
Home to the oldest known human ancestors, dating back 3.2 million years.
|
||||
Known for its coffee, believed to be the birthplace of the coffee bean.
|
||||
@@ -0,0 +1,15 @@
|
||||
|
||||
Fiji:Suva
|
||||
An archipelago of over 300 islands.
|
||||
Known for its clear blue waters, coral reefs, and white-sand beaches.
|
||||
Rugby is the national sport, and the country has won Olympic gold in rugby sevens.
|
||||
|
||||
Finland:Helsinki
|
||||
Known for its vast forests and thousands of lakes.
|
||||
Famous for being one of the happiest countries in the world.
|
||||
The sauna is an essential part of the culture, with more saunas than cars.
|
||||
|
||||
France:Paris
|
||||
Known for its iconic landmarks, including the Eiffel Tower and the Louvre Museum.
|
||||
One of the world’s most influential countries in art, fashion, and cuisine.
|
||||
Home to the world’s most visited art museum, the Louvre.
|
||||
@@ -0,0 +1,55 @@
|
||||
|
||||
Gabon:Libreville
|
||||
Nearly 90% of the country is covered by rainforests.
|
||||
Famous for its lowland gorilla population.
|
||||
Rich in oil, making it one of Africa’s wealthiest nations by GDP per capita.
|
||||
|
||||
Gambia:Banjul
|
||||
The smallest country on mainland Africa.
|
||||
Known for its beautiful Atlantic coastline and river.
|
||||
Famous for its birdwatching, with over 540 bird species recorded.
|
||||
|
||||
Georgia:Tbilisi
|
||||
Home to some of the oldest known wine regions in the world.
|
||||
Known for its beautiful mountainous landscapes, particularly the Caucasus.
|
||||
Famous for its unique alphabet, one of only 14 existing in the world today.
|
||||
|
||||
Germany:Berlin
|
||||
Famous for its history, including the Berlin Wall and Brandenburg Gate.
|
||||
Known for its engineering, particularly in automobiles and machinery.
|
||||
Oktoberfest in Munich is one of the world’s largest beer festivals.
|
||||
|
||||
Ghana:Accra
|
||||
Known for its vibrant culture, including kente cloth and traditional drumming.
|
||||
The first African country to gain independence from colonial rule in 1957.
|
||||
Famous for its cocoa production, one of the largest in the world.
|
||||
|
||||
Greece:Athens
|
||||
Known as the birthplace of democracy and Western philosophy.
|
||||
Famous for ancient landmarks like the Parthenon and the Acropolis.
|
||||
Home to more than 6,000 islands, though only about 227 are inhabited.
|
||||
|
||||
Grenada:Saint George's
|
||||
Known as the "Island of Spice" for its nutmeg and mace production.
|
||||
Famous for its lush rainforests, waterfalls, and beaches.
|
||||
Home to one of the world’s first underwater sculpture parks.
|
||||
|
||||
Guatemala:Guatemala City
|
||||
Known for its rich Mayan heritage, including ruins like Tikal.
|
||||
Produces some of the world’s best coffee.
|
||||
Famous for Lake Atitlán, surrounded by volcanoes and indigenous villages.
|
||||
|
||||
Guinea:Conakry
|
||||
Known for its mineral wealth, particularly bauxite, a key ingredient in aluminum production.
|
||||
Has one of West Africa's most active volcanoes, Mount Nimba.
|
||||
Famous for its diverse traditional music and dance.
|
||||
|
||||
Guinea-Bissau:Bissau
|
||||
Famous for the Bijagós Archipelago, a UNESCO Biosphere Reserve.
|
||||
One of the least-visited countries in the world, known for its unspoiled beauty.
|
||||
Known for its cashew nut exports, a major part of the economy.
|
||||
|
||||
Guyana:Georgetown
|
||||
Home to Kaieteur Falls, one of the world’s tallest single-drop waterfalls.
|
||||
Known for its dense rainforests, which cover over 80% of the country.
|
||||
The only South American country with English as its official language.
|
||||
@@ -0,0 +1,15 @@
|
||||
|
||||
Haiti:Port-au-Prince
|
||||
The first independent nation in Latin America and the Caribbean, gaining independence in 1804.
|
||||
Famous for its vibrant and unique culture, including Vodou religion.
|
||||
Home to the Citadelle Laferrière, the largest fortress in the Americas.
|
||||
|
||||
Honduras:Tegucigalpa
|
||||
Home to the ancient Mayan ruins of Copán, a UNESCO World Heritage site.
|
||||
One of the largest exporters of bananas and coffee in Central America.
|
||||
Known for its natural beauty, including stunning beaches and tropical rainforests.
|
||||
|
||||
Hungary:Budapest
|
||||
Famous for its historic thermal baths, some dating back to the Roman times.
|
||||
Home to the largest lake in Central Europe, Lake Balaton.
|
||||
Known for its goulash, a traditional Hungarian stew, and paprika spice.
|
||||
@@ -0,0 +1,40 @@
|
||||
|
||||
Iceland:Reykjavik
|
||||
Known for its stunning natural beauty, including geysers, volcanoes, and glaciers.
|
||||
One of the most eco-friendly countries, with most of its energy coming from geothermal and hydropower.
|
||||
Home to the famous Blue Lagoon, a geothermal spa and popular tourist attraction.
|
||||
|
||||
India:New Delhi
|
||||
The second most populous country in the world.
|
||||
Home to the Taj Mahal, one of the New Seven Wonders of the World.
|
||||
Known for its rich cultural diversity, with more than 2,000 distinct ethnic groups.
|
||||
|
||||
Indonesia:Jakarta
|
||||
The world's largest archipelago, made up of over 17,000 islands.
|
||||
Home to the Komodo dragon, the largest living species of lizard.
|
||||
Famous for Bali, one of the world’s top tourist destinations.
|
||||
|
||||
Iran:Tehran
|
||||
Known for its ancient Persian Empire, with historical sites like Persepolis.
|
||||
The world’s largest producer of saffron, also known as "red gold."
|
||||
Home to Mount Damavand, the highest peak in the Middle East.
|
||||
|
||||
Iraq:Baghdad
|
||||
Known as the heart of ancient Mesopotamia, the "Cradle of Civilization."
|
||||
Home to the Ziggurat of Ur, one of the oldest temples in the world.
|
||||
Famous for the Tigris and Euphrates rivers, central to the development of early human civilization.
|
||||
|
||||
Ireland:Dublin
|
||||
Known for its literary heritage, being the home of writers like James Joyce and Oscar Wilde.
|
||||
Famous for its lush green landscapes, earning it the nickname "The Emerald Isle."
|
||||
St. Patrick's Day, celebrated worldwide, originated here.
|
||||
|
||||
Israel:Jerusalem
|
||||
One of the most historically significant cities in the world, sacred to Judaism, Christianity, and Islam.
|
||||
Home to the Dead Sea, the lowest point on Earth’s surface.
|
||||
Known for its high-tech industry, earning it the nickname "Startup Nation."
|
||||
|
||||
Italy:Rome
|
||||
Famous for its ancient history, including landmarks like the Colosseum and the Roman Forum.
|
||||
Home to the Vatican City, the smallest independent state in the world.
|
||||
Renowned for its cuisine, including pizza, pasta, and gelato.
|
||||
@@ -0,0 +1,15 @@
|
||||
|
||||
Jamaica:Kingston
|
||||
Known as the birthplace of reggae music, made famous by Bob Marley.
|
||||
Famous for its beautiful beaches, including Negril and Montego Bay.
|
||||
Home to Usain Bolt, the fastest sprinter in the world.
|
||||
|
||||
Japan:Tokyo
|
||||
Known for its mix of ancient traditions and cutting-edge technology.
|
||||
Home to Mount Fuji, the highest peak in Japan and a symbol of the country.
|
||||
Famous for its cuisine, including sushi, ramen, and tempura.
|
||||
|
||||
Jordan:Amman
|
||||
Home to the ancient city of Petra, one of the New Seven Wonders of the World.
|
||||
The Dead Sea, the lowest point on Earth, is shared with Israel.
|
||||
Known for its Bedouin culture and desert landscapes, including Wadi Rum.
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
Kazakhstan:Astana
|
||||
The largest landlocked country in the world.
|
||||
Home to the Baikonur Cosmodrome, the world’s first and largest spaceport.
|
||||
Known for its vast steppes, which make up a third of the country’s landscape.
|
||||
|
||||
Kenya:Nairobi
|
||||
Known for its wildlife and safaris, particularly in the Maasai Mara.
|
||||
Home to Mount Kenya, the second-highest mountain in Africa.
|
||||
Famous for its long-distance runners, who dominate international competitions.
|
||||
|
||||
Kiribati:Tarawa
|
||||
One of the world’s lowest-lying countries, threatened by rising sea levels.
|
||||
Consists of 33 atolls and reef islands in the Pacific Ocean.
|
||||
Known for its traditional canoe-making and navigation skills.
|
||||
|
||||
Kuwait:Kuwait City
|
||||
One of the richest countries in the world due to its oil reserves.
|
||||
The first Gulf country to establish a constitution and parliament.
|
||||
Famous for the Kuwait Towers, a symbol of the country’s modern development.
|
||||
|
||||
Kyrgyzstan:Bishkek
|
||||
Famous for its nomadic culture and the traditional yurt dwellings.
|
||||
Home to Lake Issyk-Kul, one of the largest alpine lakes in the world.
|
||||
Known for its rugged mountains, making up 90% of the country’s terrain.
|
||||
@@ -0,0 +1,45 @@
|
||||
|
||||
Laos:Vientiane
|
||||
The only landlocked country in Southeast Asia.
|
||||
Famous for its stunning waterfalls, such as Kuang Si Falls.
|
||||
Known for its Buddhist temples, including the golden Pha That Luang.
|
||||
|
||||
Latvia:Riga
|
||||
Known for its stunning Art Nouveau architecture.
|
||||
One of the greenest countries in the world, with over half of its land covered by forests.
|
||||
Famous for its vibrant cultural scene, including the Riga Opera Festival.
|
||||
|
||||
Lebanon:Beirut
|
||||
Known for its rich history, with ancient cities like Byblos and Tyre.
|
||||
Famous for its cuisine, particularly mezze dishes like hummus and tabbouleh.
|
||||
The only Middle Eastern country without a desert.
|
||||
|
||||
Lesotho:Maseru
|
||||
Completely surrounded by South Africa, it’s one of only three enclaved countries in the world.
|
||||
Known as the “Kingdom in the Sky” due to its high altitude.
|
||||
Famous for its Basotho blankets, which are worn by locals during festivals and ceremonies.
|
||||
|
||||
Liberia:Monrovia
|
||||
Founded by freed American slaves in the 19th century.
|
||||
The first African country to elect a female president, Ellen Johnson Sirleaf.
|
||||
Home to the Sapo National Park, one of the last remaining rainforests in West Africa.
|
||||
|
||||
Libya:Tripoli
|
||||
Home to the ancient Roman ruins of Leptis Magna, one of the best-preserved Roman cities in the world.
|
||||
Has the largest proven oil reserves in Africa.
|
||||
Famous for its vast Sahara Desert landscapes, which cover much of the country.
|
||||
|
||||
Liechtenstein:Vaduz
|
||||
One of the world’s smallest countries, nestled between Switzerland and Austria.
|
||||
The only country to be entirely located within the Alps.
|
||||
A constitutional monarchy, ruled by the Liechtenstein family for centuries.
|
||||
|
||||
Lithuania:Vilnius
|
||||
The first Soviet republic to declare independence in 1990.
|
||||
Home to the Hill of Crosses, a famous pilgrimage site with thousands of crosses.
|
||||
Known for its medieval Old Town, a UNESCO World Heritage site.
|
||||
|
||||
Luxembourg:Luxembourg City
|
||||
One of the world’s wealthiest countries, with a high standard of living.
|
||||
A founding member of the European Union, NATO, and the United Nations.
|
||||
Known for its castles, including the fairy-tale-like Vianden Castle.
|
||||
@@ -0,0 +1,85 @@
|
||||
|
||||
Madagascar:Antananarivo
|
||||
Known for its biodiversity, with about 90% of its wildlife found nowhere else on Earth.
|
||||
Home to the famous Avenue of the Baobabs, a road lined with centuries-old trees.
|
||||
The fourth-largest island in the world.
|
||||
|
||||
Malawi:Lilongwe
|
||||
Known as the "Warm Heart of Africa" for its friendly people.
|
||||
Lake Malawi is the third-largest lake in Africa and is home to more fish species than any other lake.
|
||||
A major producer of tea and tobacco.
|
||||
|
||||
Malaysia:Kuala Lumpur
|
||||
Famous for the Petronas Towers, once the tallest buildings in the world.
|
||||
Home to some of the world’s oldest tropical rainforests.
|
||||
A melting pot of cultures, with significant Malay, Chinese, and Indian populations.
|
||||
|
||||
Maldives:Malé
|
||||
An island nation made up of 26 atolls and over 1,000 coral islands.
|
||||
Famous for its luxury resorts and clear blue waters, making it a popular tourist destination.
|
||||
The lowest-lying country in the world, with an average ground level of just 1.5 meters above sea level.
|
||||
|
||||
Mali:Bamako
|
||||
Home to the ancient city of Timbuktu, a UNESCO World Heritage site and historic center of learning.
|
||||
The Niger River, one of Africa's major rivers, flows through the country.
|
||||
Known for its rich musical traditions, influencing genres like blues and jazz.
|
||||
|
||||
Malta:Valletta
|
||||
One of the world’s smallest and most densely populated countries.
|
||||
Famous for its ancient Megalithic Temples, older than Stonehenge and the Pyramids of Giza.
|
||||
A key strategic location in the Mediterranean, controlled by various empires throughout history.
|
||||
|
||||
Marshall Islands:Majuro
|
||||
A group of atolls and islands in the Pacific Ocean, with a population spread over 29 atolls.
|
||||
Known for the Bikini Atoll, where the United States conducted nuclear tests in the mid-20th century.
|
||||
A leader in climate change awareness due to its vulnerability to rising sea levels.
|
||||
|
||||
Mauritania:Nouakchott
|
||||
Home to the ancient desert trading city of Chinguetti, a UNESCO World Heritage site.
|
||||
A large portion of the country is covered by the Sahara Desert.
|
||||
Known for its traditional Moorish culture and nomadic lifestyle.
|
||||
|
||||
Mauritius:Port Louis
|
||||
An island nation in the Indian Ocean, known for its beautiful beaches and coral reefs.
|
||||
Home to the now-extinct dodo bird, which became a symbol of the island.
|
||||
One of the most politically stable and prosperous countries in Africa.
|
||||
|
||||
Mexico:Mexico City
|
||||
Home to ancient civilizations like the Maya and Aztec, with ruins such as Chichen Itza and Teotihuacan.
|
||||
Known for its diverse landscapes, from deserts to jungles and beaches.
|
||||
Famous for its vibrant culture, including mariachi music, tacos, and Day of the Dead celebrations.
|
||||
|
||||
Micronesia:Palikir
|
||||
An island nation in the Pacific Ocean, made up of more than 600 islands.
|
||||
Known for its ancient ruins of Nan Madol, a series of artificial islands.
|
||||
Heavily reliant on financial assistance from the United States under the Compact of Free Association.
|
||||
|
||||
Moldova:Chișinău
|
||||
One of the least-visited countries in Europe.
|
||||
Famous for its wine industry, with some of the largest wine cellars in the world.
|
||||
Known for its rolling hills, monasteries, and traditional folk music.
|
||||
|
||||
Monaco:Monaco
|
||||
The second-smallest country in the world, after Vatican City.
|
||||
Known for its wealth, luxury lifestyle, and the famous Monte Carlo Casino.
|
||||
Hosts the prestigious Monaco Grand Prix, one of the most famous Formula 1 races.
|
||||
|
||||
Mongolia:Ulaanbaatar
|
||||
Known for its vast, rugged expanses and nomadic culture.
|
||||
Home to the Gobi Desert, one of the world’s largest deserts.
|
||||
Once the heart of the Mongol Empire, led by Genghis Khan in the 13th century.
|
||||
|
||||
Montenegro:Podgorica
|
||||
Famous for its stunning Adriatic coastline and medieval towns.
|
||||
Home to the Bay of Kotor, often called Europe’s southernmost fjord.
|
||||
One of the youngest countries in the world, having gained independence in 2006.
|
||||
|
||||
Morocco:Rabat
|
||||
Famous for its imperial cities, including Marrakesh, Fez, and Meknes.
|
||||
The Sahara Desert covers a significant portion of the country’s southeastern region.
|
||||
Known for its rich cultural heritage, blending Arab, Berber, and European influences.
|
||||
|
||||
Mozambique:Maputo
|
||||
Known for its beautiful coastline and marine life, including whale sharks and coral reefs.
|
||||
The Bazaruto Archipelago is one of Africa’s most stunning island chains.
|
||||
Famous for its vibrant music and dance traditions, particularly marrabenta.
|
||||
@@ -0,0 +1,56 @@
|
||||
|
||||
Namibia:Windhoek
|
||||
Home to the Namib Desert, the world’s oldest desert.
|
||||
Known for its diverse wildlife, including elephants, cheetahs, and rhinos.
|
||||
Famous for the towering sand dunes of Sossusvlei, some of the highest in the world.
|
||||
|
||||
Nauru:Yaren
|
||||
The third smallest country in the world by land area.
|
||||
Once one of the richest countries in the world due to phosphate mining.
|
||||
Known for its environmental damage caused by extensive phosphate extraction.
|
||||
|
||||
Nepal:Kathmandu
|
||||
Home to Mount Everest, the world’s highest peak.
|
||||
The birthplace of Siddhartha Gautama, the founder of Buddhism.
|
||||
Known for its diverse landscapes, from the Himalayas to the Terai plains.
|
||||
|
||||
Netherlands:Amsterdam
|
||||
Famous for its canal system, which is a UNESCO World Heritage site.
|
||||
Known for its tulip fields, windmills, and cycling culture.
|
||||
Home to the International Court of Justice in The Hague.
|
||||
|
||||
New Zealand:Wellington
|
||||
Famous for its stunning natural landscapes, including mountains, fjords, and beaches.
|
||||
Home to the indigenous Māori culture and language.
|
||||
Known for being the filming location for "The Lord of the Rings" and "The Hobbit" trilogies.
|
||||
|
||||
Nicaragua:Managua
|
||||
Known for its many volcanoes, lakes, and beaches.
|
||||
The largest country in Central America by land area.
|
||||
Famous for the colonial cities of Granada and León.
|
||||
|
||||
Niger:Niamey
|
||||
Home to part of the Sahara Desert and the Air Mountains.
|
||||
The Niger River, one of the major rivers in West Africa, runs through the country.
|
||||
Known for its rich cultural heritage, particularly the Tuareg and Hausa peoples.
|
||||
|
||||
Nigeria:Abuja
|
||||
The most populous country in Africa, with over 200 million people.
|
||||
One of the world’s largest producers of oil.
|
||||
Famous for Nollywood, the Nigerian film industry, which produces more films than Hollywood.
|
||||
|
||||
North Korea:Pyongyang
|
||||
One of the most secretive and isolated countries in the world.
|
||||
Known for its massive military parades and strict government control.
|
||||
Home to the demilitarized zone (DMZ), the heavily fortified border with South Korea.
|
||||
|
||||
North Macedonia:Skopje
|
||||
Home to the famous Matka Canyon, known for its stunning cliffs and caves.
|
||||
The birthplace of Mother Teresa, born in Skopje in 1910.
|
||||
Known for its rich history, influenced by the Roman, Byzantine, and Ottoman Empires.
|
||||
|
||||
Norway:Oslo
|
||||
Known for its stunning fjords and rugged coastline.
|
||||
Famous for the Northern Lights, which can be seen in the northern parts of the country.
|
||||
Home to the Nobel Peace Prize, awarded annually in Oslo.
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
|
||||
Oman:Muscat
|
||||
Known for its beautiful deserts, mountains, and coastline along the Arabian Sea.
|
||||
Famous for the ancient frankincense trade, with Oman being one of the world’s top producers.
|
||||
Home to historic forts and castles, including Nizwa Fort, one of the oldest in Oman.
|
||||
@@ -0,0 +1,45 @@
|
||||
|
||||
Pakistan:Islamabad
|
||||
Home to the second-highest mountain in the world, K2.
|
||||
The Indus River, one of the longest rivers in the world, flows through the country.
|
||||
Famous for its diverse landscapes, from deserts to forests and mountains.
|
||||
|
||||
Palau:Ngerulmud
|
||||
An island nation in the Pacific Ocean, known for its pristine coral reefs.
|
||||
The Rock Islands, a UNESCO World Heritage site, are a popular tourist destination.
|
||||
One of the world’s leading nations in marine conservation.
|
||||
|
||||
Panama:Panama City
|
||||
Known for the Panama Canal, one of the most important waterways in the world.
|
||||
A major international banking and financial hub.
|
||||
Famous for its biodiversity, with tropical rainforests and over 10,000 plant species.
|
||||
|
||||
Papua New Guinea:Port Moresby
|
||||
One of the most culturally diverse countries in the world, with over 800 languages spoken.
|
||||
Home to the Kokoda Track, a historic World War II site and popular hiking route.
|
||||
Known for its rugged terrain, including mountains, rainforests, and coral reefs.
|
||||
|
||||
Paraguay:Asunción
|
||||
Known as the "Heart of South America" due to its central location on the continent.
|
||||
The Paraguay River divides the country into two distinct regions.
|
||||
Famous for the Guarani culture, with the Guarani language being widely spoken.
|
||||
|
||||
Peru:Lima
|
||||
Home to Machu Picchu, one of the New Seven Wonders of the World.
|
||||
The Amazon Rainforest covers more than 60% of the country.
|
||||
Known for its rich cultural heritage, blending indigenous and Spanish influences.
|
||||
|
||||
Philippines:Manila
|
||||
An archipelago of over 7,000 islands, located in Southeast Asia.
|
||||
Known for its stunning beaches, including Boracay and Palawan.
|
||||
Famous for its biodiversity, with many unique species of plants and animals.
|
||||
|
||||
Poland:Warsaw
|
||||
Known for its medieval architecture and cities like Kraków and Gdańsk.
|
||||
Home to Auschwitz, one of the most infamous concentration camps of World War II.
|
||||
Famous for its hearty cuisine, including pierogi and kielbasa.
|
||||
|
||||
Portugal:Lisbon
|
||||
One of the oldest nations in Europe, with a history of exploration and maritime dominance.
|
||||
Known for its beautiful beaches and the Algarve region.
|
||||
Famous for its Fado music, a genre of melancholic and soulful songs.
|
||||
@@ -0,0 +1,5 @@
|
||||
|
||||
Qatar:Doha
|
||||
One of the richest countries in the world due to its vast natural gas reserves.
|
||||
Home to the futuristic skyline of Doha, which includes many modern skyscrapers.
|
||||
Set to host the FIFA World Cup in 2022, the first Middle Eastern country to do so.
|
||||
@@ -0,0 +1,15 @@
|
||||
|
||||
Romania:Bucharest
|
||||
Home to the world’s heaviest building, the Palace of the Parliament.
|
||||
Famous for its medieval castles, including Bran Castle, often associated with the Dracula legend.
|
||||
The Danube River, Europe’s second-longest river, flows through the country.
|
||||
|
||||
Russia:Moscow
|
||||
The largest country in the world, spanning 11 time zones.
|
||||
Home to the famous Red Square and St. Basil’s Cathedral.
|
||||
Known for the Trans-Siberian Railway, the longest railway line in the world.
|
||||
|
||||
Rwanda:Kigali
|
||||
Known as the "Land of a Thousand Hills" due to its mountainous terrain.
|
||||
Famous for its mountain gorillas, which can be seen in Volcanoes National Park.
|
||||
One of the cleanest and safest countries in Africa, with a ban on plastic bags.
|
||||
@@ -0,0 +1,130 @@
|
||||
|
||||
Saint Kitts and Nevis:Basseterre
|
||||
The smallest country in the Western Hemisphere by both area and population.
|
||||
Known for its beautiful beaches and vibrant tourism industry.
|
||||
Home to the UNESCO-listed Brimstone Hill Fortress, a well-preserved colonial-era fortress.
|
||||
|
||||
Saint Lucia:Castries
|
||||
Famous for the Pitons, two towering volcanic peaks that are a UNESCO World Heritage site.
|
||||
Known for its lush rainforests and stunning beaches.
|
||||
Produces some of the best bananas in the Caribbean.
|
||||
|
||||
Saint Vincent and the Grenadines:Kingstown
|
||||
An archipelago known for its white-sand beaches and crystal-clear waters.
|
||||
One of the world's leading producers of arrowroot, a plant used in cooking and medicine.
|
||||
Famous for the Tobago Cays, a group of small islands popular for snorkeling and sailing.
|
||||
|
||||
Samoa:Apia
|
||||
A Polynesian island nation in the South Pacific, known for its pristine beaches and clear waters.
|
||||
Famous for its traditional tattooing and the fa’a Samoa way of life.
|
||||
Home to Robert Louis Stevenson, the famous author who spent his last years in Samoa.
|
||||
|
||||
San Marino:San Marino
|
||||
The world's oldest republic, founded in 301 AD.
|
||||
One of the smallest countries in the world, completely landlocked by Italy.
|
||||
Known for its medieval architecture, including the Three Towers of San Marino.
|
||||
|
||||
Sao Tome and Principe:São Tomé
|
||||
A small island nation off the coast of West Africa.
|
||||
Famous for its rich biodiversity, including endemic bird species.
|
||||
Once a leading producer of sugar and cocoa, with the nickname "Chocolate Islands."
|
||||
|
||||
Saudi Arabia:Riyadh
|
||||
Home to Islam's two holiest cities, Mecca and Medina.
|
||||
One of the largest oil producers in the world.
|
||||
Known for its vast deserts, including the Rub' al Khali or "Empty Quarter," the largest continuous sand desert in the world.
|
||||
|
||||
Senegal:Dakar
|
||||
Known for its vibrant music scene, especially the popular mbalax genre.
|
||||
Home to Gorée Island, a UNESCO World Heritage site and former center of the transatlantic slave trade.
|
||||
Famous for the Dakar Rally, one of the world’s most challenging off-road races.
|
||||
|
||||
Serbia:Belgrade
|
||||
One of Europe’s oldest cities, with a history dating back to prehistoric times.
|
||||
Famous for its vibrant nightlife, particularly in the floating river clubs along the Danube and Sava rivers.
|
||||
Known for the Kalemegdan Fortress, a historical site that has been fought over in over 100 battles.
|
||||
|
||||
Seychelles:Victoria
|
||||
An archipelago of 115 islands in the Indian Ocean, known for its pristine beaches.
|
||||
Home to two UNESCO World Heritage sites, including the Vallée de Mai Nature Reserve.
|
||||
Famous for the coco de mer, the largest seed in the plant kingdom.
|
||||
|
||||
Sierra Leone:Freetown
|
||||
Known for its beautiful beaches, particularly those along the Freetown Peninsula.
|
||||
Famous for its diamond mining industry, which has been both a blessing and a curse for the country.
|
||||
One of the first countries in Africa to abolish slavery, with Freetown founded as a settlement for freed slaves.
|
||||
|
||||
Singapore:Singapore
|
||||
One of the world’s wealthiest and most technologically advanced countries.
|
||||
Famous for its futuristic skyline, including the Marina Bay Sands and Gardens by the Bay.
|
||||
Known for its cleanliness and strict laws, including a ban on chewing gum.
|
||||
|
||||
Slovakia:Bratislava
|
||||
Known for its medieval castles, including the famous Bratislava Castle overlooking the Danube River.
|
||||
Home to the High Tatras, a mountain range popular for hiking and skiing.
|
||||
A key producer of cars, Slovakia has one of the highest per capita automobile production rates in the world.
|
||||
|
||||
Slovenia:Ljubljana
|
||||
Famous for its picturesque lakes and mountains, including Lake Bled and the Julian Alps.
|
||||
One of Europe’s greenest countries, with over 50% of its land covered by forests.
|
||||
Known for its love of bees, with beekeeping being a significant part of its culture.
|
||||
|
||||
Solomon Islands:Honiara
|
||||
An archipelago of nearly 1,000 islands in the South Pacific.
|
||||
Known for its role in World War II, particularly the Battle of Guadalcanal.
|
||||
Famous for its rich marine biodiversity, making it a popular destination for diving and snorkeling.
|
||||
|
||||
Somalia:Mogadishu
|
||||
Located on the Horn of Africa, with the longest coastline on the continent.
|
||||
Known for its rich cultural heritage, including traditional Somali poetry and music.
|
||||
Has faced decades of civil conflict, but efforts toward rebuilding are ongoing.
|
||||
|
||||
South Africa:Pretoria
|
||||
Known for its diverse landscapes, including mountains, deserts, and savannas.
|
||||
Famous for its wildlife, particularly in Kruger National Park.
|
||||
The country has three capital cities: Pretoria (executive), Bloemfontein (judicial), and Cape Town (legislative).
|
||||
|
||||
South Korea:Seoul
|
||||
One of the most technologically advanced countries in the world, known for its high-speed internet.
|
||||
Home to K-pop, which has become a global cultural phenomenon.
|
||||
Famous for its cuisine, including dishes like kimchi, bulgogi, and bibimbap.
|
||||
|
||||
South Sudan:Juba
|
||||
The youngest country in the world, having gained independence from Sudan in 2011.
|
||||
Rich in oil, which plays a crucial role in the country's economy.
|
||||
Home to vast wetlands and wildlife, including migratory birds and large populations of elephants.
|
||||
|
||||
Spain:Madrid
|
||||
Known for its rich cultural heritage, including flamenco dancing, bullfighting, and tapas.
|
||||
Home to famous landmarks like the Alhambra, the Sagrada Familia, and the Prado Museum.
|
||||
One of the world’s leading producers of olive oil.
|
||||
|
||||
Sri Lanka:Colombo
|
||||
An island nation off the southern coast of India, known for its tea plantations and spice trade.
|
||||
Famous for its wildlife, including elephants, leopards, and blue whales.
|
||||
Home to ancient Buddhist ruins, including the UNESCO World Heritage site Sigiriya.
|
||||
|
||||
Sudan:Khartoum
|
||||
Located at the confluence of the Blue and White Nile rivers.
|
||||
Home to more pyramids than Egypt, particularly in the ancient city of Meroe.
|
||||
One of the largest countries in Africa by land area.
|
||||
|
||||
Suriname:Paramaribo
|
||||
The smallest country in South America by both area and population.
|
||||
A former Dutch colony, with Dutch still spoken as the official language.
|
||||
Famous for its vast rainforests, which cover about 80% of the country.
|
||||
|
||||
Sweden:Stockholm
|
||||
Known for its high standard of living and social welfare programs.
|
||||
Famous for its stunning archipelago, with over 30,000 islands.
|
||||
Home to the Nobel Prize, awarded annually in Stockholm.
|
||||
|
||||
Switzerland:Bern
|
||||
Famous for its neutrality in global conflicts and its banking industry.
|
||||
Home to the Swiss Alps, a popular destination for skiing and mountaineering.
|
||||
Known for its chocolate, watches, and cheese, including fondue and raclette.
|
||||
|
||||
Syria:Damascus
|
||||
One of the oldest continuously inhabited cities in the world.
|
||||
Known for its rich history and cultural landmarks, including the Umayyad Mosque.
|
||||
Has been devastated by a civil war that began in 2011, leading to a humanitarian crisis.
|
||||
@@ -0,0 +1,45 @@
|
||||
|
||||
Tajikistan:Dushanbe
|
||||
Home to the Pamir Mountains, some of the highest in the world.
|
||||
Known for its ancient Silk Road cities and historical sites.
|
||||
Heavily reliant on agriculture, with cotton being a major crop.
|
||||
|
||||
Tanzania:Dodoma
|
||||
Home to Mount Kilimanjaro, the highest peak in Africa.
|
||||
Known for its famous wildlife reserves, including Serengeti National Park.
|
||||
The island of Zanzibar, part of Tanzania, is known for its beautiful beaches and spice production.
|
||||
|
||||
Thailand:Bangkok
|
||||
Known as the "Land of Smiles" due to the friendliness of its people.
|
||||
Famous for its street food, including dishes like pad Thai and green curry.
|
||||
Home to beautiful temples, including Wat Phra Kaew and the Grand Palace.
|
||||
|
||||
Togo:Lomé
|
||||
One of the smallest countries in Africa, but known for its rich cultural diversity.
|
||||
Famous for its traditional voodoo practices, which originated in the region.
|
||||
The country has stunning beaches along the Gulf of Guinea.
|
||||
|
||||
Tonga:Nuku'alofa
|
||||
An archipelago of 169 islands, known for its coral reefs and clear blue waters.
|
||||
The only monarchy in the Pacific Islands.
|
||||
Famous for its traditional Polynesian culture, including the Tongan tapa cloth.
|
||||
|
||||
Trinidad and Tobago:Port of Spain
|
||||
Known for its Carnival, one of the most vibrant and famous in the world.
|
||||
A major producer of oil and natural gas in the Caribbean region.
|
||||
Home to the largest natural asphalt deposit in the world, the Pitch Lake.
|
||||
|
||||
Tunisia:Tunis
|
||||
Famous for its ancient city of Carthage, once a major power in the Mediterranean.
|
||||
Known for its Mediterranean coastline and historic medinas.
|
||||
A key filming location for the Star Wars movies, with its desert landscapes.
|
||||
|
||||
Turkey:Ankara
|
||||
Straddles two continents, with parts of the country in both Europe and Asia.
|
||||
Home to famous landmarks like the Hagia Sophia and the ancient city of Troy.
|
||||
Known for its rich cuisine, including kebabs, baklava, and Turkish coffee.
|
||||
|
||||
Turkmenistan:Ashgabat
|
||||
Home to the "Door to Hell," a burning natural gas crater in the Karakum Desert.
|
||||
One of the most secretive and least-visited countries in the world.
|
||||
Known for its vast reserves of natural gas.
|
||||
@@ -0,0 +1,35 @@
|
||||
|
||||
Uganda:Kampala
|
||||
Home to Lake Victoria, the largest lake in Africa.
|
||||
Known for its mountain gorillas, which can be seen in Bwindi Impenetrable National Park.
|
||||
Referred to as the "Pearl of Africa" due to its stunning landscapes and biodiversity.
|
||||
|
||||
Ukraine:Kyiv
|
||||
Known for its rich cultural history, including its Orthodox churches and monasteries.
|
||||
Home to the Chernobyl Exclusion Zone, site of the 1986 nuclear disaster.
|
||||
One of the largest countries in Europe by land area.
|
||||
|
||||
United Arab Emirates:Abu Dhabi
|
||||
Known for its ultra-modern cities, including Dubai, home to the world’s tallest building, the Burj Khalifa.
|
||||
One of the wealthiest nations in the world, largely due to its oil reserves.
|
||||
Famous for its luxury shopping, futuristic architecture, and vibrant nightlife.
|
||||
|
||||
United Kingdom:London
|
||||
A major global center of finance, culture, and politics.
|
||||
Home to famous landmarks such as Buckingham Palace, Big Ben, and the Tower of London.
|
||||
Made up of four countries: England, Scotland, Wales, and Northern Ireland.
|
||||
|
||||
United States:Washington, D.C.
|
||||
One of the largest and most diverse countries in the world by population.
|
||||
Famous for its cultural influence, including Hollywood, Silicon Valley, and Wall Street.
|
||||
Home to iconic landmarks like the Statue of Liberty, the Grand Canyon, and the White House.
|
||||
|
||||
Uruguay:Montevideo
|
||||
One of the most progressive countries in South America, known for its strong social policies.
|
||||
Famous for its beach-lined coast, particularly the resort town of Punta del Este.
|
||||
The country’s national soccer team has won the FIFA World Cup twice, in 1930 and 1950.
|
||||
|
||||
Uzbekistan:Tashkent
|
||||
Home to ancient Silk Road cities like Samarkand, Bukhara, and Khiva.
|
||||
Famous for its stunning Islamic architecture, including blue-domed mosques and mausoleums.
|
||||
One of the world’s largest producers of cotton.
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
Vanuatu:Port Vila
|
||||
An archipelago of 83 islands in the South Pacific Ocean.
|
||||
Known for its active volcanoes, particularly Mount Yasur on Tanna Island.
|
||||
Famous for being one of the happiest countries in the world, according to the Happy Planet Index.
|
||||
|
||||
Vatican City:Vatican City
|
||||
The smallest country in the world, both in size and population.
|
||||
The spiritual and administrative center of the Roman Catholic Church.
|
||||
Home to St. Peter’s Basilica and the Sistine Chapel, with its famous ceiling painted by Michelangelo.
|
||||
|
||||
Venezuela:Caracas
|
||||
Home to Angel Falls, the world’s tallest uninterrupted waterfall.
|
||||
One of the most biodiverse countries in the world, with habitats ranging from mountains to rainforests.
|
||||
Known for its vast oil reserves, among the largest in the world.
|
||||
|
||||
Vietnam:Hanoi
|
||||
Known for its stunning natural landscapes, including Ha Long Bay, a UNESCO World Heritage site.
|
||||
Famous for its rich history, including the Vietnam War and ancient temples.
|
||||
One of the world’s largest exporters of coffee and rice.
|
||||
@@ -0,0 +1,5 @@
|
||||
|
||||
Yemen:Sana'a
|
||||
One of the oldest centers of civilization in the Middle East, with history dating back over 3,000 years.
|
||||
Home to the ancient skyscraper city of Shibam, a UNESCO World Heritage site.
|
||||
Has been facing a prolonged humanitarian crisis due to ongoing conflict and instability.
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
Zambia:Lusaka
|
||||
Home to Victoria Falls, one of the largest and most famous waterfalls in the world.
|
||||
Known for its national parks and wildlife, including the Big Five game animals.
|
||||
One of the world’s largest producers of copper.
|
||||
|
||||
Zimbabwe:Harare
|
||||
Home to the Great Zimbabwe Ruins, a UNESCO World Heritage site and ancient city.
|
||||
Famous for its diverse wildlife and national parks, including Hwange and Mana Pools.
|
||||
Once known as the "Breadbasket of Africa" due to its fertile lands and agricultural output.
|
||||
@@ -0,0 +1,21 @@
|
||||
Date and Time: 2025-11-14 17:17:48
|
||||
Games Played: 1
|
||||
Correct First Attempts: 0
|
||||
Correct Second Attempts: 0
|
||||
Incorrect Attempts: 10
|
||||
Total Score: 0
|
||||
|
||||
Date and Time: 2025-11-14 17:19:09
|
||||
Games Played: 1
|
||||
Correct First Attempts: 0
|
||||
Correct Second Attempts: 0
|
||||
Incorrect Attempts: 10
|
||||
Total Score: 0
|
||||
|
||||
Date and Time: 2025-11-14 17:21:32
|
||||
Games Played: 1
|
||||
Correct First Attempts: 1
|
||||
Correct Second Attempts: 1
|
||||
Incorrect Attempts: 8
|
||||
Total Score: 3
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package ca.bcit.comp2522.project;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* Country class
|
||||
*
|
||||
* @author Braeden Sowinski
|
||||
* @version 1.0.0
|
||||
*/
|
||||
public class Country
|
||||
{
|
||||
private static final int NUMBER_OF_FACTS = 3;
|
||||
|
||||
private final String name;
|
||||
private final String capitalCityName;
|
||||
private final String[] facts;
|
||||
|
||||
private static void validateString(final String str)
|
||||
{
|
||||
if (str == null || str.isBlank())
|
||||
{
|
||||
throw new IllegalArgumentException("Invalid string");
|
||||
}
|
||||
}
|
||||
|
||||
public Country(
|
||||
final String name,
|
||||
final String capitalCityName,
|
||||
final String[] facts
|
||||
) {
|
||||
validateString(name);
|
||||
validateString(capitalCityName);
|
||||
|
||||
this.name = name;
|
||||
this.capitalCityName = capitalCityName;
|
||||
this.facts = facts;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public String getCapital()
|
||||
{
|
||||
return this.capitalCityName;
|
||||
}
|
||||
|
||||
public String getRandomFact()
|
||||
{
|
||||
final Random rand;
|
||||
|
||||
rand = new Random();
|
||||
|
||||
return this.facts[rand.nextInt(this.facts.length)];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package ca.bcit.comp2522.project;
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
/**
|
||||
* Main program entry to access a games menu
|
||||
*
|
||||
* @author Braeden Sowinski
|
||||
* @version 1.0.0
|
||||
*/
|
||||
public class Main
|
||||
{
|
||||
public static void main(final String[] args)
|
||||
{
|
||||
final Scanner scanner;
|
||||
|
||||
scanner = new Scanner(System.in);
|
||||
|
||||
boolean run = true;
|
||||
|
||||
do {
|
||||
final String input;
|
||||
|
||||
System.out.println("Select a game: ");
|
||||
System.out.println("Word Game (W)");
|
||||
System.out.println("Number Game (N)");
|
||||
System.out.println("My Game (M)");
|
||||
System.out.println("Quit (Q)");
|
||||
System.out.print("> ");
|
||||
|
||||
input = scanner.nextLine().toUpperCase();
|
||||
|
||||
switch (input) {
|
||||
case "W":
|
||||
System.out.println("Word game...");
|
||||
break;
|
||||
case "N":
|
||||
System.out.println("Number game...");
|
||||
break;
|
||||
case "M":
|
||||
System.out.println("My game...");
|
||||
break;
|
||||
case "Q":
|
||||
System.out.println("Quitting...");
|
||||
run = false;
|
||||
break;
|
||||
default:
|
||||
System.out.println("Invalid input: " + input);
|
||||
break;
|
||||
}
|
||||
|
||||
} while (run);
|
||||
|
||||
scanner.close();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package ca.bcit.comp2522.project;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
public class Mines extends Application
|
||||
{
|
||||
@Override
|
||||
public void start(final Stage s)
|
||||
{
|
||||
s.setTitle("MineSweeper Random");
|
||||
s.show();
|
||||
}
|
||||
|
||||
public static void main(final String[] args)
|
||||
{
|
||||
launch(args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package ca.bcit.comp2522.project;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.stage.Stage;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.TextField;
|
||||
|
||||
public class NumberGame extends Application
|
||||
{
|
||||
@Override
|
||||
public void start(final Stage stage)
|
||||
{
|
||||
final VBox layout;
|
||||
final Scene scene;
|
||||
|
||||
layout = createLayout(); // see below
|
||||
scene = new Scene(layout, 300, 200);
|
||||
|
||||
stage.setScene(scene);
|
||||
stage.setTitle("20 Number Challenge");
|
||||
stage.show();
|
||||
}
|
||||
|
||||
private VBox createLayout()
|
||||
{
|
||||
final Label greeting;
|
||||
final TextField textField;
|
||||
final Button button;
|
||||
greeting = new Label("Enter your name:");
|
||||
textField = new TextField();
|
||||
button = new Button("Click me!");
|
||||
button.setOnAction(e -> greeting.setText("Hello, " + textField.getText()
|
||||
+ "!"));
|
||||
// or
|
||||
//button.setOnAction(event -> assignAction(greeting, textField, button));
|
||||
return new VBox(greeting, textField, button);
|
||||
}
|
||||
void assignAction(final Label l, final TextField t, final Button b)
|
||||
{
|
||||
l.setText("Hello, " + t.getText() + "!");
|
||||
}
|
||||
|
||||
public static void main(final String[] args)
|
||||
{
|
||||
launch(args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,196 @@
|
||||
package ca.bcit.comp2522.project;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.FileReader;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Score manager for the word game.
|
||||
*
|
||||
* @author Braeden Sowinski
|
||||
* @version 1.0.0
|
||||
*/
|
||||
public class Score
|
||||
{
|
||||
private static final String DATE_PATTERN = "yyyy-MM-dd HH:mm:ss";
|
||||
private static final int FIRST_GUESS_POINTS = 2;
|
||||
private static final int SECOND_GUESS_POINTS = 1;
|
||||
private static final int SPLIT_VALUE = 1;
|
||||
|
||||
private final String dateTimePlayed;
|
||||
private final int numGamesPlayed;
|
||||
private final int numCorrectFirstAttempt;
|
||||
private final int numCorrectSecondAttempt;
|
||||
private final int numIncorrectTwoAttempts;
|
||||
private final int score;
|
||||
|
||||
public static void appendScoreToFile(
|
||||
final Score score,
|
||||
final String scoreFilePath
|
||||
) {
|
||||
try
|
||||
{
|
||||
final BufferedWriter writer;
|
||||
|
||||
writer = new BufferedWriter(new FileWriter(scoreFilePath, true));
|
||||
|
||||
writer.write(score.toString());
|
||||
writer.newLine();
|
||||
writer.newLine();
|
||||
|
||||
writer.close();
|
||||
}
|
||||
catch (final IOException e)
|
||||
{
|
||||
System.err.println("Failed to write score.txt");
|
||||
}
|
||||
}
|
||||
|
||||
public static List<Score> readScoresFromFile(final String scoreFilePath)
|
||||
{
|
||||
final List<Score> scores;
|
||||
|
||||
scores = new ArrayList<>();
|
||||
|
||||
try
|
||||
{
|
||||
final BufferedReader reader;
|
||||
|
||||
reader = new BufferedReader(new FileReader(scoreFilePath));
|
||||
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null)
|
||||
{
|
||||
|
||||
if (!line.isBlank() && line.contains("Date and Time: "))
|
||||
{
|
||||
final DateTimeFormatter formatter;
|
||||
final String dateTime;
|
||||
final Score score;
|
||||
final String games;
|
||||
final String correctFirst;
|
||||
final String correctSecond;
|
||||
final String incorrect;
|
||||
|
||||
formatter = DateTimeFormatter.ofPattern(DATE_PATTERN);
|
||||
|
||||
dateTime = line.split(": ")[SPLIT_VALUE];
|
||||
System.out.println("debug " + dateTime);
|
||||
games = reader.readLine().split(": ")[SPLIT_VALUE];
|
||||
correctFirst = reader.readLine().split(": ")[SPLIT_VALUE];
|
||||
correctSecond = reader.readLine().split(": ")[SPLIT_VALUE];
|
||||
incorrect = reader.readLine().split(": ")[SPLIT_VALUE];
|
||||
reader.readLine(); // Skip over score line
|
||||
|
||||
score = new Score(
|
||||
LocalDateTime.parse(dateTime, formatter),
|
||||
Integer.parseInt(games),
|
||||
Integer.parseInt(correctFirst),
|
||||
Integer.parseInt(correctSecond),
|
||||
Integer.parseInt(incorrect)
|
||||
);
|
||||
|
||||
scores.add(score);
|
||||
}
|
||||
}
|
||||
|
||||
reader.close();
|
||||
} catch (final IOException e)
|
||||
{
|
||||
System.err.println("Failed to open score log file.");
|
||||
}
|
||||
|
||||
return scores;
|
||||
}
|
||||
|
||||
public static Score getHighScore(final List<Score> scores)
|
||||
{
|
||||
return scores.stream()
|
||||
.min(Comparator.comparingInt(Score::getScore))
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
public static boolean isHighScore(
|
||||
final Score score,
|
||||
final List<Score> scores
|
||||
) {
|
||||
final Score highScore;
|
||||
|
||||
highScore = Score.getHighScore(scores);
|
||||
|
||||
return (highScore == null ||
|
||||
highScore.getScore() < score.getScore());
|
||||
}
|
||||
|
||||
public Score(
|
||||
final LocalDateTime dateTime,
|
||||
final int numGamesPlayed,
|
||||
final int numCorrectFirstAttempt,
|
||||
final int numCorrectSecondAttempt,
|
||||
final int numIncorrectTwoAttempts
|
||||
) {
|
||||
final DateTimeFormatter formatter;
|
||||
|
||||
formatter = DateTimeFormatter.ofPattern(DATE_PATTERN);
|
||||
|
||||
this.dateTimePlayed = dateTime.format(formatter);
|
||||
|
||||
this.numGamesPlayed = numGamesPlayed;
|
||||
this.numCorrectFirstAttempt = numCorrectFirstAttempt;
|
||||
this.numCorrectSecondAttempt = numCorrectSecondAttempt;
|
||||
this.numIncorrectTwoAttempts = numIncorrectTwoAttempts;
|
||||
|
||||
this.score = this.numCorrectFirstAttempt * FIRST_GUESS_POINTS +
|
||||
this.numCorrectSecondAttempt * SECOND_GUESS_POINTS;
|
||||
}
|
||||
|
||||
public String getDateTimePlayed()
|
||||
{
|
||||
return this.dateTimePlayed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
final StringBuilder log;
|
||||
|
||||
log = new StringBuilder();
|
||||
|
||||
log.append("Date and Time: ");
|
||||
log.append(this.dateTimePlayed);
|
||||
log.append("\n");
|
||||
log.append("Games Played: ");
|
||||
log.append(this.numGamesPlayed);
|
||||
log.append("\n");
|
||||
log.append("Correct First Attempts: ");
|
||||
log.append(this.numCorrectFirstAttempt);
|
||||
log.append("\n");
|
||||
log.append("Correct Second Attempts: ");
|
||||
log.append(this.numCorrectSecondAttempt);
|
||||
log.append("\n");
|
||||
log.append("Incorrect Attempts: ");
|
||||
log.append(this.numIncorrectTwoAttempts);
|
||||
log.append("\n");
|
||||
log.append("Total Score: ");
|
||||
log.append(this.score);
|
||||
|
||||
return log.toString();
|
||||
}
|
||||
|
||||
public int getScore()
|
||||
{
|
||||
return this.score;
|
||||
}
|
||||
|
||||
public float calculateAverage()
|
||||
{
|
||||
return (float) this.score / (float) this.numGamesPlayed;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,300 @@
|
||||
package ca.bcit.comp2522.project;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import java.util.Random;
|
||||
import java.util.Scanner;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* @author Braeden Sowinski
|
||||
* @version 1.0.0
|
||||
*/
|
||||
public class World
|
||||
{
|
||||
private static final String SCORE_PATH = "./data/score.txt";
|
||||
private static final int COUNTRY_PARAM = 0;
|
||||
private static final int CAPITAL_PARAM = 1;
|
||||
private static final int NUMBER_OF_FACTS = 3;
|
||||
private static final String BASE_PATH = "./data/facts";
|
||||
private static final int NUMBER_OF_QUESTIONS = 10;
|
||||
private static final int QUESTION_NUM_OFFSET = 1;
|
||||
private static final int QUEST_ASK_CAPITAL = 0;
|
||||
private static final int QUEST_ASK_COUNTRY = 1;
|
||||
private static final int QUEST_ASK_FACT = 2;
|
||||
private static final int QUESTION_TYPES = 3;
|
||||
private static final int MAX_ATTEMPTS = 2;
|
||||
private static final int FIRST_ATTEMPT = 0;
|
||||
private static final int SPLIT_DATE = 0;
|
||||
private static final int SPLIT_TIME = 1;
|
||||
private static final int FIRST_ATTEMPT_SCORE = 0;
|
||||
private static final int SECOND_ATTEMPT_SCORE = 1;
|
||||
private static final int INCORRECT_SCORE = 2;
|
||||
private static final int DEFAULT_SCORE = 0;
|
||||
|
||||
private final Map<String, Country> countries;
|
||||
|
||||
private static Country readCountryData(
|
||||
final String line,
|
||||
final BufferedReader reader
|
||||
)
|
||||
throws IOException
|
||||
{
|
||||
final String countryName;
|
||||
final String countryCapital;
|
||||
final String[] facts;
|
||||
|
||||
countryName = line.split(":")[COUNTRY_PARAM];
|
||||
countryCapital = line.split(":")[CAPITAL_PARAM];
|
||||
|
||||
facts = new String[NUMBER_OF_FACTS];
|
||||
|
||||
for (int i = 0; i < NUMBER_OF_FACTS; i++)
|
||||
{
|
||||
facts[i] = reader.readLine();
|
||||
}
|
||||
|
||||
return new Country(countryName, countryCapital, facts);
|
||||
}
|
||||
|
||||
public World()
|
||||
throws IOException
|
||||
{
|
||||
this.countries = new HashMap<>();
|
||||
|
||||
try (Stream<Path> walk = Files.walk(Paths.get(BASE_PATH)))
|
||||
{
|
||||
List<Path> filesInFolder = walk
|
||||
.filter(Files::isRegularFile)
|
||||
.toList();
|
||||
|
||||
for (final Path file : filesInFolder)
|
||||
{
|
||||
final BufferedReader reader;
|
||||
|
||||
reader = new BufferedReader(new FileReader(file.toString()));
|
||||
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null)
|
||||
{
|
||||
if (line.isBlank())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
final Country country;
|
||||
|
||||
country = readCountryData(line, reader);
|
||||
|
||||
this.countries.put(country.getName(), country);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (final IOException e)
|
||||
{
|
||||
System.err.println("Error accessing the folder: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private void checkAnswer(
|
||||
final String correctAnswer,
|
||||
final Scanner scanner,
|
||||
final int[] scores
|
||||
) {
|
||||
for (int i = 0; i < MAX_ATTEMPTS; i++)
|
||||
{
|
||||
final String answer;
|
||||
|
||||
System.out.print("> ");
|
||||
answer = scanner.nextLine();
|
||||
|
||||
if (answer.equalsIgnoreCase(correctAnswer))
|
||||
{
|
||||
if (i == FIRST_ATTEMPT)
|
||||
{
|
||||
scores[FIRST_ATTEMPT_SCORE]++;
|
||||
}
|
||||
else
|
||||
{
|
||||
scores[SECOND_ATTEMPT_SCORE]++;
|
||||
}
|
||||
|
||||
System.out.println("CORRECT!");
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println("INCORRECT!");
|
||||
}
|
||||
|
||||
scores[INCORRECT_SCORE]++;
|
||||
System.out.printf("The correct answer was %s\n", correctAnswer);
|
||||
}
|
||||
|
||||
private void startTrivia(
|
||||
final Scanner scanner,
|
||||
final int[] scores
|
||||
) {
|
||||
for (int i = 0; i < NUMBER_OF_QUESTIONS; i++)
|
||||
{
|
||||
System.out.printf("Question %d:\n", i + QUESTION_NUM_OFFSET);
|
||||
|
||||
final Random rand;
|
||||
final Country country;
|
||||
final String key;
|
||||
final List<String> keys;
|
||||
final int questionType;
|
||||
|
||||
rand = new Random();
|
||||
|
||||
keys = new ArrayList<>(this.countries.keySet());
|
||||
key = keys.get(rand.nextInt(keys.size()));
|
||||
|
||||
questionType = rand.nextInt(QUESTION_TYPES);
|
||||
country = this.countries.get(key);
|
||||
|
||||
switch (questionType)
|
||||
{
|
||||
case QUEST_ASK_CAPITAL:
|
||||
System.out.println("What is the country of the following capital?");
|
||||
System.out.println(country.getCapital());
|
||||
|
||||
checkAnswer(country.getName(), scanner, scores);
|
||||
break;
|
||||
|
||||
case QUEST_ASK_COUNTRY:
|
||||
System.out.println("What is the capital of the following country?");
|
||||
System.out.println(country.getName());
|
||||
|
||||
checkAnswer(country.getCapital(), scanner, scores);
|
||||
break;
|
||||
|
||||
case QUEST_ASK_FACT:
|
||||
System.out.println("What is the country of the following fact?");
|
||||
System.out.println(country.getRandomFact());
|
||||
|
||||
checkAnswer(country.getName(), scanner, scores);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void runTrivia()
|
||||
{
|
||||
final Scanner scanner;
|
||||
Score score;
|
||||
boolean continuePlaying;
|
||||
|
||||
continuePlaying = true;
|
||||
scanner = new Scanner(System.in);
|
||||
|
||||
final int[] scores;
|
||||
int gamesPlayed;
|
||||
|
||||
scores = new int[]{DEFAULT_SCORE,DEFAULT_SCORE,DEFAULT_SCORE};
|
||||
gamesPlayed = DEFAULT_SCORE;
|
||||
|
||||
do
|
||||
{
|
||||
gamesPlayed++;
|
||||
|
||||
this.startTrivia(scanner, scores);
|
||||
|
||||
score = new Score(
|
||||
LocalDateTime.now(),
|
||||
gamesPlayed,
|
||||
scores[FIRST_ATTEMPT_SCORE],
|
||||
scores[SECOND_ATTEMPT_SCORE],
|
||||
scores[INCORRECT_SCORE]
|
||||
);
|
||||
|
||||
System.out.println(score);
|
||||
|
||||
do
|
||||
{
|
||||
System.out.println("\nDo you want to play again?");
|
||||
System.out.print("> ");
|
||||
|
||||
final String playAgain;
|
||||
playAgain = scanner.nextLine();
|
||||
|
||||
if (playAgain.equalsIgnoreCase("no"))
|
||||
{
|
||||
continuePlaying = false;
|
||||
break;
|
||||
}
|
||||
else if (playAgain.equalsIgnoreCase("yes"))
|
||||
{
|
||||
// break inner do-while loop
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
System.out.printf("Invalid option \"%s\"\n", playAgain);
|
||||
}
|
||||
} while (true);
|
||||
|
||||
} while (continuePlaying);
|
||||
|
||||
scanner.close();
|
||||
|
||||
final List<Score> history;
|
||||
|
||||
history = Score.readScoresFromFile(SCORE_PATH);
|
||||
Score.appendScoreToFile(score, SCORE_PATH);
|
||||
|
||||
if (Score.isHighScore(score, history))
|
||||
{
|
||||
System.out.printf(
|
||||
"CONGRATULATIONS! You have a new high score with an average of %.2f points per game; ",
|
||||
score.calculateAverage()
|
||||
);
|
||||
|
||||
final Score prevHighScore;
|
||||
prevHighScore = Score.getHighScore(history);
|
||||
|
||||
if (prevHighScore == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.printf(
|
||||
"the previous record was %.2f points per game ",
|
||||
prevHighScore.calculateAverage()
|
||||
);
|
||||
|
||||
System.out.printf(
|
||||
"on %s at %s.\n",
|
||||
prevHighScore.getDateTimePlayed().split(" ")[SPLIT_DATE],
|
||||
prevHighScore.getDateTimePlayed().split(" ")[SPLIT_TIME]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static void main(final String[] args)
|
||||
{
|
||||
final World test;
|
||||
|
||||
try
|
||||
{
|
||||
test = new World();
|
||||
}
|
||||
catch (final IOException e)
|
||||
{
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
test.runTrivia();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
package ca.bcit.comp2522.project;
|
||||
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
class ScoreTest {
|
||||
|
||||
private static final String SCORE_FILE = "test_score.txt";
|
||||
private static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
@BeforeEach
|
||||
void setUp() throws IOException {
|
||||
// Clear the score file before each test to ensure no leftover data
|
||||
new FileWriter(SCORE_FILE, false).close();
|
||||
}
|
||||
|
||||
@Test
|
||||
void testScoreCalculation() {
|
||||
// Testing score calculation based on correct first and second attempts
|
||||
Score score = new Score(LocalDateTime.now(), 1, 6, 2, 1); // 6 first attempts (2 points each), 2 second attempts (1 point each)
|
||||
assertEquals(14, score.getScore(), "Score should be 14 points (6 * 2 + 2 * 1)");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testToStringFormat() {
|
||||
// Testing the formatting of the toString() method
|
||||
LocalDateTime dateTime = LocalDateTime.now();
|
||||
Score score = new Score(dateTime, 1, 6, 2, 1);
|
||||
|
||||
String expected = String.format(
|
||||
"Date and Time: %s\nGames Played: 1\nCorrect First Attempts: 6\nCorrect Second Attempts: 2\nIncorrect Attempts: 1\nScore: 14 points\n",
|
||||
dateTime.format(formatter)
|
||||
);
|
||||
|
||||
assertEquals(expected, score.toString(), "The toString format should match the expected format.");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testAppendAndRetrieveLargeNumberOfScores() throws IOException {
|
||||
// Create 25 scores and write them to the file
|
||||
for (int i = 0; i < 25; i++) {
|
||||
Score score = new Score(LocalDateTime.now(), 1, i + 1, (i % 3) + 1, (i % 2) + 1);
|
||||
Score.appendScoreToFile(score, SCORE_FILE);
|
||||
}
|
||||
|
||||
// Read scores from the file
|
||||
List<Score> scores = Score.readScoresFromFile(SCORE_FILE);
|
||||
|
||||
// Validate the number of scores and their content
|
||||
assertEquals(25, scores.size(), "Twenty-five scores should have been read from the file.");
|
||||
for (int i = 0; i < 25; i++) {
|
||||
int expectedScore = ((i + 1) * 2) + ((i % 3) + 1);
|
||||
assertEquals(expectedScore, scores.get(i).getScore(), "Score for entry " + i + " should match the calculated value.");
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void testCheckForNewHighScore() throws IOException {
|
||||
// Create some initial scores and add them to the file
|
||||
Score score1 = new Score(LocalDateTime.now(), 1, 6, 2, 1); // 14 points
|
||||
Score score2 = new Score(LocalDateTime.now(), 1, 9, 1, 0); // 19 points
|
||||
Score.appendScoreToFile(score1, SCORE_FILE);
|
||||
Score.appendScoreToFile(score2, SCORE_FILE);
|
||||
|
||||
// Add a new score that is NOT a high score
|
||||
Score score3 = new Score(LocalDateTime.now(), 1, 7, 2, 1); // 16 points
|
||||
Score.appendScoreToFile(score3, SCORE_FILE);
|
||||
|
||||
// Read scores from the file
|
||||
List<Score> scores = Score.readScoresFromFile(SCORE_FILE);
|
||||
|
||||
// Verify the highest score is still 19
|
||||
int highScore = scores.stream().mapToInt(Score::getScore).max().orElse(0);
|
||||
assertEquals(19, highScore, "The highest score should still be 19 points.");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testNewHighScore() throws IOException {
|
||||
// Create some initial scores and add them to the file
|
||||
Score score1 = new Score(LocalDateTime.now(), 1, 6, 2, 1); // 14 points
|
||||
Score score2 = new Score(LocalDateTime.now(), 1, 9, 1, 0); // 19 points
|
||||
Score.appendScoreToFile(score1, SCORE_FILE);
|
||||
Score.appendScoreToFile(score2, SCORE_FILE);
|
||||
|
||||
// Add a new score that IS a high score
|
||||
Score score3 = new Score(LocalDateTime.now(), 1, 10, 1, 0); // 21 points
|
||||
Score.appendScoreToFile(score3, SCORE_FILE);
|
||||
|
||||
// Read scores from the file
|
||||
List<Score> scores = Score.readScoresFromFile(SCORE_FILE);
|
||||
|
||||
// Verify the highest score is now 21
|
||||
int highScore = scores.stream().mapToInt(Score::getScore).max().orElse(0);
|
||||
assertEquals(21, highScore, "The highest score should now be 21 points.");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testAppendAndCheckMultipleReads() throws IOException {
|
||||
// Create initial scores and add them to the file
|
||||
for (int i = 0; i < 5; i++) {
|
||||
Score score = new Score(LocalDateTime.now(), 1, 5 + i, 1, 1); // Variable scores
|
||||
Score.appendScoreToFile(score, SCORE_FILE);
|
||||
}
|
||||
|
||||
// Perform the first read
|
||||
List<Score> scores1 = Score.readScoresFromFile(SCORE_FILE);
|
||||
assertEquals(5, scores1.size(), "There should be 5 scores after the first write and read.");
|
||||
|
||||
// Add more scores to the file
|
||||
for (int i = 5; i < 10; i++) {
|
||||
Score score = new Score(LocalDateTime.now(), 1, 5 + i, 1, 1); // Variable scores
|
||||
Score.appendScoreToFile(score, SCORE_FILE);
|
||||
}
|
||||
|
||||
// Perform the second read
|
||||
List<Score> scores2 = Score.readScoresFromFile(SCORE_FILE);
|
||||
assertEquals(10, scores2.size(), "There should be 10 scores after the second write and read.");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testEmptyScoreFile() throws IOException {
|
||||
// Test reading from an empty score file, should return an empty list
|
||||
List<Score> scores = Score.readScoresFromFile(SCORE_FILE);
|
||||
assertTrue(scores.isEmpty(), "Reading from an empty file should return an empty list.");
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
void tearDown() {
|
||||
// Clean up by deleting the test score file after each test
|
||||
new File(SCORE_FILE).delete();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user