注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
Implement a simplified Paint Editor that supports drawing on a 2D canvas and reverting changes using undo and redo operations.
Canvas
You are given a 2D grid representing a canvas. Each cell can store:
a color value (string or integer), or
None for an empty cell.
You will initialize the canvas with a given width and height.
Required Operations
1. draw(x, y, color)
rts all the operations listed above.
Follow up:
implement flood_fill
Your implementation must correctly maintain canvas state, undo/redo history, and fill behavior.
You may choose any reasonable data structures for representing:
The canvas
Undo and redo histories
|