海龟画恐龙字符画

海龟画恐龙字符画


下面是部分代码预览:

"""
   海龟画恐龙字符画,本程序会根据字符列表绘制作一个恐龙像素画
"""

import tkinter as tk
from turtle import Turtle, Screen


character_list = [
    ",,,,,,,,,,,,,,,,,,,,,,,,,",
    ",,,,,,****,,,,,,,,,*,,,,,",
    ",,,,,*!!!!*,,,,,,,*¤*,,,,",
    ",,,,*!!!!!!*,,,,,,*¤¤*,,,",
    ",,,,*!!!!!!*,,,,,,*¤¤*,,,",
    ",,,*!!!!!!!!*,,,,*¤¤¤¤*,,",
    ",,*!!!!,*!!!*,,,,*¤¤%¤*,,",
    ",,*!!!!**!!!!*,,,*¤%%¤*,,",
    ",,*!!!!**!!!!*,,,,*%**,,,",
    ",,,*!!!!!!!!!!*,,,*!*,,,,",
    ",,,,**!!!!!!!!!*,*!!*,,,,",
    ",,,,,,***!!*!!!**!!*,,,,,",
    ",,,,,,,*%%*!!!!!*!!*,,,,,",
    ",,,,,,,*%%%**!!!*!*,,,,,,",
    ",,,,,,*,*%%%!!!!**,,,,,,,",
    ",,,,,,,***%%!!!**,,,,,,,,",
    ",,,,,,,,,,***!**,,,,,,,,,",
    ",,,,,,,,,,,*,!,*,,,,,,,,,",
    ",,,,,,,,,,,,****,,,,,,,,,",
    ",,,,,,,,,,,,,,,,,,,,,,,,,"
]

colors = {
            ","  :  "white",
            "*"  :  "black",
            "!"  :  "orange",
            "¤"  :  "red",
            "%"  :  "yellow"
}
tk.ROUND = tk.BUTT
SCALE = 5 

screen = Screen()
screen.delay(0)
screen.title("海龟画恐龙字符画")
width = screen.window_width() / SCALE 
height = screen.window_height() / SCALE
screen.setworldcoordinates(-width//2, -height//2, width//2, height//2)

 
如需要查看完整源代码,请

成为会员后,登陆才能继续浏览!联系微信scratch8即可办理会员。
(会员专属:能浏览所有文章,下载所有带链接的Python资源。)

李兴球

李兴球的博客是Python创意编程原创博客

评论已关闭。