Zbekiston respublikasi axborot texnologiyalar va kommunikatsiyalarini rivojlantirish vazirligi


Download 75.77 Kb.
Sana26.11.2020
Hajmi75.77 Kb.
#152393
Bog'liq
Abudulatif


O`ZBEKISTON RESPUBLIKASI AXBOROT TEXNOLOGIYALAR VA

KOMMUNIKATSIYALARINI RIVOJLANTIRISH VAZIRLIGI

MUHAMMAD AL-XORAZMIY NOMIDAGI

TOSHKENT AXBOROT TEXNOLOGIYALARI UNIVERSITETI

Kompyuter grafikasifani bo`yicha

LABORATORIYA ISHI-1



Bajardi: 221-18 guruh talabasi Islamov Abdulatif

Topshiriq:Ismini3D ko'rinishdayozish,ko'chirishvamasshtablashfunksiyalaridanfoydalanish.

So'z: Ahmadjon

1.Dasturkodi:Ko’chirishfunksiyasi

import turtle

import random

from alphabet import alphabet

myPen = turtle.Turtle()

myPen.hideturtle()

myPen.speed(0)

window = turtle.Screen()

window.bgcolor("#000000")

myPen.pensize(1)

def displayMessage(message,fontSize,color,x,y):

myPen.color(color)

message=message.upper()

for character in message:

if character in alphabet:

letter=alphabet[character]

myPen.penup()

for dot in letter:

myPen.goto(x + dot[0]*fontSize, y + dot[1]*fontSize)

myPen.pendown()

x += fontSize

if character == " ":

x += fontSize

x += characterSpacing

#Main Program Starts Here

fontSize = 30

characterSpacing = 5

fontColor = "#FF00FF"

message = "Abdulatif"

displayMessage(message,fontSize,fontColor,-190,0)

displayMessage(message,fontSize,fontColor,-187,4)

displayMessage(message,fontSize,fontColor,-190,-100)



displayMessage(message,fontSize,fontColor,-187,-96)



Natija:


Download 75.77 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling