Sure, let's break down the requirements and write a test case generator for the given problem.

### Problem Breakdown
1. **Input**
   - An integer `n`, representing the number of records.
   - Each record consists of a sequence of numbers terminated by zero.

2. **Output**
   - For each record, the output should consist of `m` lines (where `m` is the number of rooms).
   - Each line should list the room number followed by the rooms it is connected to.

### Constraints
- \( n \) is less than 100.
- Each record sequence may be up to 1000 characters long.
- The number of rooms per house is less than 100.
- The number of doors in each room is less than 40.

### Test Case Generator

```python
import random

def generate_record():
    num_rooms = random.randint(2, 10)  # Keeping it manageable for example, but could be up to 100
    record = []
    visited_rooms = set()
    current_room = 1
    distance_from_start = {current_room: 0}
    stack = [(current_room, list(range(1, random.randint(2, 5) + 1)))]  # (room, doors)
    visited_rooms.add(current_room)
    
    while stack:
        room, doors = stack.pop()
        if not doors:
            continue
        
        door = doors.pop()
        stack.append((room, doors))
        
        if door not in visited_rooms:
            visited_rooms.add(door)
            record.append(random.randint(2, 5))  # Number of doors in the new room
            distance_from_start[door] = distance_from_start[room] + 1
            new_doors = list(range(1, random.randint(2, 5) + 1))
            stack.append((door, new_doors))
        else:
            record.append(distance_from_start[door] - distance_from_start[room])
    
    record.append(0)  # Terminating zero
    return record

def tcgen():
    n = random.randint(1, 5)  # For example, but could be up to 100
    records = [generate_record() for _ in range(n)]
    return n, records

# Example usage
n, records = tcgen()
print(n)
for record in records:
    print(" ".join(map(str, record)))
```

### Explanation of the Generator
1. **`generate_record` Function**:
   - Generates a single exploration record.
   - Randomly determines the number of rooms and their connections.
   - Ensures each room has at least 2 doors.
   - Tracks visited rooms and generates appropriate records according to the described rules.

2. **`tcgen` Function**:
   - Generates `n` such records.
   - Prints out the number of records `n` and each record in the required format.

### Example Output
Running the generator might give an output such as:
```
3
3 3 3 3 -3 3 2 -5 3 2 -5 -3 0
3 5 4 -2 4 -3 -2 -2 -1 0
```

This setup ensures that the generated test cases conform to the problem's constraints and closely simulate realistic scenarios for testing.