Hi everyone,
I'm making a soccer match simulator where each player has a unique attribute (or skill) which is a value between 1 and 20. A player can play as a goalkeeper, a defender, a midlfielder or a forward. In my program, at some moment, there's a battle between a player from the attacking team and the goalkeeper from the defending team. The result of this battle determines if a goal is scored or not. But, first of all, I need to compute which player from the attacking team is going to shot on goal. So, I would like to have some advise about the way to select the player who's going to take the shot. I've already thought about a weighted random generator where each player gets a weight depending on its position on the field but there're maybe other solutions.