Overview
| Comment: | Refine separation of roll/read turn phases; fix scoring of unread rolls at end of round |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
5b68c775743655cc1fd2d19811ff6e95 |
| User & Date: | joel on 2018-11-20 04:06:01 |
| Other Links: | manifest | tags |
Context
|
2018-11-20
| ||
| 04:34 | Resolve ties at end of round (fixes [f08d3a4db3]). Track table numbers. check-in: d7edd6 user: joel tags: trunk | |
| 04:06 | Refine separation of roll/read turn phases; fix scoring of unread rolls at end of round check-in: 5b68c7 user: joel tags: trunk | |
| 03:20 | Adjust player display string check-in: 663177 user: joel tags: trunk | |
Changes
Modified bunco.py from [28f635] to [5ff744].
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | - + - - - - - - - - - - - - - - - - - - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + |
# Test
import csv, random
teammate = {
1: 3,
2: 4,
3: 1,
4: 2
}
def TurnInProgress():
return -1
|
| ︙ | |||
82 83 84 85 86 87 88 89 90 | 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | + + + - + - - - + - - - - - - - - - - + - - |
elif self.turn_progress < 50:
# Rolling the dice
# TODO: Incorporate ROLL SPEED stat
self.turn_progress += random.randint(12,25)
elif self.turn_progress < 75:
# Reading the numbers
# TODO: Incorporate MATH COMPREHENSION stat
if not self.current_roll:
self.current_roll = roll_dice()
self.round_roll_counts[current_round - 1] += 1
self.turn_progress += random.randint(12,25)
else:
|
| ︙ | |||
263 264 265 266 267 268 269 270 | 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 | + + + + + + + |
def play_one_round(self):
# Go until one of the head table teams reaches 21 pts
while max(self.tables[0].team1_score, self.tables[0].team2_score) < 21:
self.tick()
print("\n\n\t\tB U N C O !!!\n\n")
# Finish up scoring for any players that have unscored rolls
for player in self.players:
if player.current_roll:
print(f"Finishing up: {player}")
while player.current_roll:
player.tick(self.current_round)
self.print_status()
|