This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| import pygame | |
| WHITE = 255, 255, 255 | |
| BLACK = 0, 0, 0 | |
| whole_note_image = pygame.Surface((20, 20)) | |
| whole_note_rect = whole_note_image.get_rect() | |
| whole_note_image.fill(WHITE) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Game: | |
| def __init__(self): | |
| self.player = Player() | |
| self.extra_lives = 3 | |
| self.running = False | |
| def run(self): | |
| self.running = True | |
| while self.running |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pprint | |
| import pygame | |
| pygame.init() | |
| BACKGROUND_COLOR = 184, 122, 0 | |
| display = pygame.display.set_mode((600, 400)) | |
| display.fill(BACKGROUND_COLOR) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from flask import Flask, render_template_string, jsonify, request | |
| app = Flask("jsontest") | |
| @app.route("/post", methods=["POST"]) | |
| def post(): | |
| return jsonify(request.json) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from inspect import signature | |
| class Example: | |
| def __repr__(self): | |
| val = lambda x: f"{x}={getattr(self, x)!r}" | |
| parameters = ", ".join(val(param) for param in signature(type(self)).parameters) | |
| return f"{type(self).__name__}({parameters})" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Title</title> | |
| </head> | |
| <body> | |
| <header><h1>Look at me, I'm a header!</h1></header> | |
| <div class="board"> | |
| <div class="box"></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Title</title> | |
| <style> | |
| .box { | |
| height: 100px; | |
| width: 100px; | |
| top: 100px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pygame, sys | |
| import math | |
| from ppb_vector import Vector2 as Vector | |
| #Colours | |
| BLACK = (0, 0, 0) | |
| WHITE = (255, 255, 255) | |
| BLUE = (217, 231, 249) | |
| GOLD = (255, 255, 0) | |
| PURPLE = (202, 90, 155) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pygame | |
| from itertools import cycle | |
| import math | |
| RESOLUTION = (800, 800) | |
| BITS = 16 | |
| MAX_SAMPLE = 2**(BITS - 1) - 1 | |
| LEFT_FREQUENCY = 0 | |
| RIGHT_FREQUENCY = 262 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pygame | |
| from itertools import cycle | |
| import math | |
| RESOLUTION = (800, 800) | |
| BITS = 16 | |
| MAX_SAMPLE = 2**(BITS - 1) - 1 | |
| LEFT_FREQUENCY = 0 | |
| RIGHT_FREQUENCY = 450 |