Hi I have an assignment due Saturday in scratch and I'm having trouble with it. Any help would be appreciated. Here it is
In this assignment you will be writing programs to manage tables containing league standings in a football league. These are similar to the league tables you see in the paper all the time for the CIS, CFL, NFL, and other leagues.
The table will be stored in 6 lists:
a list with the team names
a list with the number of wins for each team
a list with the number of losses for each team
a list with the total number of points scored for each team
a list with the total number of points scored against each team
a list with the total number of points earned in the standings (2 points for each win)
These lists correspond to one another in the sense that the data for team i will be the i-th element of each list. For example, if Layabouts is the third element of the team names list, their number of wins will be the third element of the number of wins list, their number of losses the third element of the number of losses list, and so on across all of the lists.
For the assignment you are to write scripts as described below.
Part 1 – Getting Scores into the Table
First, initialize the lists above, entering your team names in the first list, and 0’s for all the elements of the other lists. Your next task is to write a script to enter scores into the table. This will be done by a script attached to a sprite representing the league statistician. When the sprite is clicked, the user is asked for a new score. This is entered as a string such as “Layabouts 23 Luddites 14”. The winning team and score will always come first, then the losing team and score. You can assume that the names and scores will be separated by exactly one blank character, and that there will be no blank at the end or beginning of the string. When presented with this string, the script must
add 1 to the Layabouts number of wins
add 1 to the Luddites number of losses
add 23 to the Layabouts total number of points scored for
add 23 to the Luddites total number of points scored against
add 14 to the Layabouts total number of points scored against
add 14 to the Luddites total number of points scored for
add 2 to the Layabouts total number of points earned
You may want to create helper scripts to do things like breaking out the next word from a string, and/or to find the position of a team in the table and/or to help you initialize the table. [60 marks]
Part 2 – Getting Information Out of the Table
Each team will have its own sprite (hopefully one appropriate to the team name) that, when clicked, will find out information about that team from the table. The sprite will provide two kinds of information:
the team’s ranking, 1st, 2nd, 3rd, etc., in terms of number of points in the standings [15 marks]
how many points behind the leader the team is (this will be 0 if the team is in first place) [15 marks]
The sprite should say this information in a speech bubble.
You should test your scripts in both Part 1 and Part 2 on a league with at least 4 teams. Use your imagination in the design of the team names, and the look and feel of the sprites and the stage. Add comments to your scripts to label the important steps and to explain what each script is meant to do. [10 marks]
Extension – Allowing More Flexible Input
What if the score did not get entered as strictly as indicated above? That is, there could be blanks at the beginning and end of the string and more than one blank between words in the string? What if the winning team and score was sometimes put after the losing team and score? Expand the script(s) in part 1 to handle these cases. [5 marks]
Hand in the entire assignment as one Scratch project.
Like I said, any help would be nice if someone could send me a pic of the script or give me any details I would appreciate it, Thank you.
Offline
Try looking at the scratch wiki, you can find almost anything there!
Offline