Skip to content

Instantly share code, notes, and snippets.

import pygame
from constants import *
class Button:
def __init__(self, text, x, y, font_name='Arial', font_size=18, color=(255, 255, 255),
background_color=(0, 0, 255), hover_color=(0, 102, 255), padding=10):
self.font = pygame.font.SysFont(font_name, font_size)
self.text_surface = self.font.render(text, True, color)
self.padding = padding
self.set_background_color(background_color)
import pygame
WIDTH = 300
HEIGHT = 250
FPS = 60
pygame.init()
screen = pygame.display.set_mode((WIDTH, HEIGHT))
clock = pygame.time.Clock()
running = True
while running:
for event in pygame.event.get():
def delete_single_edge():
for i in range(len(matrix)):
if sum(matrix[i]) <= 1:
for j in range(len(matrix[i])):
if matrix[i][j] == 1:
matrix[i][j] = 0
matrix[j][i] = 0
global isSomeEdgeDeleted
isSomeEdgeDeleted = True
break
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<center>
<input type="text" id="input">
<button onclick="MakeRandom()">
Рандом
program balloons;
var amount, maxWeigth, i, minimum, currentWeigth, maximum, outputAmount, minimumIndex:integer;
weigth: array of integer;
isMax:boolean;
begin
readln(amount, maxWeigth);
setlength(weigth, maxWeigth);
maximum:=0;
for i := 1 to amount do begin
read(weigth[i]);
program mushrooms;
var input:integer;
output1, output2, output3:real;
begin
readln(input);
if (input mod 2 = 0) then begin
output1 := trunc(input/3.3);
output2 := output1;
end
else begin
program n7;
var n, i, ed, des, sot, tis, number:integer;
begin
readln(n);
for i:=1 to n do begin
ed:=i mod 10;
des:= (i mod 100) div 10;
sot:= (i div 100) mod 10;
tis:= i div 1000;
if ed=0 then ed:=1;
program n7;
var num, mnj:integer;
begin
mnj:=1;
while(num<100000) do begin
num:=(mnj*133)-8;
mnj:=mnj+1;
if num>9999 then
if num mod 134 = 111 then
writeln(num);
program n6;
var n, i:integer;
begin
readln(n);
for i:=1 to n do
writeln(random(1000));
end.