This challenge is based on a 4×4 grid of dice (16 dice in total). Each game starts by shaking the grid to generate a new grid of 16 values.

All dice are 6-sided dice, generating random values between 1 and 6 when the grid is shaken. The grid can be simplified by showing the actual dice values:

Once the new grid is set, its score can be calculated by identifying specific patterns as follows:
- Start with a score of 0,
- If all four corners are even numbers, add 20 pts to the score,
- If all four corners are odd numbers, add 20 pts to the score,
- If all four dice on a diagonal are even numbers, add 20 pts to the score,
- If all four dice on a diagonal are odd numbers, add 20 pts to the score,
- If all four dice on on any row are even numbers, add 20 pts to the score,
- If all four dice on on any row are odd numbers, add 20 pts to the score,
- If all four dice on on any column are even numbers, add 20 pts to the score,
- If all four dice on on any column are odd numbers, add 20 pts to the score,
- Add to the score the total value (sum) of all 16 dice.
So for example, with the above grid, we can calculate the score of the grid as follows:

Python Implementation
To help you with this challenge we have started the code for you by creating 4 functions to:
- Generate/shake the grid of 16 dice.
- Display the 4×4 grid on screen.
- Check if a number is even.
- Check if a number is odd.
We have also implemented the first section of the scoring algorithm, by initialising the grid score to 0 and by checking if all four corners are even. If so the score is increased by 20pts.
Your task is to complete the following code to implement the full scoring algorithm using the 10 rules mentioned above.

Solution...
The solution for this challenge is available to full members!Find out how to become a member:
➤ Members' Area





















A barcode is a visual representation of data that can easily be read by an optical barcode scanner/reader. Barcodes are used to facilitate and speed up the identification of different types of products. Using a barcode reader speed up the input/data entry process and and is a more reliable method generating less data entry errors than when a product code is entered manually.




Source: NASA/JPL-Caltech



On February 18, 2020, NASA’s rover called “Perseverance” successfully landed on Mars. The mission of this high-tech 6-wheel rover is to explore the surrounding areas, analyse the Martian soil on different locations, take high definition pictures as well as audio recordings. The ultimate hope for NASA is that this rover may find evidence that there was once a form of life on planet Mars. You can read more about this rover on the 










