コード例 #1
0
 def __init__(self, posx, posy, index, mapp):
     self._pos = Pos(posx, posy)
     self._index = index
     self._map = mapp
     self._name = ("W%s" % str(index))
     self._health = HEALTH_CAP
     self._magic_crystal = 10
コード例 #2
0
 def __init__(self, monster_id, health_capacity):
     self.__monster_id = monster_id
     self.__health_capacity = health_capacity
     self.__health = health_capacity
     self.__pos = Pos()
     self.__drop_item_list = []
     self.__hint_list = []
コード例 #3
0
 def __init__(self, posx, posy, index, map):
     self._pos = Pos(posx, posy)
     self._index = index
     self._map = map
     self._name = 'W' + str(index)
     self._health = self._HEALTH_CAP
     self._magic_crystal = 10
コード例 #4
0
 def __init__(self,pos_x,pos_y,index,Map):       
     self._pos= Pos(pos_x,pos_y)
     self._index=index
     self._map_=Map
     self._name="W"+str(index)
     self._health=Warrior._HEALTH_CAP
     self._magic_crystal=10
コード例 #5
0
class Merchant(): #added
    def __init__(self):
        self._elixir_price = 1
        self._shield_price = 2
        self._pos = Pos()
        
    def get_pos(self):
        return self._pos
    
    def set_pos(self, row, column):
        self._pos.set_pos(row, column)
        
    def talk(self, text):
        print("Merchant$: " + text, end='')
            
    def action_on_soldier(self, soldier):
        commu_enable = True if soldier.count_coin() > 0 else False
        if not commu_enable: self.talk("You don't have enough coins.\n\n")
        while commu_enable:
            self.talk("Do you want to buy something? (1. Elixir, 2. Shield, 3. Leave.) Input: ")
            x = input()
            if x == '1':
                soldier.buy_elixir(self._elixir_price)
                commu_enable = False
            elif x == '2':
                if not soldier.buy_shield(self._shield_price):
                    self.talk("You don't have enough coins.\n\n")
                commu_enable = False
            elif x == '3':
                self.talk('Bye.\n\n')
                commu_enable = False
            else: print('=> Illegal choice!\n')
                
    def display_symbol(self):
        print('$', end = '')
コード例 #6
0
ファイル: Monster.py プロジェクト: jzzhang8/ppl
 def __init__(self, monsterID, healthCapacity):
     self.monsterID = monsterID
     self.healthCapacity = healthCapacity
     self.health = healthCapacity
     self.pos = Pos()
     self.dropItemList = []
     self.hintList = []
コード例 #7
0
ファイル: Monster.py プロジェクト: yytlee/CSCI3180
 def __init__(self, monster_ID=0, health_capacity=30):
     self._monster_ID = monster_ID
     self._health_capacity = health_capacity
     self._health = health_capacity
     self._pos = Pos()
     self._drop_item_list = []
     self._hint_list = []
コード例 #8
0
 def __init__(self, healthCap, mob, posx, posy, index, game):
     self.__MOBILITY = mob
     self._health = healthCap
     self._pos = Pos(posx, posy)
     self._index = index
     self._game = game
     self._myString = ""
     self._equipment = ""
コード例 #9
0
 def __init__(self, healthCap, mob, posx, posy, index, game):
     self.MOBILITY = mob
     self.health = healthCap
     self.pos = Pos(posx, posy)
     self.equipment = 0
     self.index = index
     self.myString = ""
     self.game = game
コード例 #10
0
class Soldier:
    def __init__(self):
        self.health = 100
        self.numElixirs = 2
        self.pos = Pos()
        self.keys = set()

    def getHealth(self):
        return self.health

    def loseHealth(self):
        self.health -= 10
        return self.health <= 0

    def recover(self, healingPower):
        totalHealth = healingPower + self.health
        self.health = 100 if totalHealth >= 100 else totalHealth

    def getPos(self):
        return self.pos

    def setPos(self, row, column):
        self.pos.setPos(row, column)

    def move(self, row, column):
        self.setPos(row, column)

    def getKeys(self):
        return self.keys

    def addKey(self, key):
        self.keys.add(key)

    def getNumElixirs(self):
        return self.numElixirs

    def addElixir(self):
        self.numElixirs += 1

    def useElixir(self):
        self.recover(random.randint(0, 5) + 15)
        self.numElixirs -= 1

    def displayInformation(self):
        print('Health: ', self.health, '.', sep='')
        print('Position (row, column): (',
              self.pos.getRow(),
              ', ',
              self.pos.getColumn(),
              ').',
              sep='')
        print('Keys: ', list(self.keys), '.', sep='')
        print('Elixirs: ', self.numElixirs, '.', sep='')

    def displaySymbol(self):
        print('S', end='')
