Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
311562ac
Kaydet (Commit)
311562ac
authored
Haz 03, 2006
tarafından
Andrew M. Kuchling
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use true division, and the True value
üst
98900bc7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
tclock.py
Demo/curses/tclock.py
+13
-12
No files found.
Demo/curses/tclock.py
Dosyayı görüntüle @
311562ac
...
@@ -14,7 +14,8 @@ def sign(_x):
...
@@ -14,7 +14,8 @@ def sign(_x):
return
1
return
1
def
A2XY
(
angle
,
radius
):
def
A2XY
(
angle
,
radius
):
return
int
(
round
(
ASPECT
*
radius
*
sin
(
angle
))),
int
(
round
(
radius
*
cos
(
angle
)))
return
(
int
(
round
(
ASPECT
*
radius
*
sin
(
angle
))),
int
(
round
(
radius
*
cos
(
angle
))))
def
plot
(
x
,
y
,
col
):
def
plot
(
x
,
y
,
col
):
stdscr
.
addch
(
y
,
x
,
col
)
stdscr
.
addch
(
y
,
x
,
col
)
...
@@ -37,9 +38,9 @@ def dline(pair, from_x, from_y, x2, y2, ch):
...
@@ -37,9 +38,9 @@ def dline(pair, from_x, from_y, x2, y2, ch):
y
=
from_y
y
=
from_y
if
ax
>
ay
:
if
ax
>
ay
:
d
=
ay
-
ax
/
2
d
=
ay
-
ax
/
/
2
while
1
:
while
True
:
plot
(
x
,
y
,
ch
)
plot
(
x
,
y
,
ch
)
if
x
==
x2
:
if
x
==
x2
:
return
return
...
@@ -50,9 +51,9 @@ def dline(pair, from_x, from_y, x2, y2, ch):
...
@@ -50,9 +51,9 @@ def dline(pair, from_x, from_y, x2, y2, ch):
x
+=
sx
x
+=
sx
d
+=
ay
d
+=
ay
else
:
else
:
d
=
ax
-
ay
/
2
d
=
ax
-
ay
/
/
2
while
1
:
while
True
:
plot
(
x
,
y
,
ch
)
plot
(
x
,
y
,
ch
)
if
y
==
y2
:
if
y
==
y2
:
return
return
...
@@ -78,12 +79,12 @@ def main(win):
...
@@ -78,12 +79,12 @@ def main(win):
curses
.
init_pair
(
2
,
curses
.
COLOR_MAGENTA
,
my_bg
)
curses
.
init_pair
(
2
,
curses
.
COLOR_MAGENTA
,
my_bg
)
curses
.
init_pair
(
3
,
curses
.
COLOR_GREEN
,
my_bg
)
curses
.
init_pair
(
3
,
curses
.
COLOR_GREEN
,
my_bg
)
cx
=
(
curses
.
COLS
-
1
)
/
2
cx
=
(
curses
.
COLS
-
1
)
/
/
2
cy
=
curses
.
LINES
/
2
cy
=
curses
.
LINES
/
/
2
ch
=
min
(
cy
-
1
,
int
(
cx
/
ASPECT
)
-
1
)
ch
=
min
(
cy
-
1
,
int
(
cx
/
/
ASPECT
)
-
1
)
mradius
=
(
3
*
ch
)
/
4
mradius
=
(
3
*
ch
)
/
/
4
hradius
=
ch
/
2
hradius
=
ch
/
/
2
sradius
=
5
*
ch
/
6
sradius
=
5
*
ch
/
/
6
for
i
in
range
(
0
,
12
):
for
i
in
range
(
0
,
12
):
sangle
=
(
i
+
1
)
*
2.0
*
pi
/
12.0
sangle
=
(
i
+
1
)
*
2.0
*
pi
/
12.0
...
@@ -96,7 +97,7 @@ def main(win):
...
@@ -96,7 +97,7 @@ def main(win):
sradius
=
max
(
sradius
-
4
,
8
)
sradius
=
max
(
sradius
-
4
,
8
)
while
1
:
while
True
:
curses
.
napms
(
1000
)
curses
.
napms
(
1000
)
tim
=
time
.
time
()
tim
=
time
.
time
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment