我正在尝试使用 JSON 请求将数据从客户端发送到服务器。JSON 请求的正文如下所示:
[
[
{"x":"0","y":"0","player":0},
{"x":"0","y":"1","player":0},
{"x":"0","y":"2","player":1}
],
[
{"x":"1","y":"0","player":0},
{"x":"1","y":"1","player":2},
{"x":"1","y":"2","player":0}
],
[
{"x":"2","y":"0","player":0},
{"x":"2","y":"1","player":1},
{"x":"2","y":"2","player":2}
]
]
在服务器端,我想使用 Play 2 框架将数据转换为 Scala 2D 列表,如下所示:
List(
List(0,0,1),
List(0,2,0),
List(0,1,2)
)
这是 3x3,但它可以像 50x50 左右一样可变。
谢谢你的帮助。