def do_command(self, world, cmdline):
# Print a prompt, and read a command.
while True:
- if cmdline == "":
- cmdline = "\n"
cmd = cmdline[0].upper()
-
if cmd == '?':
print __doc__ % version, terrain_key
sys.stdout.write(`world`)
# Perform the game loop until the game is over.
try:
+ repeat = 1
while True:
sys.stdout.write(`world`)
# If we are jumping, just finish the line. Otherwise, check for
sys.stdout.write('\n')
else:
player.check_obstacles(world)
- player.do_command(world, raw_input("? "))
+ if repeat:
+ repeat -= 1
+ if repeat:
+ sys.stdout.write('\n')
+ else:
+ cmd = raw_input("? ")
+ if cmd == '':
+ cmd = '\n'
+ elif cmd[0] in "0123456789":
+ if cmd[-1] in "0123456789":
+ repeat = int(cmd)
+ cmd = '\n'
+ else:
+ repeat = int(cmd[:-1])
+ cmd = cmd[-1]
+ player.do_command(world, cmd)
world.manipulate_objects(player)
world.update_level(player)
player.update_player()
Name: ski
-Version: 6.3
+Version: 6.4
Release: 1
URL: http://www.catb.org/~esr/ski/
Source0: %{name}-%{version}.tar.gz
Group: Games
Summary: a hotdogging game, evade the deadly Yeti on your jet-powered skis
BuildRoot: %{_tmppath}/%{name}-root
+BuildArch: noarch
+#Keywords: game, solitaire
%description
Imagine you are skiing down an infinite slope, facing such hazards as
%setup -q
%build
-make ski.6
+make %{?_smp_mflags} ski.6
%install
[ "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf "$RPM_BUILD_ROOT"
%{_bindir}/ski
%changelog
+* Sun Jan 11 2004 Eric S. Raymond <esr@snark.thyrsus.com> 6.4-1
+- Game commands now accept numeric repeat prefixes.
+
* Sat Jan 3 2004 Eric S. Raymond <esr@snark.thyrsus.com> 6.3-1
- Fix bug introduced to teleport command in 6.2.