Write Your First Python Game Code - Simple Multiplication Game Project смотреть онлайн
Let me know if you edit this script yourself to make a better version! This was something I coded up quickly so I'm sure it can be improved. There's a lot more examples of simple python games that can be found on GitHub. Here's a repo you might find interesting:
https://github.com/grantjenks/free-python-games
Hey Everyone! In this one we'll go over quite a few small topics:
- Python Game logic
- Python progressive difficulty
- While Loops
- If statements
- How to use Python Random
- How to use Python functools
- How to use python sleep
- breaking/continuing while loops
Time module: https://docs.python.org/3.7/library/time.html
Random Module: https://docs.python.org/3/library/random.html
Functools: https://docs.python.org/3/library/functools.html
Math Module: https://docs.python.org/3/library/math.html
Thanks so much for the support! You guys are awesome - here's your daily reminder, haha. 4,370 subscribers at the time of writing, how incredible. Thanks so much for all the kind words across all the videos, I read and try to respond to every comment I can.
*****************************************************************
Full code from the video:
import time
import functools
import operator
import random
import math
print('Number Time quiz!')
time.sleep(2)
print('Answer the multiplcation 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_progression = math.floor(score/10)
overall_difficulty = difficulty_setting + difficulty_progression
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
https://github.com/Derrick-Sherrill/DerrickSherrill.com/blob/master/multiplicationgame.py
*****************************************************************
Code from this tutorial and all my others can be found on my GitHub:
https://github.com/Derrick-Sherrill/DerrickSherrill.com
Check out my website:
https://www.derricksherrill.com/
If you liked the video - please hit the like button. It means more than you know. Thanks for watching and thank you for all your support!!
Always looking for suggestions on what video to make next -- leave me a comment with your project! Happy Coding!
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Write Your First Python Game Code - Simple Multiplication Game Project» бесплатно и без регистрации, вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.