diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2014-06-30 20:09:24 (GMT) |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2014-06-30 20:09:24 (GMT) |
commit | f5ac57dc05818e4fe2ff5118680fe136937d768e (patch) | |
tree | 28c5be50f2bc8a0cdc6d77a61bf0bb079461c642 /Lib/turtledemo/nim.py | |
parent | 98b6391fd4b27485b17c068d6f85a00d3f7c5ddc (diff) | |
download | cpython-f5ac57dc05818e4fe2ff5118680fe136937d768e.zip cpython-f5ac57dc05818e4fe2ff5118680fe136937d768e.tar.gz cpython-f5ac57dc05818e4fe2ff5118680fe136937d768e.tar.bz2 |
Issue #21882: In turtle demos, remove module scope gui and sys calls by
either deleting or moving to the module's main function.
Diffstat (limited to 'Lib/turtledemo/nim.py')
-rw-r--r-- | Lib/turtledemo/nim.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/turtledemo/nim.py b/Lib/turtledemo/nim.py index 792ba51..25ff312 100644 --- a/Lib/turtledemo/nim.py +++ b/Lib/turtledemo/nim.py @@ -143,7 +143,6 @@ class NimView(object): self.writer.write(msg1, align="center", font=("Courier",14,"bold")) self.screen.tracer(True) - def setup(self): self.screen.tracer(False) for row in range(3): @@ -181,6 +180,7 @@ class NimView(object): if self.game.state == Nim.OVER: self.screen.clear() + class NimController(object): def __init__(self, game): @@ -201,6 +201,7 @@ class NimController(object): self.game.model.notify_move(row, col) self.BUSY = False + class Nim(object): CREATED = 0 RUNNING = 1 @@ -213,11 +214,10 @@ class Nim(object): self.controller = NimController(self) -mainscreen = turtle.Screen() -mainscreen.mode("standard") -mainscreen.setup(SCREENWIDTH, SCREENHEIGHT) - def main(): + mainscreen = turtle.Screen() + mainscreen.mode("standard") + mainscreen.setup(SCREENWIDTH, SCREENHEIGHT) nim = Nim(mainscreen) return "EVENTLOOP!" |