rounds done
authorMart Lubbers <mart.lubbers@mpi.nl>
Thu, 4 Jun 2015 11:37:43 +0000 (13:37 +0200)
committerMart Lubbers <mart.lubbers@mpi.nl>
Thu, 4 Jun 2015 11:37:43 +0000 (13:37 +0200)
src/SoccerFun.prj
src/StdTeam/Team_Student_Rounds_Assignment.icl [changed mode: 0644->0755]

index c1e0db6..daf6db4 100755 (executable)
@@ -1,7 +1,7 @@
 Version: 1.4\r
 Global\r
        ProjectRoot:    .\r
-       Built:  True\r
+       Built:  False\r
        Target: SoccerFun64\r
        Exec:   {Project}\SoccerFun.exe\r
        CodeGen\r
old mode 100644 (file)
new mode 100755 (executable)
index e10bc7f..a68889c
@@ -8,6 +8,7 @@ implementation module Team_Student_Rounds_Assignment
        Do not change the implementation of base_TeamName_Student_Rounds.\r
 */\r
 import Footballer\r
+import FootballerFunctions\r
 \r
 Team_Student_Rounds :: !Home !FootballField -> Team\r
 Team_Student_Rounds home field         = if (home == West) team (mirror field team)\r
@@ -18,14 +19,18 @@ where
                                                                          ]\r
        club                                                    = base_TeamName_Student_Rounds +++ if (home==West) "_W" "_E"\r
        positions                                               = [(-0.49,0.00)]\r
-       footballer playerID                             = {defaultFootballer playerID &\r
-               name = "Peter88",\r
-               brain = {memory = Void, ai = mind}}\r
+       footballer playerID                             = {defaultFootballer playerID & name = "Peter88", brain = {memory = Void, ai = mind field}}\r
 \r
 base_TeamName_Student_Rounds :: String\r
 base_TeamName_Student_Rounds = "Student Rounds"\r
 \r
-:: Memory :== Void\r
-\r
-mind :: !(!BrainInput, !Memory) -> (!BrainOutput, !Memory)\r
-mind ({football, others, me}, memory) = (Move  zero zero)\r
+mind :: !FootballField !(!BrainInput, !Void) -> (!BrainOutput, !Void)\r
+mind field (i=:{me}, mm)\r
+| y >= (t -o) && x > (~r+o) = (fix {px= ~r,py= t}  c) (i, mm)\r
+| x <= (~r+o) && y > (~t+o) = (fix {px= ~r,py= ~t} c) (i, mm)\r
+| y <= (~t+o) && x < (r -o) = (fix {px= r, py= ~t} c) (i, mm)\r
+| x >= (r -o) && y < (t -o) = (fix {px= r, py= t}  c) (i, mm)\r
+       where\r
+               (x, y, o, c) = (me.pos.px, me.pos.py, m 4.0, m 1.5)\r
+               t = scale 0.5 field.fwidth\r
+               r = scale 0.5 field.flength
\ No newline at end of file