Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 4ba686e

Browse files
Add files via upload
1 parent 951b380 commit 4ba686e

File tree

1 file changed

+148
-0
lines changed

1 file changed

+148
-0
lines changed

‎anhur.py

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
import turtle
2+
import math
3+
from time import strftime
4+
from random import *
5+
6+
### Setting up Osiris' Window
7+
8+
wn = turtle.Screen()
9+
osiris = turtle.Turtle()
10+
wn.screensize(10000, 10000)
11+
djet = strftime("%Y-%m-%d %H-%M-%S")
12+
13+
### SCREENSHOT COMMAND ON 'A' KEYBOARD PRESS ###
14+
15+
def ihy():
16+
ts = osiris.getscreen()
17+
osiris.hideturtle()
18+
ts.getcanvas().postscript(file="horus - " + djet +
19+
".eps", width=5000, height=5000)
20+
osiris.showturtle()
21+
print ('screenshot taken')
22+
turtle.onkey(ihy,"a")
23+
turtle.listen()
24+
25+
### CENTRE DOT COMMAND ON 'D' KEYBOARD PRESS ###
26+
27+
def yam():
28+
osiris.penup()
29+
osiris.goto(0,0)
30+
osiris.dot(3,'#0000FF')
31+
32+
turtle.onkey(yam,"d")
33+
turtle.listen()
34+
35+
'''
36+
#############################################################
37+
################## GEOMETRIC DEFINITIONS ####################
38+
################## START ####################
39+
#############################################################
40+
'''
41+
42+
#######################################
43+
### Anhur = Forward Facing Chevrons ###
44+
### Sky god and god of war ###
45+
#######################################
46+
47+
def anhur(anhur_y=1,anhur_start=50,anhur_no=6,
48+
anhur_size=100,anhur_spacing=15,
49+
anhur_pensize=1,anhur_color='#FF4444'):
50+
if anhur_y == 1:
51+
osiris.pensize(anhur_pensize)
52+
osiris.color(anhur_color)
53+
osirisTemporaryX = osiris.xcor()
54+
osirisTemporaryY = osiris.ycor()
55+
for anhur_c in range(anhur_no):
56+
osiris.penup()
57+
osiris.goto(osirisTemporaryX, osirisTemporaryY)
58+
osiris.setheading(osirisHeadingStart)
59+
osiris.forward((anhur_start) + (anhur_spacing * anhur_c))
60+
# This is marked here as it will mark the top chevron
61+
osirisCurrentX = osiris.xcor()
62+
osirisCurrentY = osiris.ycor()
63+
osiris.right(135)
64+
osiris.pendown()
65+
osiris.pensize(2)
66+
anhur_calsize = ((anhur_size) -
67+
((anhur_size/anhur_no) * anhur_c))
68+
osiris.forward(anhur_calsize)
69+
osiris.backward(anhur_calsize)
70+
osiris.right(90)
71+
osiris.forward(anhur_calsize)
72+
osiris.penup()
73+
osiris.goto(osirisCurrentX, osirisCurrentY)
74+
osiris.setheading(osirisHeadingStart)
75+
76+
77+
'''
78+
##############################################
79+
##############################################
80+
##################START#######################
81+
##############################################
82+
##############################################
83+
'''
84+
85+
#####################
86+
#CONFIGURING OSIRIS##
87+
#####################
88+
89+
osiris.speed(2)
90+
def osirisslow():
91+
osiris.speed(1)
92+
def osirismid():
93+
osiris.speed(4)
94+
def osirisquick():
95+
osiris.speed(0)
96+
turtle.onkey(osirisquick,"0")
97+
turtle.onkey(osirismid,"4")
98+
turtle.onkey(osirisslow,"1")
99+
turtle.listen()
100+
osiris.penup()
101+
osiris.setheading(90)
102+
osirisHeadingStart = osiris.heading()
103+
osiris.goto(0,0)
104+
105+
################
106+
#ROTATE SECTION#
107+
################
108+
109+
### SHU ### CONTROLS THE AMOUNT OF ROTATIONS
110+
111+
shu = 6
112+
113+
# if you want these on different diagonals - remember to divide it by SHU.
114+
# EG. First round = 90 when shu = 6
115+
# Second round = 60 when shu = 6
116+
osiris.setheading(90)
117+
for shu_a in range(shu):
118+
osiris.penup()
119+
osiris.goto(0,0)
120+
osiris.forward(150)
121+
osirisHeadingStart = osiris.heading()
122+
osirisStartingX = osiris.xcor()
123+
osirisStartingY = osiris.ycor()
124+
125+
### ANHUR ### FORWARD FACING CHEVONS
126+
anhur(anhur_y=1,anhur_start=50,anhur_no=6,
127+
anhur_size=100,anhur_spacing=15,
128+
anhur_pensize=1,anhur_color='#FF4444')
129+
130+
###################
131+
#COMMAND TO ROTATE#
132+
###################
133+
134+
osiris.setheading(osirisHeadingStart)
135+
osirisHeadingStart = osirisHeadingStart + (360/shu)
136+
osiris.setheading(osirisHeadingStart)
137+
138+
139+
'''
140+
##################################
141+
##################################
142+
################END###############
143+
##################################
144+
##################################
145+
'''
146+
147+
148+
turtle.done()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /