input: Write a python function to create a Player and an Enemy class, initialize a player, and allow the player to move within a game loop.
  assert player.name == "TestPlayer"
  assert player.hp == 100
  assert player.position == [0, 0]
  assert isinstance(enemy, Enemy) and enemy.hp >= 50 and enemy.hp <= 100
output: class Player:
      def __init__(self, name, hp=100, position=None):
          if position is None:
              position = [0, 0]
          self.name = name
          self.hp = hp
          self.position = position
  
      def move(self, direction):
          if direction == "up":
              self.position[1] += 1
          elif direction == "down":
              self.position[1] -= 1
          elif direction == "left":
              self.position[0] -= 1
          elif direction == "right":
              self.position[0] += 1
  
  class Enemy:
      def __init__(self, hp):
          self.hp = hp
  
  # Initialize a player
  player = Player(name="TestPlayer")
  
  # Create an enemy with a random HP between 50 and 100
  import random
  enemy = Enemy(hp=random.randint(50, 100))
  
  # Example of moving the player
  player.move("up")