Overview
Comment: | Fix bug that prevented tracking fuzzy die |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
7a0a5badfae76fa40c4c209269a8b15d |
User & Date: | joel on 2018-11-22 04:04:50 |
Other Links: | manifest | tags |
Context
2018-11-22
| ||
04:05 | Evolve dashboard display check-in: 3270d1 user: joel tags: trunk | |
04:04 | Fix bug that prevented tracking fuzzy die check-in: 7a0a5b user: joel tags: trunk | |
03:07 | Ensure team is properly credited when a player has to finish up after round ends check-in: d96413 user: joel tags: trunk | |
Changes
Modified bunco.py from [15d7f1] to [bdb21a].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | + + - - | # Test import csv, random, sqlite3 teammate_lookup = { 0: 2, 1: 3, 2: 0, 3: 1 } fuzzydie_holder = 'x' def TurnInProgress(): return -1 def roll_dice(): dice = [] for _ in range(3): dice.append(random.randint(1,6)) return dice class Player: |
︙ | |||
75 76 77 78 79 80 81 82 83 | 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | + - + | else: self.current_streak = 0 log_roll(self, self.current_roll, roll_score) return roll_score def tick(self): global fuzzydie_holder result = TurnInProgress() |
︙ | |||
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 | 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 | + - + + - + - - - + + + - + | cur_round = 1 def __init__(self, playerfile): self.players = load_players(playerfile) self.tables = assign_teams(self.players) def tick(self): global fuzzydie_holder for table in self.tables: table.tick() bunco_rollers = [p for p in self.players if p.rolled_bunco is True] # If multiple people rolled Bunco this tick, and one of them already has the # fuzzy die, they retain it. # Otherwise, the last person in the list gets the fuzzy die. if bunco_rollers: if len(bunco_rollers) == 1: |
︙ |