示例#1
0
def roll_dice(room, number):
	roll = [randint(1, 6)]
	i = 1
	while i < int(number):
		roll.append(randint(1, 6))
		i+=1	
	dice ={"dice": roll}
	dicerolls = Dicerolls(dice_roll = str(dice), room = room)
	dicerolls.put()
	return json.dumps(dice)
示例#2
0
def show_room(room):
	dicerolls = Dicerolls.all()
	return render_template('room.html', dicerolls=dicerolls, room=room)