本文整理汇总了Python中Simulation.roll_dice方法的典型用法代码示例。如果您正苦于以下问题:Python Simulation.roll_dice方法的具体用法?Python Simulation.roll_dice怎么用?Python Simulation.roll_dice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Simulation
的用法示例。
在下文中一共展示了Simulation.roll_dice方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1:
# 需要导入模块: import Simulation [as 别名]
# 或者: from Simulation import roll_dice [as 别名]
else:
rents_paid.append(rent)
pos = (pos + moves_forward) % Simulation.no_of_squares
# print moves_forward
# print "Rent paid = ", rent
# print "Current position = ", Simulation.square_names[pos], "\n"
# Code for dice roll
# If not IN JAIL, do a normal move
if pos != -1:
# print "Starting position = ", Simulation.square_names[pos]
doubles, triples, mr_monopoly, bus_ticket, moves_forward = Simulation.roll_dice()
square_ix = (pos + moves_forward) % Simulation.no_of_squares
square_name = Simulation.square_names[(pos + moves_forward) % Simulation.no_of_squares]
square_type = Simulation.square_type[square_ix]
if square_type == 'RR':
rent = Simulation.rent_value_3[square_ix]
elif square_type == 'UY':
rent = Simulation.rent_value_2[square_ix] / 10000 * moves_forward
else:
rent = Simulation.rent_value_S[square_ix]
if rent < 0:
开发者ID:shreerajshrestha,项目名称:Monopoly_Mega_Edition_Evolutionary_Optimization,代码行数:32,代码来源:BusTicket_Analysis_BD.py