Skip to content

A Python script to run an image contest on a Microbit board

License

Notifications You must be signed in to change notification settings

violincase13/Image-Contest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Image-Contest

A Python script to run an image contest on a Microbit board

Firstly, I created all the necessary variables that will be used later, such as the names of the participants, the names of each section and the names of the images in each category. These have been stored in lists so they can be easily used later.

The next step was to create a function called displayTheSections. It works on the following principle: the content of the category list is retrieved and scrolled with an index (in this case, sectionListIndex). Thus, each category of game images is displayed. For each category, if the player clicks on the logo, it will display its corresponding participants. The display procedure is exactly as described above, except that the variables differ depending on the specifics of the category. To select a participant's name, the player must click on the logo again. Subsequently, the images corresponding to this category will be displayed via a function (for Animals - displayAnimalSectionImages; for Geometric - displayGeometricSectionImages; for Emotions - displayEmotionSectionImages).

The previously mentioned functions also display the images by implementing the procedure of navigating through a specific list using a specific index. What also differs is that when the player clicks on the logo to select the image, a function is called to allow the score to be set and the respective image to be stored in a list for final display.

As appropriate, these functions are called displayTheAnimalScoreAndBonusValues, displayTheGeometricScoreAndBonusValues, and displayTheEmotionScoreAndBonusValues. Their mode of operation consists in the fact that for each type of image selected two variables are affected: score and bonus (for example: duckScore, duckBonus). The value of the Score variable is greater than 0 and less than or equal to 5 and can be frozen if the player presses button A or decremented if the player presses button B. In order to permanently assign this image to this participant, the user must select the logo. The previous image display process will resume, only the already selected image will no longer be displayed. This is possible thanks to an imposed condition (for example: animalSectionListIndex other than 0, ...). The user can select a maximum of 3 images. This was done at the implementation level, provided that the number of selected images is less than or equal to 3. (eg: len (geometricSectionSelectedImagesList) <= 3). After having selected the 3 images, the function corresponding to the display of the images of the following category is called.

After having selected the 3 images, the function corresponding to the display of the images of the following category is called (displayTheFinalStatistics). This, for each participant of each category, will display the images selected accordingly by the player/user. The implementation is analogous to the previous cases of scrolling the corresponding lists.

About

A Python script to run an image contest on a Microbit board

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages