コード例 #1
0
ファイル: patr.py プロジェクト: whytewolf/petalsaroundtherose
def rose_game_enter():
    form = RoseGuessing(request.form)
    last_answer = None
    if request.method == 'POST' and form.validate():
        rose = TheRose(pickle.loads(form.dice.data))
        last_answer = rose.verify(form.guess.data)
        rose = TheRose(roll(6, 6))
        form.dice.default = pickle.dumps(rose.get_dice())
    else:
        rose = TheRose(roll(6, 6))
        form.dice.default = pickle.dumps(rose.get_dice())
    form.process()
    return render_template('game.html', dice=rose.get_dice(), form=form, answer=last_answer)
コード例 #2
0
ファイル: patr.py プロジェクト: whytewolf/petalsaroundtherose
def rose_front():
    rose = TheRose(roll(6, 6))
    return render_template('dice.html', dice=rose.get_dice(), answer=rose.get_answer())