Wednesday 25 July 2018

Football Challenge With Python

Today in class I completed the football challenge using Python. The task is to make a soccer pitch including positions appear by manipulating the coding to make a full 11 man squad appear when it is supposed to. This will help us to understand subroutines/procedures which are used in Python to create sections of code that can be reused multiple times. To create one of the dots you have to insert a code. This code looks like this. drawPlayer(color,x,y,label). To simplify, you insert drawPlayer on a line. Start a bracket after it with no space (no spaces are needed at all), choose a colour (any) and put in after the bracket. Add a coma and and put an x coordinate in. Add a coma and put a y coordinate in. Finally put yet another coma in and put a name in after. Repeat this process over and over until you have made a full 11 man squad.