Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (* Get list of teams. Not perfect, requires some manual cleanup.
- Manually put in "teams" list. *)
- Import["https://oc.tc/forums/topics/50f8bef0f34422ef2e0000bf", "Data"];
- teams = {};
- (* Get data and compute averages. Store in "stats" list. *)
- stats = {};
- Do[
- kdList = {};
- kkList = {};
- odList = {};
- Do[
- url1 = teams[[i, 2, j]];
- str1 = Import["https://oc.tc/" <> url1, "Plaintext"];
- list1 = StringSplit[str1];
- deathspos = Position[list1, "deaths"];
- kdpos = Position[list1, "kd"];
- kkpos = Position[list1, "kk"];
- corespos = Position[list1, "cores"];
- woolspos = Position[list1, "wools"];
- deaths = list1[[deathspos[[1, 1]] - 1]] // ToExpression;
- kd = list1[[kdpos[[1, 1]] - 1]] // ToExpression;
- kk = list1[[kkpos[[1, 1]] - 1]] // ToExpression;
- wools = list1[[woolspos[[1, 1]] - 1]] // ToExpression;
- cores = list1[[corespos[[1, 1]] - 1]] // ToExpression;
- objectives = wools + cores;
- od = N[objectives/deaths];
- AppendTo[kdList, kd];
- AppendTo[kkList, kk];
- AppendTo[odList, od];
- Print[PaddedForm[teams[[i, 2, j]], 25], " ",
- NumberForm[kd, {4, 2}], " ", NumberForm[kk, {4, 2}], " ",
- NumberForm[od, {6, 4}]];
- , {j, Length[teams[[i, 2]]]}];
- AppendTo[stats, {teams[[i, 1]], Mean[kdList], Mean[kkList], Mean[odList]}];
- Print[stats[[i]]];
- ,{i, Length[teams]}];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement