From cb325f749d0286d523f0a78309699fa3d732cf01 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 24 Nov 2010 01:02:11 -0500 Subject: [PATCH] Add a pychecker check and fix two small problems it turned up. --- Makefile | 5 +++++ ski | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 21d6ecf..71369bb 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,11 @@ ski.html: ski.xml clean: rm -f *~ *.6 *.html *.rpm *.lsm MANIFEST SHIPPER.* +pychecker: + @ln -f ski ski.py + @-pychecker --only --limit 50 ski.py + @rm -f ski.py* + ski-$(VERS).tar.gz: $(SOURCES) @ls $(SOURCES) | sed s:^:ski-$(VERS)/: >MANIFEST @(cd ..; ln -s ski ski-$(VERS)) diff --git a/ski b/ski index 5d5b90c..17f92a2 100755 --- a/ski +++ b/ski @@ -152,7 +152,7 @@ class SkiWorld: "Return a random location" return random.choice(range(len(self.slope))) - def gen_next_slope(self, next_level): + def gen_next_slope(self): # Generates the slope of the next level, dependent upon # the characteristics of the current level, the probabilities, and the # position of the player. @@ -218,7 +218,7 @@ class SkiWorld: player.player_speed + len(self.slope)) % len(self.slope) # Generate the updated slope. - self.gen_next_slope(self) + self.gen_next_slope() # If there is no Yeti, one might be created. if not exists(self.yeti) and percent(self.prob_yeti_appearance): @@ -374,7 +374,7 @@ class SkiPlayer: def check_obstacles(self, world): # If we are just landing after a jump, we might fall down. if (self.jump_count == 0) and percent(PROB_BAD_LANDING): - self.__accident("Whoops! A bad landing!", LIGHT_INJURY) + self.__accident("Whoops! A bad landing!", SLIGHT_INJURY) # If there is a tree in our position, we might hit it. if (world.terrain() == REP_TREE) and percent(PROB_HIT_TREE): -- 2.43.0