generated from mwc/project_drawing
67 lines
1.1 KiB
Python
67 lines
1.1 KiB
Python
# drawing.py
|
|
# ----------
|
|
# By ____(you)___________
|
|
#
|
|
# (Briefly describe what this program does.)
|
|
|
|
from turtle import *
|
|
from argparse import ArgumentParser
|
|
import turtle
|
|
|
|
def draw_ring(ring):
|
|
radius = ring*50
|
|
circle(radius,360)
|
|
penup()
|
|
right(90)
|
|
forward(50)
|
|
left(90)
|
|
pendown()
|
|
|
|
|
|
def draw_electron():
|
|
pencolor("red")
|
|
turtle.dot(15)
|
|
|
|
def return_to_center():
|
|
penup()
|
|
turtle.goto(0,0)
|
|
|
|
'''def position_electrons(number):
|
|
return_to_center()
|
|
|
|
|
|
circle(radius*2,360)
|
|
penup()
|
|
right(90)
|
|
forward(50)
|
|
left(90)
|
|
pendown()
|
|
circle(radius*3)'''
|
|
|
|
|
|
'''parser= ArgumentParser("python drawing.py")
|
|
parser.add_argument("radius", type=int)
|
|
args = parser.parse_args()'''
|
|
|
|
|
|
for ring in range(4): #draws rings
|
|
draw_ring(ring)
|
|
return_to_center() #returns to center
|
|
forward(50)
|
|
draw_electron()
|
|
back(100)
|
|
draw_electron()
|
|
return_to_center()
|
|
forward(100)
|
|
draw_electron()
|
|
back(200)
|
|
draw_electron()
|
|
return_to_center()
|
|
right(90)
|
|
forward(100)
|
|
draw_electron()
|
|
back(200)
|
|
draw_electron()
|
|
input()
|
|
|