From: Eric S. Raymond Date: Wed, 24 Nov 2010 06:02:11 +0000 (-0500) Subject: Add a pychecker check and fix two small problems it turned up. X-Git-Tag: 6.8~13 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=cb325f749d0286d523f0a78309699fa3d732cf01;p=ski.git Add a pychecker check and fix two small problems it turned up. --- 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):