java扫描封闭空间
这个问题很难描述,但我会尽力的
假设有一个2D像素方块游戏。还有像这样的街区
□□■□□□□□□□■■■■■■■■■■□□□■■□□□□□
□□□□□□□□□□■□□□□□□□□■□□□□□□■□□□
□□□□■□□□□□■□□□□□□□□■□□□□□□□□□□
□□□□□□□□□□■■■■■■■■■■□□□□■□□□□□
□□□□■□□□□□□□□□□□□□□□□□□□■□□□□□
你会如何写一些东西来扫描这种情况并突出显示封闭的白色块,比如:
□□■□□□□□□□■■■■■■■■■■□□□■■□□□□□
□□□□□□□□□□■⬛⬛⬛⬛⬛■□□□□□□■□□□
□□□□■□□□□□■⬛⬛⬛⬛⬛■□□□□□□□□□□
□□□□□□□□□□■■■■■■■■■■□□□□■□□□□□
□□□□■□□□□□□□□□□□□□□□□□□□■□□□□□
现在,我更感兴趣的部分是在3D中做同样的事情。我将使用Minecraft来帮助演示 How could you programmatically detect this enclosed space and highlight all the blocks from it?
共 (0) 个答案