package vm;

import vm.exceptions.DisplayException;

public class Display {
    private byte[] pixelArray;


    public Display(int size) {
        pixelArray = new byte[size];
    }

    public void setPixelValue(int position, byte value) throws DisplayException {
        if (position < 0 || position >= pixelArray.length) {
            throw new DisplayException("Attempt to write pixel value to the wrong position.");
        }

        pixelArray[position] = value;
    }

    public byte getPixelValue(int position) throws DisplayException {
        if (position < 0 || position >= pixelArray.length) {
            throw new DisplayException("Attempt to read pixel value from the wrong position.");
        }

        return pixelArray[position];
    }
}

@@ -751,11 +751,138 @@
 %5D;%0A    %7D
+%0A%0A    public void clear() %7B%0A        for(int i = 0; i %3C pixelArray.length; i++) %7B%0A            pixelArray%5Bi%5D = 0;%0A        %7D%0A    %7D
 %0A%7D%0A

Add clear method to the Display class