matteoferla / DnD-battler

A 5e D&D encounter simulator written for my own amusement to test some hypotheses.
MIT License
80 stars 31 forks source link

NameError: name 'N' is not defined #16

Closed RichardScottOZ closed 2 years ago

RichardScottOZ commented 2 years ago

image

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_38768/2654407226.py in <module>
      2 level3 = Creature.load('badger') # get from beastiary
      3 arena = Encounter(level2, level3)
----> 4 print(arena.battle())

j:\clone\dnd-battler\DnD_battler\encounter\_action.py in battle(self, reset, verbose)
    128             character.tally['hp'] += character.hp
    129             character.tally['healing_spells'] += character.healing_spells
--> 130         if verbose: self.masterlog.append(str(self))
    131         # return self or side?
    132         return self

j:\clone\dnd-battler\DnD_battler\encounter\_base.py in __str__(self)
     54 
     55     def __str__(self):
---> 56         string = "=" * 50 + ' ' + self.name + " " + "=" * 50 + N
     57         string += self.predict()
     58         string += "-" * 110 + '\n'

NameError: name 'N' is not defined
RichardScottOZ commented 2 years ago

Given where this is, is the N supposed to be a newline?

bluetyson commented 2 years ago

I just put in N = "\n" at the start of things and it seemed to be fine.

RichardScottOZ commented 2 years ago

standardised to "\n"