## Module 02 Extra Practice
# Part 1 - Warm up questions

# Write a function that consumes three integers and returns True if each of the consumed integers is not zero, and False otherwise.
# Solve this question twice
# once while using any of and/or/not == != but nothing else.
# once without using and/or/not


## Write the Python exercise it_depends that consumes an integer, n, 
## and returns:
## * the string "ODD-THREE" if n is an odd multiple of 3
## * the string "EVEN-THREE" if n is an even multiple of 3
## * the string "Neither" otherwise

def it_depends(n):
    pass

## Write the Python exercise repeat_str that consumes a string, s, and 
## a natural number, n, and returns the string containing n copies of s.
## Implement repeat_str using recursion. Do not use the Str-Nat * operation,
## regardless of how cool that operation is. 

def repeat_str(s,n):
    pass

# Part 2 - Extra Practice
## Question 1:
## Write the Python function collatz_step that consumes a Natural number n
## and returns the integer n/2 if n is even, and 3n+1 if n is odd.

def collatz_step(n):
    pass

## Question 2:
## Write the Python function sum_to that consumes n and returns the 
## sum from 1 to n, using recursion.

def sum_to(n):
    pass 

## Question 3:
## Consider the Yahtzee game, where players throw 5 dice in an attempt to earn
## points in various categories. Assume each die value is an integer between 
## 1 and 6, inclusive.
## 
## a) Write a function num_matches that consumes 5 dice values (1-6) and a single 
##    value, d, and returns the number of times d appears among the dice values.
##    Do not make any assumptions on the values of the 5 dice.

def num_matches(d1,d2,d3,d4,d5,d):
    pass

## b) Assume each of the following functions consumes 5 integer values,
##    for the dice values, d1,d2,d3,d4,d5. You may assume that 
##    d1 <= d2 <= d3 <= d4 <= d5
##    Each function returns False if the True condition is not met.
##
## - is_yahtzee returns True if all values are the same, 

def is_yahtzee(d1,d2,d3,d4,d5):
    pass

## - is_4_of_a_kind returns True if at least 4 of the values are the same,

def is_4_of_a_kind(d1,d2,d3,d4,d5):
    pass

## - is_3_of_a_kind returns True if at least 3 of the values are the same,

def is_3_of_a_kind(d1,d2,d3,d4,d5):
    pass

## - is_full_house returns True if 3 values are the same, and the other two match
##   each other as well (i.e. three of a kind and a pair)

def is_3_of_a_kind(d1,d2,d3,d4,d5):
    pass

## - is_large_straight returns True if the dice form the sequence 1-2-3-4-5 or
##   2-3-4-5-6

def is_large_straight(d1,d2,d3,d4,d5):
    pass

## - is_small_straight returns True if the dice include one of the sequences
##   1-2-3-4, 2-3-4-5, 3-4-5-6
##   (this one is a bit trickier than it seems)

def is_small_straight(d1,d2,d3,d4,d5):
    pass

## c) Repeat all the functions from part b), but without the assumption that 
##    the dice values are "in order". (this is a LOT harder)


## Question 4
## Write a Python function any_prime_in_range, that consumes two natural
## numbers, lower and upper, where lower <= upper, and returns True if there
## are any prime numbers p satisfying lower <= p <= upper, and False
## otherwise.

def any_prime_in_range(lower, upper):
    pass

## Question 5
## Write a Python function is_perfect, that consumes a natural number n
## and returns True if n is a perfect number, and False otherwise.
## A number is considered perfect if the sum of all its divisors (other than itself)
## is n. For example, 6 is a perfect number since 1 + 2 + 3 = 6. 

def is_perfect(n):
    pass


## Question 6
## Write a Python function ticket_total which calculates the
## total cost for a group of movie tickets. The function consumes
## the movie time ("matinee" vs "evening") as well as the 
## number of child, adult, and seniors tickets being bought.
## For an evening movie, an adult ticket costs 11.95. Seniors
## receive a $2 discount, and children receive a $4 discount, per 
## ticket. All tickets at a matinee cost $5 each.
## There is also a service charge for buying on-line:
## $1 per ticket, if less than 4 tickets are bought, or
## $4 total if 4 or more are bought.
## example: ticket_total("evening", 0,1,0) => 12.95
## example: ticket_total("matinee", 5,2,1) => 44.00

def ticket_total(time, child, adult, senior):
    pass