A “Flair” of Uno!
About a year ago, during the February half term in 2020, I took on the challenge of trying to code a working game of Uno using Python Programming. After using the full week of...
Filter by Category
Filter by Author
About a year ago, during the February half term in 2020, I took on the challenge of trying to code a working game of Uno using Python Programming. After using the full week of...
Posted by Amita Vaghela
Science week this year had its own set of challenges and like learning at BMS has gone online this year. Students this year had a wide range of activities to complete at home...
Posted by William Thornton
I am pleased to announce the results of the annual House Arts Event. The theme for this year was Vision and we received a huge range of entries from poetry to photography. This...
Posted by Matthew O'Kelly
As the students return to school it provides me with an opportunity to highlight the hard work and effort that everyone has put in over these uncertain times. We have been...
Posted by Aaron Mitchell
Since January, Year 9 has been working on ‘Project Festival’ in textiles! They have been tasked with researching and designing a product that could be used or worn at a Festival....
Posted by Niralee Pattni
Please find below this week’s Student of the Week to go in with a photo We are very proud of our students at Bushey Meads and we are delighted to recognise hard work in all...
Posted by Helen Blowers
Zeal Rathod – Year 12 Maple Zeal is one of our fantastic Senior Prefects. Whilst working extremely hard with her studies Zeal ensures that she carries out her duties too....
Posted by Des Timotheou
Attending and reviewing an arts event is a vital part of our Arts Award course. This would normally mean going to an art gallery or a theatre show but as you can imagine, we have...
Posted by Hannah Smart
Mrs Hanbury’s Year 10 food students had a real culinary treat last week when they had an online visit from the Ming-Ai (London) Institute. Two healthy eating Chinese ambassadors...
Posted by Alison Hanbury
William Shakespeare’s Play of the Month – Othello Othello is one of the most powerful of Shakespeare’s tragedies. An intense drama of love, deception and destruction,...
Posted by Natalie Stanton
About a year ago, during the February half term in 2020, I took on the challenge of trying to code a working game of Uno using Python Programming. After using the full week of half term to code, I was able to complete this challenge and am quite proud of my achievement.
I first decided to try and code this program after an extension challenge during one of my lessons; to create a list of cards in an Uno deck using lists and loops. I completed this in class, and then I thought about how hard it would be to create the full game using Python Programming. Of course, I knew I wouldn’t be able to make a program that allows multiple people to play at once, like the real game of Uno, but I wanted to see how far I could go.
My first step was to move on from what I did in class, and try to generate random cards from the array I created. This wasn’t too hard to do, but my next step would be to save the cards in separate lists for 2 different players. Once I was able to do this, I made it so the player would be able to draw cards, and later on, play cards from their hand. After this was done, it would be possible to play the game of Uno by yourself, only getting rid of your own cards not having to worry about another player. This was boring tho, so my next challenge would be the hardest bit of programming I had done at that point, which would be to make the computer play against the player.
The basic idea of how I aimed to do this was by having a separate list of cards that contained the cards the computer could play when it was its turn, and then just choose randomly. This was easier said than done, but once completed the Uno game was pretty much completed. Adding the special cards like +2s and +4s was another challenge, but one I was able to overcome. Below is an example game that could be played, so you could see how it would play out.
However, I felt like it was missing something, and after some encouragement from my parents I worked on trying to add pictures to make it look more like Uno. I don’t know of a way to do this in regular Python, but there is a downloadable library of code (an extension to Python) that allows you to, which is called Pygame Zero. I had done some experimenting before this, and so decided to give it a try. The coding was quite a bit harder, as the game now needed to revolve around the player clicking the right cards rather than typing. Also, I needed to use images, so after spending a decent amount of time finding and cropping the card images, I had to add them to the code.
This took me the full half term to complete, with coding being the main activity I did for those few days. I got to a point where I was happy to leave it as it is, but it could still be improved. I was not able to get the “wild cards” to work in the new version, but over the last year there have been small adjustments I’ve tried to make to make it a bit better, and below you will find what the program actually looks like when it’s running.
If you’re still reading this, thank you. If you have Python yourself, here’s the link to a google doc that has the text-based version I made, which you should be able to copy and paste into a new Python file to play yourself if you are interested:
Python Programming Challenge 7.2 – Uno (text based)
Thanks again for reading! Happy Programming!
By Yehen Singankutta Arachchilage
Three of our Maths Student Leaders had the privileged experience of joining in with the first part of the Maths Faculty Meeting on Wednesday 25th March 2021. Coinciding with our...
Here at E-Club we try to apply our technical skills and our understanding of computers to help us answer different questions which use problem-solving skills and forces us to use...