dim banpt[9,9] = [
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0,90,10,50,30,30,50,10,90, 0],
[ 0,10, 0,40,40,40,40,40,10, 0],
[ 0,50,40,40,40,40,40,40,50, 0],
[ 0,30,40,40, 0, 0,40,40,30, 0],
[ 0,30,40,40, 0, 0,40,40,30, 0],
[ 0,50,40,40,40,40,40,40,50, 0],
[ 0,10, 0,40,40,40,40,40,10, 0],
[ 0,90,10,50,30,30,50,10,90, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
] As Byte

Dim houkou[9] = [
[-1,-1],[-1, 0],[-1, 1],[ 0,-1],[ 0, 1],[ 1,-1],[ 1, 0],[ 1, 1],[0,0]
] As POINTAPI


'開放度を調べる
Function pokaihoudo(byref pb[9,9] As byte ,pp As *POINTAPI) As Long
dim i as long, x as long, y as long
pokaihoudo = 0
For i=0 to 7
x = pp->x + houkou[i].x
y = pp->y + houkou[i].y
if pb[x,y] = 0 then pokaihoudo++
Next
End Function


'確認
#console
dim g_ban[9,9] as byte'メイン盤
g_ban[4,4]=2
g_ban[5,5]=2
g_ban[4,5]=1
g_ban[5,4]=1

dim p as POINTAPI
p.x=4
p.y=4
print pokaihoudo(g_ban, VarPtr(p))'5になるはず