What do you want to save?
Add Code snippet
New code examples
-
Python 2021-10-25 05:13:14
what is pygame userevent
import pygame from pygame import display, font, time, mouse, draw from pygame.math import Vector2 import random import sys class Snake: def __init__(self): self.body = [Vector2(5, 10), Vector2(6, 10), Vector2(7, 10)] self.direction = ... Add solution -
Python 2021-10-21 18:37:09
snake python
import pygame import numpy import random import math pygame.init() clock = pygame.time.Clock() screen = pygame.display.set_mode((377, 377)) grid = numpy.zeros((15, 15), dtype="int8") for i in range(4): grid[7][2+i] = 2 apple_pos = [7, 11] gr... Add solution -
Other 2021-10-19 09:27:07
how to change color of square in pygame with keypress
#Import statements are to enable the code to use the functions from the library import pygame import sys import os import random #instructions to windows to center the game window in the center of #the screen, which it might ignore os.environ["SDL_V... Add solution -
Python 2021-10-19 07:24:07
how to make a number guessing game in python
# updated version import random # for instructions so that the user understands def instructions(): print("Welcome to the guessing game you will have 3 tries to pick a number 1-10") print("Good luck btw it's all random") inst... Add solution -
Python 2021-10-18 03:18:11
python lottery 6 out of 49
import random correct = 0 total = 0 run = 1 howmany = int(input("How many correct guesses should there be? (0-6) ")) if howmany < 0: print("That was below 0.") quit() elif howmany > 6: print("That was over 6.&... Add solution
Best helpers
Ranking is empty