垂直翻转字典中存储的二维单位空间的算法
我有一个程序,其中包含存储在二维单位空间中的对象。 在某些时候,我的程序将遍历这个空间并删除某些对象,然后将它们替换到其他地方。当这些对象放回原处时,“图像”会垂直翻转。
我在下面提供了两张图像,其中包含初始视图,然后是所需的视图。每个对象按照首先移除和放回的顺序标记为 1 - 7。
初始视图:
Desired View:
这些对象存储在 Dictionary
当键是对象的唯一 ID 时。 如图所示,第一个对象从 [0, 2]
位置到 [0, 0]
我已经思考这个问题几个小时了,但是无法拿出可行的解决方案。 任何帮助将不胜感激。如果您需要对此问题的更多说明,请询问。
I have a program that contains objects stored in a 2d unit space.
At certain times, my program will go through this space and remove certain objects, and then replacing them elsewhere. When these objects are placed back in their 'image' is flipped vertically.
I've provided 2 images below containing the initial view, and then the desired view. Each object is labelled 1 - 7 in the order that they are first removed and put back in.
Initial View:
Desired View:
These objects are stored in a Dictionary<String, int[2]>
when the key is a unique ID for the object.
As shown in the images, the 1st object goes from a position of [0, 2]
to [0, 0]
I've been thinking about this problem for hours but can't come up with a viable solution.
Any help would be greatly appreciated. If you need an more clarification on this problem, please ask.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论