From 2bd533b27ded47fd6016c4165b1b0343f06d8dd2 Mon Sep 17 00:00:00 2001 From: Anna Wiggins Date: Thu, 22 Mar 2012 18:22:05 -0400 Subject: [PATCH] battleman.py: Change list_ function names to format_, since they return strings instead of printing --- battleman.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/battleman.py b/battleman.py index b4d7131..ec4a737 100755 --- a/battleman.py +++ b/battleman.py @@ -214,7 +214,7 @@ class Battle(): ret = 'Battle not yet started\n\n' ret = ret + 'Combatants\n==========\n' - ret = ret + self.list_combatants() + ret = ret + self.format_combatants() return ret @@ -259,7 +259,7 @@ class Battle(): # Returns a formatted string with all of the combatants - def list_combatants(self): + def format_combatants(self): ret = '' for g in self.groups: @@ -274,7 +274,7 @@ class Battle(): # Returns a formatted string with all of the combatants - def list_current_group(self): + def format_current_group(self): ret = '' g = self.groups[current] @@ -364,9 +364,9 @@ def do_prompt(): elif comm == 'a': print('Sorry, this is still a stub function.') elif comm == 'l': - print battle.list_combatants() + print battle.format_combatants() elif comm == 'l': - print battle.list_current_group() + print battle.format_current_group() elif comm == 'b': battle.begin() elif comm == 'd': @@ -388,14 +388,14 @@ def do_prompt(): def do_damage(): - print battle.list_combatants() + print battle.format_combatants() index = input_int('choose combatant') amount = input_int('damage') battle.deal_damage(index, amount) def do_heal(): - print battle.list_combatants() + print battle.format_combatants() index = input_int('choose combatant') amount = input_int('amount') battle.heal_damage(index, amount)