コード例 #11
0
ファイル: Soldier.py プロジェクト: Soapony/csci3180
class Soldier():
    def __init__(self):
        self._health = 100
        self.__num_elixirs = 2
        self.__pos = Pos()
        self.__keys = []

    def get_health(self):
        return self._health

    def lose_health(self):
        self._health -= 10
        return self._health <= 0

    def recover(self, healing_power):
        total_health = healing_power + self._health
        if (total_health >= 100):
            self._health = 100
        else:
            self._health = total_health

    def get_pos(self):
        return self.__pos

    def set_pos(self, row, col):
        self.__pos.set_pos(row, col)

    def move(self, row, col):
        self.set_pos(row, col)

    def get_keys(self):
        return self.__keys

    def add_key(self, key):
        self.__keys.append(key)

    def get_num_elixirs(self):
        return self.__num_elixirs

    def add_elixir(self):
        self.__num_elixirs += 1

    def use_elixir(self):
        self.recover(random.randint(0, 5) + 15)
        self.__num_elixirs -= 1

    def display_information(self):
        str_key = [str(x) for x in self.__keys]
        print("Health: ", self._health, ".")
        print("Position (row, column): (", self.__pos.get_row(), ", ",
              self.__pos.get_col(), ").")
        print("Keys: [" + ", ".join(str_key) + "].")
        print("Elixirs: ", self.__num_elixirs, ".")

    def display_symbol(self):
        print("S", end="")
コード例 #12
0
 def pick_spot(self):
     p = None
     while p is None:
         p = Pos(random.randint(0, self.w - 1),
                 random.randint(0, self.h - 1))
         for e in self.tail:
             if p.dist(e) < 1:
                 p = None
                 break
     return p
コード例 #13
0
class PosUI:
    def __init__(self):
        self.pos = Pos()

    def show(self):
        while True:
            try:
                os.system('cls' if os.name == 'nt' else 'clear')
                print("1: 책 관리 시스템")
                print("2: 자리 관리 시스템")
                print("3: 주문받기 / 결제하기")
                print("4: 직원 관리 시스템")
                print("5: 고객 관리 시스템")
                print("6: 음식 관리 시스템")
                print("7: 시스템 종료")
                num = int(input("번호를 입력하세요: "))
                if num == 1:
                    self.show_book_control_ui()
                elif num == 2:
                    self.show_seat_management_ui()
                elif num == 3:
                    self.show_order_control_ui()
                elif num == 4:
                    self.show_clerk_control_ui()
                elif num == 5:
                    self.show_customer_control_ui()
                elif num == 6:
                    self.show_food_management_ui()
                elif num == 7:
                    self.shutdown()
                    break
            except KeyboardInterrupt:
                self.shutdown()
                break

    def show_book_control_ui(self):
        self.pos.book_control_ui.show()

    def show_seat_management_ui(self):
        self.pos.seat_management_ui.show()

    def show_order_control_ui(self):
        self.pos.order_control_ui.show()

    def show_clerk_control_ui(self):
        self.pos.clerk_control_ui.show()

    def show_customer_control_ui(self):
        self.pos.customer_control_ui.show()

    def show_food_management_ui(self):
        self.pos.food_management_ui.show()

    def shutdown(self):
        self.pos.shutdown()
コード例 #14
0
class Soldier():

  def __init__(self):
    self.health = 100
    self.numElixirs = 2
    self.pos = Pos()
    self.keys = set()

  def getHealth(self):
    return self.health

  def loseHealth(self):
    self.health -= 10
    return self.health <= 0

  def recover(self, healingPower):
    totalHealth = healingPower + self.health
    if totalHealth >= 100:
      self.health = 100
    else:
      self.health = totalHealth

  def getPos(self):
    return self.pos

  def setPos(self, row, column):
    self.pos.setPos(row, column)

  def move(self, row, column):
    self.setPos(row, column)

  def getKeys(self):
    return list(self.keys)

  def addKey(self, key):
    return self.keys.add(key)

  def getNumElixirs(self):
    return self.numElixirs

  def addElixir(self):
    self.numElixirs += 1

  def useElixir(self):
    self.recover(random.randint(15, 20))
    self.numElixirs -= 1

  def displayInformation(self):
    print("Health: {}.".format(self.health))
    print("Position (row, column): ({}, {}).".format(self.pos.getRow(), self.pos.getColumn()))
    print("Keys: " + str(list(self.keys)))
    print("Elixirs: {}.".format(self.numElixirs))

  def displaySymbol(self):
    print("S",end="")
