N = 6 : M = 5 : H = 25 : P = 0.2 fastgraphics graphsize N*H,(M+1)*H font "Arial",H/2+1,75 dim f(N,M) # 1 open, 2 mine, 4 expected mine dim s(N,M) # count of mines in a neighborhood trian1 = {1,1,H-1,1,H-1,H-1} : trian2 = {1,1,1,H-1,H-1,H-1} mine = {2,2, H/2,H/2-2, H-2,2, H/2+2,H/2, H-2,H-2, H/2,H/2+2, 2,H-2, H/2-2,H/2} flag = {H/2-1,3, H/2+1,3, H-4,H/5, H/2+1,H*2/5, H/2+1,H*0.9-2, H*0.8,H-2, H*0.2,H-2, H/2-1,H*0.9-2} mines = int(N*M*P) : k = mines : act = 0 while k>0 i = int(rand*N) : j = int(rand*M) if not f[i,j] then f[i,j] = 2 : k = k - 1 # set mine s[i,j] = s[i,j] + 1 : gosub adj # count it end if end while togo = M*N-mines : over = 0 : act = 1 gosub redraw while not over clickclear while not clickb pause 0.01 end while i = int(clickx/H) : j = int(clicky/H) if i