MapGame.py
def place(self, takers):
        ''' 
        Randomly place game-objects, into the map.
        '''
        if not sum(takers):
            return None
        takers =list(takers)
        for which, nelem in enumerate(takers):
            if not nelem:
                continue
            to_take = random.randint(0, nelem)
            if nelem is 1:
                to_take = 1
            if not to_take:
                continue
            taken = 0
            while taken != to_take:
                ss = random.randrange(1, 64) # Ignore "Outer Limits"
                area = self.get_area(ss)
                should_take = random.randint(1, 8)
                if which is 0:
                    if area.count_glyphs(Glyphs.STARBASE) != 0:
                        continue
                    area.place_glyph(Glyphs.STARBASE)
                elif which is 1:
                    area.place_glyph(Glyphs.STAR)
                elif which is 2:
                    if area.count_glyphs(Glyphs.KLINGON) > 3:
                        continue
                    area.place_glyph(Glyphs.KLINGON)
                taken += 1
                if taken == to_take:
                    break;
            takers[which] -= taken
        return tuple(takers)
 
        Randomly place game-objects, into the map.
        
Randomly place game-objects, into the map.
Randomly place game - objects into the map .
def place(self, takers):
        if not sum(takers):
            return None
        takers =list(takers)
        for which, nelem in enumerate(takers):
            if not nelem:
                continue
            to_take = random.randint(0, nelem)
            if nelem is 1:
                to_take = 1
            if not to_take:
                continue
            taken = 0
            while taken != to_take:
                ss = random.randrange(1, 64) 
                area = self.get_area(ss)
                should_take = random.randint(1, 8)
                if which is 0:
                    if area.count_glyphs(Glyphs.STARBASE) != 0:
                        continue
                    area.place_glyph(Glyphs.STARBASE)
                elif which is 1:
                    area.place_glyph(Glyphs.STAR)
                elif which is 2:
                    if area.count_glyphs(Glyphs.KLINGON) > 3:
                        continue
                    area.place_glyph(Glyphs.KLINGON)
                taken += 1
                if taken == to_take:
                    break;
            takers[which] -= taken
        return tuple(takers)
def place ( self , takers ) : if not sum ( takers ) : return None takers = list ( takers ) for which , nelem in enumerate ( takers ) : if not nelem : continue to_take = random . randint ( 0 , nelem ) if nelem is 1 : to_take = 1 if not to_take : continue taken = 0 while taken != to_take : ss = random . randrange ( 1 , 64 ) area = self . get_area ( ss ) should_take = random . randint ( 1 , 8 ) if which is 0 : if area . count_glyphs ( Glyphs . STARBASE ) != 0 : continue area . place_glyph ( Glyphs . STARBASE ) elif which is 1 : area . place_glyph ( Glyphs . STAR ) elif which is 2 : if area . count_glyphs ( Glyphs . KLINGON ) > 3 : continue area . place_glyph ( Glyphs . KLINGON ) taken += 1 if taken == to_take : break ; takers [ which ] -= taken return tuple ( takers )
Randomly place game-objects, into the map.
Randomly place game - objects into the map .
''' 
        Randomly place game-objects, into the map.
        ''' # Ignore "Outer Limits"
self
takers