def main(right, down):
    map = []
    x = 0
    y = 0
    trees = 0
    repeatLength = 0
    mapLength = 0
    f = open("map", "r")
    f1 = f.readlines()
    for line in f1:
        array = list(line)
        if '\n' in array:
            array.remove('\n')
        # print(array)
        map.append(array)

    repeatLength = len(array)
    mapLength = len(map)

    for y in range(0, mapLength, down):
        if (map[y][x] == '#'):
            trees += 1
        x += right
        if x >= repeatLength:
            x = x - repeatLength
        y += down

    print('The number of trees: ')
    print(trees)
    return trees
Beispiel #2
0
def is_joiner_missing_word(word1, word2):
    array = []
    for i in word2:
        array.append(i)
    for i in word1:
        if i in array:
            array.remove(i)

    if len(array) > 0:
        if array[0] == '\u200d':
            return True
        else:
            return False
    else:
        return False
Beispiel #3
0
def is_papili_missing_word(word1, word2):
    array = []
    for i in word2:
        array.append(i)
    for i in word1:
        if i in array:
            array.remove(i)

    if len(array) > 0:
        if array[0] == 'ු' or array[0] == 'ූ' or array[0] == '්' or array[0] == 'ා' or array[0] == 'ි' or array[0] == 'ී' or array[0] == 'ී' or array[0] == 'ෑ' or array[0] == 'ැ':
            return True
        else:
            return False
    else:
        return False