因此,我已经搜索了一整天,但我似乎找不到如何创建我用Python创建的字典,以及如何用Java创建类似的东西。我试过查看数组列表和列表等,但没有用。在
PIECESDICT = {1: [[0,0], [0,1], [0,2], [1,1]], 2: [[0,0], [1,0], [0,1]], 3: [[0,0], [0,1], [1,1]], 4: [[0,0], [0,1], [1,0], [1,1]], 5: [[0,0], [1,0], [2,0]]}
所以这是我的字典,基本上它所做的就是,从coords(0,0)是每一个片段的左上角开始。它本身就是一部分。在
例如,第1件看起来像:
^{pr2}$类似地,第2部分看起来像:
00
0
看起来你想。。。某一对或坐标对象的^{}s 的^{} 。在
如果您有一个接受坐标作为参数的
Pair
类(例如new Pair(0, 0)
),那么您可以执行如下操作:HashMap
也可以接受String
(而不是Integer
)作为其中列表的键。在HashMap呢? 例如: 地图.put(“名称”、“值”)
你可以试试^{}
使用方法:
相关问题 更多 >
编程相关推荐