Skip to content

ship-Gitty/game_project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

game_project

import time import functools import operator import random import math

print('Time for Quiz!') time.sleep(2) print('Answer the maths problems before time runs out!') time.sleep(3) print('Ready? Go!') start_time = time.time()

score = 0

Game Logic

while True: difficulty_setting = 2 difficulty_progession = math.floor(score/10) overall_difficulty = difficulty_setting + difficulty_progession

numbers_list = []
for x in range(overall_difficulty):
    value = random.randint(1,9)
    numbers_list.append(value)

answer = functools.reduce(operator.mul, numbers_list, 1)
print('Multiple these numbers' , numbers_list)

guess = int(input())

if guess == "answer":
    score = score + (1 * overall_difficulty)
    continue

else:
    print('Game over! The answer was', answer)
    elapsed_time = time.time() - start_time
    print('Your score was', score, 'In only', elapsed_time)
    break

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published