
import places
from character import Character
from display import Display
from actions import AskAboutAssassins, BuyADrink, LeaveInAHuff, SingASong


def main():
    display = Display()
    display.enable()
    character = Character()
    character.place = places.tavern
    character.actions["a"] = AskAboutAssassins()
    character.actions["b"] = BuyADrink()
    character.actions["c"] = LeaveInAHuff()
    character.actions["d"] = SingASong()
    display.write("\n---The St. George Game---\n")
    display.write("You are in a tavern. The local assassins hate you.")
    while character.alive and character.alone:
        action = character.choose_action()
        display.enable()
        action.execute(character)
        character.generate_actions()

if __name__ == "__main__":
    while True:  # the game automatically restarts
        main()


import places
from character import Character
from display import Display
from actions import AskAboutAssassins, BuyADrink, LeaveInAHuff, SingASong


def main():
    display = Display()
    display.enable()
    character = Character()
    character.place = places.tavern
    character.actions["a"] = AskAboutAssassins()
    character.actions["b"] = BuyADrink()
    character.actions["c"] = LeaveInAHuff()
    character.actions["d"] = SingASong()
    display.write("\n---The St. George Game---\n")
    display.write("You are in a tavern. The local assassins hate you.")
    while character.alive and character.alone:
        action = character.choose_action()
        display.enable()
        action.execute(character)
        character.prev_act = action
        character.generate_actions()

if __name__ == "__main__":
    while True:  # the game automatically restarts
        main()

Set previous action after executing
Set previous action after executing

  
  import places
  from character import Character
  from display import Display
  from actions import AskAboutAssassins, BuyADrink, LeaveInAHuff, SingASong
  
  
  def main():
      display = Display()
      display.enable()
      character = Character()
      character.place = places.tavern
      character.actions["a"] = AskAboutAssassins()
      character.actions["b"] = BuyADrink()
      character.actions["c"] = LeaveInAHuff()
      character.actions["d"] = SingASong()
      display.write("\n---The St. George Game---\n")
      display.write("You are in a tavern. The local assassins hate you.")
      while character.alive and character.alone:
          action = character.choose_action()
          display.enable()
          action.execute(character)
+         character.prev_act = action
          character.generate_actions()
  
  if __name__ == "__main__":
      while True:  # the game automatically restarts
          main()
  
Set previous action after executing
## Code Before:

import places
from character import Character
from display import Display
from actions import AskAboutAssassins, BuyADrink, LeaveInAHuff, SingASong


def main():
    display = Display()
    display.enable()
    character = Character()
    character.place = places.tavern
    character.actions["a"] = AskAboutAssassins()
    character.actions["b"] = BuyADrink()
    character.actions["c"] = LeaveInAHuff()
    character.actions["d"] = SingASong()
    display.write("\n---The St. George Game---\n")
    display.write("You are in a tavern. The local assassins hate you.")
    while character.alive and character.alone:
        action = character.choose_action()
        display.enable()
        action.execute(character)
        character.generate_actions()

if __name__ == "__main__":
    while True:  # the game automatically restarts
        main()

## Instruction:
Set previous action after executing
## Code After:

import places
from character import Character
from display import Display
from actions import AskAboutAssassins, BuyADrink, LeaveInAHuff, SingASong


def main():
    display = Display()
    display.enable()
    character = Character()
    character.place = places.tavern
    character.actions["a"] = AskAboutAssassins()
    character.actions["b"] = BuyADrink()
    character.actions["c"] = LeaveInAHuff()
    character.actions["d"] = SingASong()
    display.write("\n---The St. George Game---\n")
    display.write("You are in a tavern. The local assassins hate you.")
    while character.alive and character.alone:
        action = character.choose_action()
        display.enable()
        action.execute(character)
        character.prev_act = action
        character.generate_actions()

if __name__ == "__main__":
    while True:  # the game automatically restarts
        main()
