# ==============================================================================
"""HUNT : the classical treasure hunt game"""
# ==============================================================================
__author__  = "Christophe Schlick"
__version__ = "0.0" # skeleton version
__date__    = "2021-03-01"
# ==============================================================================
from ezTK import *
from random import randrange as rr
# ------------------------------------------------------------------------------
def main(rows=12, cols=18):
  """create the main window and pack the widgets"""
  global win
  win = Win(title='HUNT', op=3, click=on_click) # create main window
  colors = ('#F00','#FF0','#0F0','#0CF','#CCC','#FFF') # colors for board cells
  # ----------------------------------------------------------------------------
  # TODO (use 1 Frame, (rows*cols) Labels, 1 Button)
  # ----------------------------------------------------------------------------
  win.rows, win.cols, win.board = rows, cols, board # store game parameters
  on_reset(); win.loop() # set initial configuration and start event loop
# ------------------------------------------------------------------------------
def on_reset():
  """callback function for the "RESET" button"""
  # TODO (reset all grid cells and select random cell to hide treasurein)
# ------------------------------------------------------------------------------
def on_click(widget, code, mods):
  """callback function for all mouse click events"""
  # TODO (check if click is on a cell, then call distance() with cell coords)
# ------------------------------------------------------------------------------
def distance(row, col):
  """change color of provided cell according to its distance from goal"""
  # TODO (show goal distance on selected cell, change cell color accordingly)
# ==============================================================================
if __name__ == '__main__':
  main() # use default size for grid
  #main(20,30) # try with larger grid
# ==============================================================================