コード例 #15
0
ファイル: Soldier.py プロジェクト: yytlee/CSCI3180
class Soldier():
    def __init__(self):
        self._health = 100
        self._num_elixirs = 2
        self._pos = Pos()
        self._keys = set()

    def get_health(self):
        return self._health

    def lose_health(self):
        self._health -= 10
        return self._health <= 0

    def recover(self, healing_power):
        ## Soldier's health cannot exceed capacity.
        total_health = healing_power + self._health
        self._health = 100 if total_health >= 100 else total_health

    def get_pos(self):
        return self._pos

    def set_pos(self, row, column):
        self._pos.set_pos(row, column)

    def move(self, row, column):
        self.set_pos(row, column)

    def get_keys(self):
        return self._keys

    def add_key(self, key):
        self._keys.add(key)

    def get_num_elixirs(self):
        return self._num_elixirs

    def add_elixir(self):
        self._num_elixirs += 1

    def use_elixir(self):
        self.recover(random.randint(15, 20))
        self._num_elixirs -= 1

    def display_information(self):
        print("Health: %d." % (self._health))
        print("Position (row, column): (%d, %d)." %
              (self._pos.get_row(self), self._pos.get_column(self)))
        print('Keys: [', end='')
        print(*self._keys, sep=', ', end='].\n')
        print("Elixirs: %d." % (self._num_elixirs))

    def display_symbol(self):
        print('S', end='')
コード例 #16
0
    def get_next_observation(self, observation, actions):
        player_index = (np.argwhere(observation[:, :, 1] == 1)).tolist()[0]
        asix_old, asiy_old = player_index[0], player_index[1]
        asix, asiy = player_index[0], player_index[1]

        done = False

        action_index = np.argwhere(actions == 1)
        action = action_index[0]

        if action == 0:  ##up
            asix -= 1
        elif action == 1:  ##down
            asix += 1
        elif action == 2:  ##left
            asiy -= 1
        elif action == 3:  ##right
            asiy += 1
        elif action == 4:  ##up left
            asix -= 1
            asiy -= 1
        elif action == 5:  ##up right
            asix -= 1
            asiy += 1
        elif action == 6:  ##down left
            asix += 1
            asiy -= 1
        elif action == 7:  ##down right
            asix += 1
            asiy += 1
        elif action == 8:  ##done
            done = True

        observation[player_index[0]][player_index[1]][6] = 1

        em_index = (np.argwhere(observation[:, :, 2] == 1)).tolist()[0]
        ex, ey = em_index[0], em_index[1]

        move = []

        if (asix < 0 or asix >= self.hight or asiy < 0 or asiy >= self.hight
                or observation[asix][asiy][0] == 1  #墙壁
                or observation[asix][asiy][6] == 1  #已经走过
                or (ex == asix and ey == asiy)):
            print("Path is invalid")
            return move, observation, True

        if done != True:
            observation[asix_old][asiy_old][1] = 0  #恢复为0
            observation[asix][asiy][1] = 1  #设置为1
            move = Pos(0, 0)
            move.x = asix
            move.y = asiy
        return move, observation, done
コード例 #17
0
class Soldier():
    def __init__(self):
        self.health = 100
        self.num_elixirs = 2
        self.pos = Pos()
        self.keys = []

    def get_health(self):
        return self.health

    def lose_health(self):
        self.health -= 10
        return self.health <= 0

    def recover(self, healing_power):
        total_health = healing_power + self.health
        self.health = 100 if total_health >= 100 else total_health
    
    def get_pos(self):
        return self.pos

    def set_pos(self, row, column):
        self.pos.set_pos(row, column)

    def move(self, row, column):
        self.set_pos(row, column)

    def get_keys(self):
        return self.keys

    def add_key(self, key):
        self.keys.append(key)

    def get_num_elixirs(self):
        return self.num_elixirs

    def add_elixir(self):
        self.num_elixirs += 1

    def use_elixir(self):
        self.recover(random.randint(0, 5) + 15)
        self.num_elixirs -= 1

    def display_information(self):
        print("Health: {}.".format(self.health))
        print("Position (row, column): ({}, {}).".format(self.pos.get_row(), self.pos.get_column()))
        print("Keys: " + str(sorted(set(self.keys))) + ".")
        print("Elixirs: {}.".format(self.num_elixirs))

    def display_symbol(self):
        print("S", end="")
