Example: This should act as a single monitor.

X
XXX
X
X
This is one possible representation of a monitor cube. What would term.getSize() return? If it returns (3X, 4X), some content would be cut for any program not aware that they are running on this monitor. Furthermore, (1, 1) would be in a non-existent space…one question I have is would you need to identify the side you would like to print to?
What if we had it so that a line the color of the monitor appeared, which would indicate (1, y)
Why not just have it act as 2 different monitors for up to 4 monitors on a 4 sided block?
A table looking like this:1. Which one is returned by peripheral.wrap(side)?
{
"left" = monitor that's on the left side of the monitor cluster
"right"= monitor that's on the right side of the monitor cluster
"front"= monitor that's on the front side of the monitor cluster
"bottom" = monitor that's on the bottom side of the monitor cluster
}
In fact, I would argue that you should also do top and bottom just for kicks.My personal solution would be to use a new type of block altogether rather than regular monitors. You could call it "omnidirectional monitor" or something like that. And that thing would be a box that looks just like a monitor except by default it comes with monitor screens on all sides. And they'd combine just like regular monitors but keeping omnidirectional.2. How do you determine which sides of the block do have monitors on them?
3. ..and remain backwards-compatible with both of these issues?
Codevise the omnidirectional monitorshould behave just like a set of regular monitors. So your code would be:
-- Prints the text across a curved monitor
-- Parameters:
-- direction = direction in which to loop,
-- clockwise or counterclockwise
-- relevant for supporting different regions
--
-- text = the text to print
--
-- Returns: nothing
--
function monitor.printCurved(direction, text)
-- The length of each substring equal to the maximum amount of characters that can fit on the screen.
length = monitor resolution
-- The array of substrings to print individually
texts[] = text.split into length sized chunks
-- Our iterator which should in reality go through "left", "front", "right", "bottom" in which ever order was chosen.
-- Used integer here instead for brevity.
i = 1
-- Print the substrings.
foreach t in texts do
monitors[i].print(t)
i++
end