# Path: wordclock_plugins/snake/Snakeobject.py
# class Snakeobject:
# 
#     def __init__(self, cols, rows):
#         self.data = {}
#         self.data["cols"] = cols
#         self.data["rows"] = rows


import os
import time
import random
import sys
import re
import wordclock_tools.wordclock_colors as wcc
from .Snakeobject import Snakeobject
        for row in range(rows):
            snakeBoard += [[0] * cols]
        snakeBoard[int(rows/2)][int(cols/2)+3] = 1
        sn.data["snakeBoard"] = snakeBoard
        
        for i in range(4):
            self.findSnakeHead(sn)
            headRow = int(sn.data["headRow"])
            headCol = int(sn.data["headCol"])
            newHeadCol = headCol-1
            snakeBoard[headRow][newHeadCol] = 1 + snakeBoard[headRow][headCol];
            sn.data["headCol"] = newHeadCol
            sn.data["snakeBoard"] = snakeBoard
            
        
        self.placeFood(sn)
        
    def init(self, sn, wcd):
        self.loadSnakeBoard(sn)
        sn.data["isGameOver"] = False
        sn.data["snakeDrow"] = 0
        sn.data["snakeDcol"] = -1 # start moving left
        sn.data["ignoreNextTimerEvent"] = False
        sn.data["points"] = 0
        self.redrawAll(sn, wcd)
        
    def run(self, wcd, wci):
        '''
        Init snake game with rows and cols setup
        '''

# Path: wordclock_plugins/snake/Snakeobject.py
# class Snakeobject:
# 
#     def __init__(self, cols, rows):
#         self.data = {}
#         self.data["cols"] = cols
#         self.data["rows"] = rows


# Path: wordclock_plugins/snake/plugin.py
import os
import time
import random
import sys
import re
import wordclock_tools.wordclock_colors as wcc
from .Snakeobject import Snakeobject

        for row in range(rows):
            snakeBoard += [[0] * cols]
        snakeBoard[int(rows/2)][int(cols/2)+3] = 1
        sn.data["snakeBoard"] = snakeBoard
        
        for i in range(4):
            self.findSnakeHead(sn)
            headRow = int(sn.data["headRow"])
            headCol = int(sn.data["headCol"])
            newHeadCol = headCol-1
            snakeBoard[headRow][newHeadCol] = 1 + snakeBoard[headRow][headCol];
            sn.data["headCol"] = newHeadCol
            sn.data["snakeBoard"] = snakeBoard
            
        
        self.placeFood(sn)
        
    def init(self, sn, wcd):
        self.loadSnakeBoard(sn)
        sn.data["isGameOver"] = False
        sn.data["snakeDrow"] = 0
        sn.data["snakeDcol"] = -1 # start moving left
        sn.data["ignoreNextTimerEvent"] = False
        sn.data["points"] = 0
        self.redrawAll(sn, wcd)
        
    def run(self, wcd, wci):
        '''
        Init snake game with rows and cols setup
        '''

        sn = Snakeobject(11,10)