コード例 #18
0
ファイル: Map.py プロジェクト: tywong7/csci3180
 def get_Un_Occupied_Position(self):
     randx = random.randint(0, self._D - 1)
     randy = random.randint(0, self._D - 1)
     while (self._lands[randx][randy].Occupied_obj != None):
         randx = random.randint(0, self._D - 1)
         randy = random.randint(0, self._D - 1)
     return Pos(randx, randy)
コード例 #19
0
class Obstacle(object):
    def __init__(self, posx, posy, index, game):
        self.pos = Pos(posx, posy)
        self.index = index
        self.game = game

    def getPos(self):
        return self.pos

    def teleport(self):
        randx = random.randint(0, (self.game.D - 1))
        randy = self.game.D - randx - 1
        while (self.game.positionOccupied(randx, randy)):
            randx = random.randint(0, (self.game.D - 1))
            randy = self.game.D - randx - 1
        self.pos.setPos(randx, randy)
コード例 #20
0
 def get_unoccupied_position(self):
     randx = random.randint(0, D - 1)
     randy = random.randint(0, D - 1)
     while(self._lands[randx][randy].occupied_obj != None):
         randx = random.randint(0, D - 1)
         randy = random.randint(0, D - 1)
     return Pos(randx, randy)
コード例 #21
0
ファイル: Ui.py プロジェクト: 4j0/Tetris
 def __init__(self, Pos, Size, Surface):
     self.pos = Pos
     self._tetrimino = None
     self.surface = Surface
     self.rect = pygame.Rect(Pos.tuple(), Size.tuple())
     pygame.draw.rect(self.surface, UiConfig.tetriminoBox['BORDER_COLOR'], \
                      self.rect, UiConfig.tetriminoBox['BORDER_WIDTH'])
コード例 #22
0
class Merchant():
    def __init__(self, elixir_price, shield_price):

        # TODO: Initialization.
        self._elixir_price = elixir_price
        self._shield_price = shield_price
        self._pos = Pos()

    def action_on_soldier(self, soldier):
        self.talk(
            'Do you want to buy something? (1. Elixir, 2. Shield) Input: ')

        # TODO: Main logic.
        choice = input()

        if choice == '1':
            if soldier.get_num_coin() >= self._elixir_price:
                soldier.use_coin(self._elixir_price)
                soldier.add_elixir()
                print("You have %d coin(s) left.", soldier.get_num_coin())
            else:
                self.talk("Poor guy, you don't have enough coins.")
                print()
        elif choice == '2':
            if soldier.get_num_coin() >= self._shield_price:
                soldier.use_coin(self._shield_price)
                soldier.add_shield()
                print("You have %d coin(s) left.", soldier.get_num_coin())
            else:
                self.talk("Poor guy, you don't have enough coins.")
                print()
        else:
            print('=> Illegal move!\n')

    def talk(self, text):
        print('Merchant$: ' + text, end='')

    # TODO: Other functions.

    def get_pos(self):
        return self._pos

    def set_pos(self, row, column):
        self._pos.set_pos(row, column)

    def display_symbol(self):
        print('$', end='')
コード例 #23
0
 def getUnOccupiedPosition(self):
     randx = random.randint(0, self.D - 1)
     randy = random.randint(0, self.D - 1)
     while self.lands[randx][randy].occupied_obj != None:
         randx = random.randint(0, self.D - 1)
         randy = random.randint(0, self.D - 1)
         pass
     return Pos(randx, randy)
     pass
