I'm a beginner so this might be very dumb. I think I've finally understood the logic behind how a game is simulated and i still don't know how to do it in swift code . I use the offensive ability of a team and translate that to goals for based on, in this case, the NHL stats on about how much good offenses score vs bad offenses and do the same for goals against. multiply the offense of team one with team twos defense and vice versa. and then square root the two and you should get the average number of goals expected from the teams in a matchup. How do I do this in swift code? how do I make a number where there is supposed to be an average but the number should still be kind of random?
and then there is the player part. how do i have so that it is a certain player that scores the goal? And make it so that players with higher stats score more goals. because I just averaged the offensive abilities of all the players and defensive abilities of all the players to make the team abilities. can I incorporate a player stats in a system like this or do I need to use a different kind of simulation? also any new simulation styles ideas are welcomed.
thanks in advance!!!!!