enum
	WX =5
	WY
	BOMB=1					:/* 爆弾コード / bomb code：'*'=&h2a =< &h3f
	BMBIT=&h80://bit(7)		:/* 爆弾在るはずビット / bit for should bomb
	CHBIT=&h40://bit(6)		:/* わかんないビット / unknown bit
	OPBIT=(BMBIT or CHBIT)	:/* オープン状態を示すビット / bits for open status
	NOPBIT=(not OPBIT)		:/* キャラクターのみを取り出すビット / bits for get character only
endenum

print "BOMB=";BOMB,"BMBIT=$";hex$(BMBIT),"CHBIT=$";hex$(CHBIT):
print "OPBIT=$";hex$(OPBIT),"NOPBIT=$";hex$(NOPBIT)

dim char map(WX,WY)
BombSeed(WX*WY/3)

int x,y,c
for x=0 to WX-1
	for y=0 to WY-1
		c=((map(x,y) and NOPBIT)<>BOMB)
		if c then {
			print "x=";x,"y=";y;"<<"
			goto "CM1"
		}
//		if ((map(x,y) and NOPBIT)<>BOMB) then goto "CM1"
	next
next

label "CM1"
print "x=";x,"y=";y

for x=0 to WX-1
	for y=0 to WY-1
		c=((map(x,y) and NOPBIT)<>BOMB)
		print "x=";x,"y=";y;" : ";map(x,y),(map(x,y) and NOPBIT),c,
		if c then print "<";
		print
	next
next

end

/*****************************************************************

func BombSeed(seeds;int)
int x,y
for y=0 to WY-1
	for x=0 to WX-1
		map(x,y)=0
	next
next
while seeds>0
	x=rand2(WX)
	y=rand2(WY)
	if map(x,y)=0 then {
		map(x,y)=BOMB
		seeds=seeds-1
	}
endwhile
endfunc

/*****************************************************************
