SoniaBarasa / country-capital-quiz-game

This repository is for general learning purposes. Aim is to learn conventional way to write a python code.
1 stars 2 forks source link

Avoid repeated countries in the same playing round #10

Closed ahernank closed 1 year ago

ahernank commented 1 year ago

Currently, there is a risk of being asked for the capital of the same country more than once during a round. This is not ideal, as if you know the answer you will be rewarded twice and if you don't you will be disadvantaged!

There are multiple possible solutions here. For example, you could ask the players how many rounds they would like to play before the game starts, then, generate the list of countries you will be using, check if there are any repeated ones, and if yes, re-generate the list. Another alternative is to reflect more on how the choice of country is being made by random.choice( ) and whether we would want to ensure that the countries are being sampled and not replaced in your dictionary when doing so (i.e. sampling without replacement).

SoniaBarasa commented 1 year ago

@ahernank thank you for pointing this out. I will look into it.