Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This forum post https://forums.adafruit.com/viewtopic.php?p=1051479#p1051479 reports an exception raised by the code from this learn guide: https://learn.adafruit.com/infinite-text-adventure/overview.
The code is attempting to create a Terminal instance with height 1 https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/CircuitPython_Zorque_Text_Game_openai/code.py#L106-L111
The current validation of width and height >=2 was added here: #7892 but the actual implementation used differs subtly from what the referenced issue had asked for
The current implementation also raises an exception in the Nx1 case which is what the learn guide is doing.
This PR changes the validation to multiply width and height first so that we are validating the total area rather than each axis size independently.
I tested on a PyPortal Titano successfully with this code:
I also verified that 1x1 does still raise an exception