# Exploring Languages with Interpreters and Functional Programming
# Copyright (C) 2018, H. Conrad Cunningham

# Modular programming example from Chapter 2

#234567890123456789012345678901234567890123456789012345678901234567890

# 2018-07-04: Developed prototype for modular example

# python3 CountingMod.py

count =  0
maxc  = 10

def has_more(count,maxc):
    return count <= maxc 

def incr():
    global count 
    count = count + 1

def counter():
    while has_more(count,maxc):
        print(f'{count}')
        incr()

# Testing
if __name__ == '__main__':
    counter()