コード例 #24
0
ファイル: Task4Merchant.py プロジェクト: jzzhang8/ppl
class Task4Merchant():
    def __init__(self):
        self.pos = Pos()
        self.elixirPrice = 1
        self.shieldPrice = 2

    def actionOnSoldier(self, soldier):
        self.talk(
            "Do you want to buy something? (1. Elixir, 2. Shield, 3. Leave.) Input: "
        )

        choice = input()

        if choice == "1":
            if soldier.getCoins() >= self.elixirPrice:
                soldier.addElixir()
                soldier.useCoins(self.elixirPrice)
            else:
                self.talk("You don't have enough coins.\n\n")

        elif choice == "2":
            if soldier.getCoins() >= self.shieldPrice:
                soldier.addShield()
                soldier.useCoins(self.shieldPrice)
            else:
                self.talk("You don't have enough coins.\n\n")

        elif choice == "3":
            pass  # leave directly

        else:
            print("=> Illegal choice!\n")

    def talk(self, text):
        print("Merchant$: " + text, end="")

    def getPos(self):
        return self.pos

    def setPos(self, row, column):
        self.pos.setPos(row, column)

    def displaySymbol(self):
        print("$", end="")
コード例 #25
0
    def set_assets(self, scl, fps, w, h, load_image, play_sound, show_fps):
        self.scl = scl
        self.fps = fps
        self.w = w
        self.h = h
        self.width = self.w * self.scl
        self.height = self.h * self.scl
        self.keyQueue = []
        self.load_image = load_image
        self.play_sound = play_sound

        self.menu_w = 16
        self.menu_h = 18
        self.menu_width = self.menu_w * self.scl
        self.menu_height = self.menu_h * self.scl
        self.show_fps = show_fps

        # Player variables
        self.s = Pos(1)
        self.tail = [Pos()]
        self.direction = Pos(1)
        self.food = self.pick_spot()
        # self.reset()

        # Loading sound
        self.hit = None
        if play_sound:
            try:
                self.hit = pygame.mixer.Sound('music/hit.wav')
            except FileNotFoundError:
                print("Could not load << hit.wav >>")
                exit(1)

        self.apple = None
        if load_image:
            try:
                self.apple = pygame.image.load('images/apple.png')
                self.apple = pygame.transform.scale(self.apple, (scl, scl))
            except FileNotFoundError:
                print("Could not load image << apple.png >>")
                exit(1)

        self.time = 0
        self.target_frame_time = 1000 / fps
コード例 #26
0
ファイル: Astar.py プロジェクト: varpeti/MAVSDK-Python
 def getChildren(self, root: Octree, goalOctree: Octree):
     cur = root.getLeavesInArea(self.value, Pos(0.0, 0.0, 0.0))[0]
     if cur == goalOctree:
         return [Node(self.goal, self, self.goal)]
     neighbours = root.getNeighbours(self.value, cur)
     np = Octree.cornerIt(neighbours)
     children = []
     for p in np:
         children.append(Node(p, self, self.goal))
     return children
コード例 #27
0
class Task4Merchant():
    def __init__(self):
        self.pos = Pos()
        self.shield_price = 2
        self.elixir_price = 1

    def action_on_soldier(self, soldier):
        self.talk(
            "Do you want to buy something? (1. Elixir, 2. Shield, 3. Leave) Input: "
        )

        choice = input()

        if choice == "1":
            if soldier.get_coin() >= self.elixir_price:
                soldier.spend_coin(self.elixir_price)
                soldier.add_elixir()
            else:
                print("You don't have enough coins.\n")
        elif choice == "2":
            if soldier.get_coin() >= self.shield_price:
                soldier.spend_coin(self.shield_price)
                soldier.add_defence()
            else:
                print("You don't have enough coins.\n")
        elif choice == "3":
            return
        else:
            print("=> Illegal choice!\n")

    def talk(self, text):
        print("Merchant$: " + text, end="")

    def display_symbol(self):
        print("$", end="")

    def set_pos(self, row, column):
        self.pos.set_pos(row, column)

    def get_pos(self):
        return self.pos
コード例 #28
0
ファイル: print.py プロジェクト: bison--/pizzaproxyprinter
 def PosArray(self, value):
     # needed for Type-Proof  of incoming PosArray
     PosProof = Pos()
     for element in value:
         if not type(element) == type(PosProof):
             # type proof for good objectorientation
             self._TypeOK = False
             break
         else:
             self._TypeOK = True
     if self._TypeOK:
         self._PosArray = value
コード例 #29
0
ファイル: Ui.py プロジェクト: 4j0/Tetris
 def __init__(self, Pos, Size, Surface):
     self.surface = Surface
     self.rect = pygame.Rect(Pos.tuple(), Size.tuple())
     pygame.draw.rect(self.surface, UiConfig.infoBox['BORDER_COLOR'], \
                      self.rect, UiConfig.infoBox['BORDER_WIDTH'])
     self.font = pygame.font.SysFont(self.FONT['font'], self.FONT['size'])
     self.drawText('Level:', self.TEXT_POS['LevelText'])
     self.levelText = self.drawText('0', self.TEXT_POS['Level'])
     self.drawText('Score:', self.TEXT_POS['ScoreText'])
     self.scoreText = self.drawText('0', self.TEXT_POS['Score'])
     self._level = 0
     self._score = 0
