outline and randomness. Afterfix now tackles if necessary
[fp1415-soccerfun.git] / src / StdTeam / Team_Student_Passing_Assignment.icl
1 implementation module Team_Student_Passing_Assignment
2
3 /** Implement a solution to the passing assignment.
4
5 Your team consists of six players, with player's numbers 2 upto 7.
6 Below you should only change the definition of footballer to your solution.
7 Do not change the positions, player identifications, nor noses.
8 Do not change the implementation of base_TeamName_Student_Passing.
9 */
10
11 import Footballer
12
13 Team_Student_Passing :: !Home FootballField -> Team
14 Team_Student_Passing home field = if (home == West) team (mirror field team)
15 where
16 team = [ {footballer {clubName=club,playerNr=nr} & pos = toPosition (scale (0.5*x) field.flength,scale (0.5*y) field.fwidth),nose = rad (dir*pi)}
17 \\ (x,y) <- positions
18 & nr <- [2..]
19 & dir <- noses
20 ]
21 club = base_TeamName_Student_Passing +++ if (home==West) "_W" "_E"
22 positions = [(-0.43, 0.00)
23 ,(-0.35, 0.30)
24 ,( 0.00,-0.10)
25 ,( 0.15, 0.20)
26 ,( 0.32, 0.10)
27 ,( 0.43,-0.05)
28 ]
29 noses = [1.8,0.0,1.5,0.5,1.2,0.2]
30 footballer playerID = defaultFootballer playerID // implement your footballer here
31
32 base_TeamName_Student_Passing :: String
33 base_TeamName_Student_Passing = "Student Passing"