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
67f953c5
Kaydet (Commit)
67f953c5
authored
Kas 26, 2010
tarafından
Senthil Kumaran
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
s/colour/color/g
üst
31717e8a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
life.py
Demo/curses/life.py
+3
-3
No files found.
Demo/curses/life.py
Dosyayı görüntüle @
67f953c5
#!/usr/bin/env python3
#!/usr/bin/env python3
# life.py -- A curses-based version of Conway's Game of Life.
# life.py -- A curses-based version of Conway's Game of Life.
# Contributed by AMK
# Contributed by AMK
# Mouse support and colo
u
r by Dafydd Crosby
# Mouse support and color by Dafydd Crosby
#
#
# An empty board will be displayed, and the following commands are available:
# An empty board will be displayed, and the following commands are available:
# E : Erase the board
# E : Erase the board
...
@@ -148,7 +148,7 @@ def display_menu(stdscr, menu_y):
...
@@ -148,7 +148,7 @@ def display_menu(stdscr, menu_y):
"Display the menu of possible keystroke commands"
"Display the menu of possible keystroke commands"
erase_menu
(
stdscr
,
menu_y
)
erase_menu
(
stdscr
,
menu_y
)
# If colo
u
r, then light the menu up :-)
# If color, then light the menu up :-)
if
curses
.
has_colors
():
if
curses
.
has_colors
():
stdscr
.
attrset
(
curses
.
color_pair
(
1
))
stdscr
.
attrset
(
curses
.
color_pair
(
1
))
stdscr
.
addstr
(
menu_y
,
4
,
stdscr
.
addstr
(
menu_y
,
4
,
...
@@ -164,7 +164,7 @@ def keyloop(stdscr):
...
@@ -164,7 +164,7 @@ def keyloop(stdscr):
menu_y
=
(
stdscr_y
-
3
)
-
1
menu_y
=
(
stdscr_y
-
3
)
-
1
display_menu
(
stdscr
,
menu_y
)
display_menu
(
stdscr
,
menu_y
)
# If colo
u
r, then initialize the color pairs
# If color, then initialize the color pairs
if
curses
.
has_colors
():
if
curses
.
has_colors
():
curses
.
init_pair
(
1
,
curses
.
COLOR_BLUE
,
0
)
curses
.
init_pair
(
1
,
curses
.
COLOR_BLUE
,
0
)
curses
.
init_pair
(
2
,
curses
.
COLOR_CYAN
,
0
)
curses
.
init_pair
(
2
,
curses
.
COLOR_CYAN
,
0
)
...
...
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