#!/usr/bin/env python3
"""Auto-generated by AGI Loop cycle #1019
Task: Write a Python function that simulates a simple predator-prey ecosystem for 50 steps
Generated: 2026-02-12T17:13:17.172538
"""

import random

def simulate_ecosystem(steps=50, initial_predators=5, initial_preys=20):
    predators = initial_predators
    preys = initial_preys
    print(f"Step 0: Predators = {predators}, Preys = {preys}")
    
    for step in range(1, steps + 1):
        # Prey growth
        preys += random.randint(1, 3)
        # Predator consumption
        if preys > 0:
            predators += random.randint(0, 1)
            preys -= random.randint(1, 2)
        else:
            predators -= random.randint(1, 2)
            if predators < 0:
                predators = 0
        print(f"Step {step}: Predators = {predators}, Preys = {preys}")

if __name__ == '__main__':
    simulate_ecosystem()