コード例 #30
0
ファイル: Task4Merchant.py プロジェクト: Soapony/csci3180
class Task4Merchant():
    def __init__(self):
        self.__elixir_price = 1
        self.__shield_price = 2
        self.__pos = Pos()
    
    def action_on_soldier(self,soldier):
        sc=input("Do you want to buy something? (1. Elixir, 2. Shield, 3. Leave.) Input: ")
        if(sc == '1'):
            if(soldier.get_coin() >= self.__elixir_price):
                soldier.add_elixir()
                soldier.lose_coin(self.__elixir_price)
                self.talk("You bought an Elixir.\n\n")
            else:
                self.talk("You don't have enough coins.\n\n")
        elif(sc == '2'):
            if(soldier.get_coin() >= self.__shield_price):
                soldier.add_shield()
                soldier.lose_coin(self.__shield_price)
                self.talk("You bought a shield.\n\n")
            else:
                self.talk("You don't have enough coins.\n\n")
        elif(sc == '3'):
            self.talk("Thank you for coming. :D\n\n")
        else:
            print("=> Illegal choice!\n\n")
    
    def talk(self,text):
        print("Merchant$",text,end='')
    
    def set_pos(self,row,col):
        self.__pos.set_pos(row,col)
    
    def get_pos(self):
        return self.__pos
    
    def display_symbol(self):
        print("$",end='')
コード例 #31
0
class Cell:
    def __init__(self, x=0, y=0, c=None):
        self.__pos = Pos(x, y)
        self.__checker = None
        if c and c != 'e':
            self.__checker = Checker(self, c)

    def get_checker(self):
        return self.__checker

    def get_pos(self):
        return self.__pos

    def set_pos(self, newPos):
        self.__pos = newPos

    def set_checker(self, newChecker):
        self.__checker = newChecker

    def get_neighbors(self):
        self.__nbrs = []
        x1 = self.__pos.getx()
        x2 = self.__pos.gety()
class Task4Merchant():
    def __init__(self):
        self.elixirPrice = 0
        self.shieldPrice = 0
        self.pos = Pos()

    def actionOnSoldier(self, soldier):

        choice = input(
            'Merchant$: Do you want to buy something? (1. Elixir, 2. Shield, 3. Leave.) Input: '
        )  # input choice

        if choice == '1':  # if choice = 1
            if soldier.task4GetCoins() >= 1:  # check enough coin
                soldier.task4BuyElixirs()
            else:
                self.talk("You don't have enough coins.\n\n")

        elif choice == '2':
            if soldier.task4GetCoins() >= 2:  # check enough coins
                soldier.task4BuyDefence()
            else:
                self.talk("You don't have enough coins.\n\n")
        elif choice != '3':
            print("=> Illegal choice!\n")  # illegal choice

    def talk(self, text):
        print("Merchant$: ", text, sep='', end='')

    def setPos(self, row, column):
        self.pos.setPos(row, column)

    def displaySymbol(self):
        print('$', end='')

    def getPos(self):
        return self.pos
コード例 #33
0
ファイル: print.py プロジェクト: bison--/pizzaproxyprinter
    def __init__(self):

        # Test / Help Example        

        BillPrinter = printBill(conf.conf)
        BillPrinter.PrintMwst = False
        BillPrinter.EndMsg = "Danke!"
        BillPrinter.Layout = 1

        posArray = []
        pos1 = Pos()
        pos1.nr = 1
        pos1.postext = "Salami"
        pos1.EP = 5.80
        pos1.Menge = 1.0
        pos1.reNr = "A0C12"

        pos2 = Pos()
        pos2.nr = 2
        pos2.postext = "Schinken"
        pos2.EP = 6.30
        pos2.Menge = 3.0
        pos1.reNr = "A0C12"

        i = 5
        while i > 0:
            posArray.append(pos1)
            posArray.append(pos2)
            i -= 1

        BillPrinter.PosArray = posArray
        BillPrinter.generatePrintFile()
        BillPrinter.printDocument()