Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def scan_threats(crew, scant, deck):
- """
- loops through the 'crew' array to get the number of sixes.
- If 'scant' plus that number is less than 3 the variable 'scant'
- is updated; If it is equal to or greater than 3, it calculates
- the module of that value between 3 and saves it in 'scant'
- and draws a new threat card [new_threat()].
- It will have to do this as many times as the integer part
- indicates by dividing the number of scanners by 3
- Parameters
- ----------
- crew : array
- Result of the dice roll.
- scant : int
- Number of busy scanners. Value between 0 and 2.
- Returns
- -------
- scant : int
- Updated number of busy scanners. Value between 0 and 2.
- """
- # 'n6' will store the number of sixes in 'crew'
- n6 = 0
- for i in crew:
- if i == 6:
- n6 += 1
- # The number of scanners is updated
- scant = scant + n6
- # If 'scant' is equal to or greater than 3,
- # I draw as many threat cards as groups of 3
- # have been obtained and I update scant
- # with the rest of the division
- if scant >= 3:
- rango = scant // 3
- for n in range(rango):
- new_threat(deck)
- scant = scant % 3
- return scant
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement