$name="KiXWeeper v1.3"
$author="1.0 unknown","1.1 Lonkero","1.2 Lonkero","1.3 Lonkero"
$Form = CreateObject("Kixtart.Form")
$Form.Caption = $name
$Form.BackColor = 255,255,255
$Form.ForeColor = 50,0,170
$Form.FontName = "Courier New"
$Form.FontBold = 1
$Form.FontSize = 10

$level=$form.slider(,15,12,75,25)
$level.tooltip="Level: 0"
$level.min=11
$level.onscroll="$$level.tooltip='Level: '+($$level.value-11)"
$=11
for $height=390 to $form.screen.height step 25 $=$+1 next
$level.max=$-1        ;<-if you remove this -1 you will get error every time!
$thislevel=11

Global $Button[$,$], $mine
$map=$Button
$r=0 $b=0
For $Top = 50 To ($*25+25Step 25
 For $Left = 10 To ($*25-15Step 25
    $map[$r,$b] = $Form.label(,$left,$top,25,25)
    $map[$r,$b].hide
    $map[$r,$b].alignment=2
    $map[$r,$b].FontSize=14
    $map[$r,$b].BorderStyle=1
    $Button[$r,$b] = $Form.button(,$left,$top,25,25)
    $Button[$r,$b].hide
    $Button[$r,$b].FontBold = 1
    $Button[$r,$b].onclick="button_click($r,$b)"
    $b=$b+1
 Next
 $b=0
 $r=$r+1
Next

$Time = $Form.Label
$Time.Size = 75,30
$Time.Alignment = 1
$Time.BorderStyle = 4
$Time.Fontname = "Courier New"
$Time.Fontsize = 14
$Time.Fontbold = 1
$Time.BackColor = 0
$Time.ForeColor = 255,255,0

$start=$form.button("New Game",225,10,75,25)
$start.onclick="new($$level.value)"

new(11)
$Form.Show

While $Form.Visible
 $=Execute($Form.DoEvents)
Loop

Exit 1

Function Button_Click($r,$b)
$=$thislevel
select
case not $Button[$r,$b].visible
case " "=$map[$r,$b].caption
    $Button[$r,$b].Hide
    $Score=$Score+1
    $Button[$r,$b].hide
    if $b>0 and $r>0 button_click($r-1,$b-1endif
    if $r>0 button_click($r-1,$bendif
    if $b<$ and $r>0 button_click($r-1,$b+1endif
    if $b>0 button_click($r,$b-1endif
    if $b<$ button_click($r,$b+1endif
    if $b>0 and $r<$ button_click($r+1,$b-1endif
    if $r<$ button_click($r+1,$bendif
    if $b<$ and $r<$ button_click($r+1,$b+1endif
case instr($map[$r,$b].caption,"X")
    $map[$r,$b].forecolor=255,0,0
    $Button[$r,$b].Hide
    $map[$r,$b].show
    for $r=0 to $
     for $b=0 to $
      if $button[$r,$b].visible $Button[$r,$b].caption=$map[$r,$b].caption $Button[$r,$b].enabled=0 endif
     next
    next
    $timer=0
case 1
    $map[$r,$b].forecolor=50,0,170
    $Button[$r,$b].Hide
    $Score=$Score+1
endselect
$map[$r,$b].show
if $Score = ($+1)*($+1)-($+1)*($+1)/10
 $timer=0
 $=messagebox("GOOD! You made your way trough the mine fields!",$name)
endif
if $timer and $timer<>0
 $timer=$Form.timer(1000)
 $timer.ontimer="$$time.caption=1+val($$time.caption)"
endif
EndFunction

function new($size)
$score=0
$thislevel=$size
$timer=1
$Time.Caption = 0
$mine=" ,"
 srnd(@ticks)
do $=rnd(($size+1)*($size+1))
 if not instr($mine,$$mine="$mine ,"+$ endif
until (($size+1)*($size+1)/10+1)<ubound(split($mine," ,"))

for $r=0 to $level.max
 for $b=0 to $level.max
    if $b>$size or $r>$size
        $Button[$r,$b].hide
    else
        $Button[$r,$b].caption=""
        $Button[$r,$b].enabled=1
        $Button[$r,$b].show
    endif
    $map[$r,$b].hide
    $map[$r,$b].caption=""
 next
next

$Form.Width = $size*25+50
$Form.Height = $size*25+115
$Form.Center
$Time.Center
$Time.Top = 10
$start.left=$form.width-95

$c=1
for $r=0 to $size
 for $b=0 to $size
  if instr($mine,",$c ,"$map[$r,$b].caption="X" endif
  $c=$c+1
 next
next

for $r=0 to $size
 for $b=0 to $size
  if not instr($map[$r,$b].caption,"X")
    $=0
    if $b>0 and $r>0 if instr($map[$r-1,$b-1].caption,"X"$=$+1 endif endif
    if $r>0 if instr($map[$r-1,$b].caption,"X"$=$+1 endif endif
    if $b<$size and $r>0 if instr($map[$r-1,$b+1].caption,"X"$=$+1 endif endif
    if $b>0 if instr($map[$r,$b-1].caption,"X"$=$+1 endif    endif
    if $b<$size if instr($map[$r,$b+1].caption,"X"$=$+1 endif endif
    if $b>0 and $r<$size if instr($map[$r+1,$b-1].caption,"X"$=$+1 endif endif
    if $r<$size if instr($map[$r+1,$b].caption,"X"$=$+1 endif endif
    if $b<$size and $r<$size if instr($map[$r+1,$b+1].caption,"X"$=$+1 endif endif
    if $=0 $map[$r,$b].caption=" " else $map[$r,$b].caption=$ endif
  endif
 next
next
endfunction

_________________________
!

download KiXnet