Skip to main content
11 events
when toggle format what by license comment
Feb 25, 2020 at 20:54 history edited MikeY CC BY-SA 4.0
edited body
Feb 25, 2020 at 20:53 comment added MikeY Thanks! I've gotten burned with a Random[ ] on the right side of a rule, so knew it could be important. Fixed my entry.
Feb 25, 2020 at 20:43 comment added Mr.Wizard It is a matter of good programming practice. Using -> instead of :> will evaluate any global assignments to the pattern names on the right hand side. Try for example defining tas = 7 before the rest of your code. Where you don't need this behavior it is best to use :> instead. (by the way: good answer and +1)
Feb 25, 2020 at 20:35 comment added MikeY Where would not using :> blow up on me? I tried both and got the same answer...not sure.
Feb 25, 2020 at 20:08 comment added Mr.Wizard You should be using RuleDelayed in your definition of patt to properly localize Symbols.
Feb 25, 2020 at 18:12 comment added Nate MikeY, perfect for home/away, thank you! And from the way to built the rank also, the matrix representation is that I thougth! The only way is that I should need it after the first round, then after the second, then after the third and so on, because I should insert it in a iterative For or Do cicle to derive forecast. I guess that res3` is just for the final rank.. should I change res3 in: res3 =Flatten@{First@First@#, Rest[Total[#]**[[i]]]**} & /@ res2?
Feb 25, 2020 at 18:07 vote accept Nate
Feb 25, 2020 at 17:51 comment added MikeY @Mick, I updated the answer to include the number of home and away games. Still not sure I am following on the vector aspect.
Feb 25, 2020 at 17:50 history edited MikeY CC BY-SA 4.0
added 289 characters in body
Feb 25, 2020 at 17:39 comment added Nate Thank you MikeY, unfortunately this is not what I looked for. I should need "home" and "away" which are, respectively, the number of the matches played by each team at home and away. I tried to change patt in: patt = {h_, ths_, thc_, a_, tas_, tac_} -> {{h, ths, thc, 0, 0, 0}, {0, 0, 0, a, tas, tas}} but it doesn't work. Moreover, I should build an above-mentioned rank matrix as it was an iterator where each round rank is the sum of it and the previous ones, in order to derive other parameters from it, put in forecast and then comparising results and forecast for each round
Feb 24, 2020 at 17:39 history answered MikeY CC BY-SA 4.0