def draw_row(tortoise, color1, color2): t = tortoise for i in range(int(8 / 2)): width = 50 t.fillcolor(color1) t.begin_fill() square.draw_square(t, width) t.end_fill() t.forward(width) t.fillcolor(color2) t.begin_fill() square.draw_square(t, width) t.end_fill() t.forward(width)
def get_sprites(self): sprites = [] squares = self.tetromino.get_position() for square in squares: pos_x = square[0] pos_y = square[1] x = pos_x * BLOCK_WIDTH + PLAYFIELD_COORD_X y = pos_y * BLOCK_WIDTH + PLAYFIELD_COORD_Y sprites.append(draw_square(x, y, self.batch, self.tetromino.color)) squares = self.tetrion.get_squares() for square in squares: pos_x = square[0] pos_y = square[1] x = pos_x * BLOCK_WIDTH + PLAYFIELD_COORD_X y = pos_y * BLOCK_WIDTH + PLAYFIELD_COORD_Y sprites.append(draw_square(x, y, self.batch, self.tetrion.color)) return sprites
def main(): square = get_square() draw_square(square)
from turtle import * import coordinates import square import linear import quadratic border = {"width": 620, "height": 620} # draw square and coordinate print("< Jeffrey's Plotting Software >") print("drawing rectangular coordinates...") square.draw_square(border["width"], border["height"], -310, -300) penup() setx(0) sety(0) pendown() coordinates.draw_coordinate() draw_finished = False while not draw_finished: function_type = int(input("linear : 1, quadratic : 2 ")) if (function_type == 1): slope = int(input("type the slope : ")) y_incpt = int(input("type the y intercept : ")) linear.linear(slope, y_incpt) if (function_type == 2): a = float(input("type a : ")) b = int(input("type b : ")) c = int(input("type c : ")) quadratic.quadratic(a, b, c) draw_ends = input("press N to finish drawing. ")
def draw(square): draw_square(square)
from turtle import * from square import draw_square for i in range(30): draw_square(i * 5, 'red') left(17) penup() forward(i * 2) pendown()
def draw(self): draw_square(self)
import turtle from square import draw_square from triangle import * from circle import draw_circle from config import * window = turtle.Screen() window.screensize(canvwidth=500, canvheight=500, bg="black") pencil = turtle.Turtle() configPencil(pencil, 6) draw_square(pencil, 300, 90) pencil.fd(150) draw_circle(pencil, 150) moveTurtleBeforeTriangle(pencil, 300, 90) pencil.left(116.5) draw_triangle(pencil, 335, 116.5) window.exitonclick()
from turtle import * from square import draw_square for i in range(30): draw_square(i * 5, "red") left(17) penup() forward(i * 2) pendown()