# 9470ddedcd53cb985fcad266a956ded61625253ccf86fed7f91e7421a192ec6f Elan 1.2.0 guest default_profile valid

main
  let holes be new Array<of String>(10, " ")
  variable score set to 0
  while true
    let molePosition be randomInt(0, 9)
    call holes.put(molePosition, "*")
    print "Score: {score}"
    print "0  1  2  3  4  5  6  7  8  9"
    each hole in holes
      call printNoLine("{hole}  ")
    end each
    let stop be clock() + 2000
    while clock() < stop
      let k be getKey()
      if k is molePosition.asString() then
        print "Hit!"
        set score to score + 1
      end if
    end while
    call clearPrintedText()
    call holes.put(molePosition, " ")
  end while
end main
