class WorkingMemory:
    def __init__(self, capacity=100):
        self.capacity = capacity  # Maximum number of items that can be stored
        self.items = []           # List to hold the memory items

    def add(self, item):
        """Add an item to working memory if it doesn't exceed the capacity."""
        if len(self.items) < self.capacity:
            self.items.append(item)
        else:
            print("Memory is full. Cannot add more items.")

    def update(self, index, new_item):
        """Update an existing item in working memory with a new one."""
        try:
            self.items[index] = new_item
        except IndexError:
            print(f"Index {index} out of range for the current number of items: {len(self.items)}")

    def retrieve(self, index=None):
        """Retrieve all items or an individual item based on the provided index."""
        if index is not None:
            return self.items[index]
        return self.items

    def clear(self):
        """Clear the working memory by removing all stored items."""
        self.items = []

# Example usage of WorkingMemory
wm = WorkingMemory(capacity=10)

wm.add("Apple")
wm.add("Banana")
print(wm.retrieve())  # Output: ['Apple', 'Banana']

wm.update(0, "Orange")
print(wm.retrieve())  # Output: ['Orange', 'Banana']

wm.clear()
print(wm.retrieve())  # Output: []