Example #1
0
    def corner(self, spin):
        for num in xrange(1, 37):
            if num % 3 != 0 and num < 34:
                #all but right column and <34.
                spin.add_outcome(
                    num,
                    outcome.Outcome(
                        "{}-{}-{}-{}".format(num, num + 1, num + 3, num + 4),
                        8))

            if (num - 1) % 3 != 0 and num < 34:
                # all but left column and  <34.
                spin.add_outcome(
                    num,
                    outcome.Outcome(
                        "{}-{}-{}-{}".format(num - 1, num, num + 2, num + 3),
                        8))

            if num % 3 != 0 and num > 3:
                #all but right column.
                spin.add_outcome(
                    num,
                    outcome.Outcome(
                        "{}-{}-{}-{}".format(num - 3, num - 2, num, num + 1),
                        8))

            if (num - 1) % 3 != 0 and num > 3:
                # all but left column.
                spin.add_outcome(
                    num,
                    outcome.Outcome(
                        "{}-{}-{}-{}".format(num - 4, num - 3, num - 1, num),
                        8))
Example #2
0
 def line(self, spin):
     for num in xrange(1, 37):
         x = num - ((num + 2) % 3)
         if num > 3:
             y = x - 3
             spin.add_outcome(
                 num,
                 outcome.Outcome(
                     "{}-{}-{}-{}-{}-{}".format(*[y + i
                                                  for i in xrange(6)]), 5))
         if num < 34:
             spin.add_outcome(
                 num,
                 outcome.Outcome(
                     "{}-{}-{}-{}-{}-{}".format(*[x + i
                                                  for i in xrange(6)]), 5))
Example #3
0
 def twelve(self, spin):
     for num in xrange(1, 37):
         x = num - ((num - 1) % 12)
         spin.add_outcome(
             num,
             outcome.Outcome(
                 "{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}-{}".format(
                     *[x + i for i in xrange(12)]), 2))
Example #4
0
def draw_action(view, path):

    rolls = outcome.Outcome()
    rolls.set_suboutcome(Position(3, 7), outcome.rolls(2, 1))

    gamestate = Gamestate.from_file(path + "Gamestate.json")
    units = gamestate.all_units()
    action = Action.from_document(
        units, json.loads(open(path + "Action.json").read()))
    view.draw_action_tutorial(action, rolls)
Example #5
0
    def split(self, spin):
        for num in xrange(1, 37):
            if num % 3 != 0:
                #all but the right column
                spin.add_outcome(
                    num, outcome.Outcome("{}-{}".format(num, num + 1), 17))

            if (num - 1) % 3 != 0:
                #all but the left column
                spin.add_outcome(
                    num, outcome.Outcome("{}-{}".format(num - 1, num), 17))

            if num > 3:
                #all but 1, 2 and 3
                spin.add_outcome(
                    num, outcome.Outcome("{}-{}".format(num - 3, num), 17))

            if num < 34:
                #all but 34, 35, 36
                spin.add_outcome(
                    num, outcome.Outcome("{}-{}".format(num, num + 3), 17))
Example #6
0
    def street(self, spin):
        for num in xrange(1, 37):
            if num % 3 == 0:
                #all the right column
                spin.add_outcome(
                    num,
                    outcome.Outcome("{}-{}-{}".format(num - 2, num - 1, num),
                                    11))

            if (num - 1) % 3 == 0:
                #all the left column
                spin.add_outcome(
                    num,
                    outcome.Outcome("{}-{}-{}".format(num, num + 1, num + 2),
                                    11))

            if (num - 2) % 3 == 0:
                #all the middle column
                spin.add_outcome(
                    num,
                    outcome.Outcome("{}-{}-{}".format(num - 1, num, num + 1),
                                    11))
Example #7
0
 def test_add_outcome_to_bin(self):
     self.assertEqual(len(self.two.outcomes), 1)
     self.two.add(outcome.Outcome("black", 2))
     self.assertEqual(len(self.two.outcomes), 2)
Example #8
0
 def test_initialize_bin(self):
     self.ten = Bin(outcome.Outcome("10", 35))
     self.assertIsInstance(self.ten, Bin)
Example #9
0
 def setUp(self):
     self.five = outcome.Outcome('00-0-1-2-3', 6)
     self.zero = Bin(outcome.Outcome("0", 35), self.five)
     self.zerozero = Bin(outcome.Outcome("00", 35), self.five)
     self.even = outcome.Outcome('even', 2)
     self.two = Bin(self.even)
Example #10
0
 def straight(self, spin):
     for num in xrange(0, 37):
         spin.add_outcome(num, outcome.Outcome(str(num), 35))
     spin.add_outcome(37, outcome.Outcome("00", 35))
 def new_bet(self):
     return bet.Bet(outcome.Outcome("10", 35),
                    self._losses() * self._base_gold)
 def new_bet(self):
     #new bet probably made from a selection from the main outcome builder.
     return bet.Bet(outcome.Outcome("10", 35),
                    self._gold_multiplier1326() * self._base_gold)
 def setUp(self):
     self.outcome = outcome.Outcome('odd', 1)
     self.outcome2 = outcome.Outcome('even', 2)
     self.bin = bin.Bin(self.outcome)
     self.bin2 = bin.Bin(self.outcome2)
     self.wheel = Wheel(random.Random())
Example #14
0
 def __init__(self, table):
     self.black = outcome.Outcome('black', 2)
     self.table = table