class LoveLetter:
def __init__(self, recipient):
self.recipient = recipient
self.message = ""
def write(self, words):
self.message += words + "\n"
def read(self):
print(f"To: {self.recipient}\n")
print(self.message)
print("With love,\nYour secret admirer")
letter = LoveLetter("My eternal love")
letter.write("Dear,")
letter.write("From the moment our paths crossed,")
letter.write("my heart was captured by the tenderness of your smile.")
letter.write("In every byte of my being, you are etched as an eternal memory.")
letter.write("Your eyes are like two stars in the darkness of my code,")
letter.write("guiding me towards a horizon of shared dreams.")
letter.write("In the architecture of my life, you are the framework that gives structure,")
letter.write("and in the algorithm of my heart, you are the variable I never want to redefine.")
letter.write("There is no loop that compares to the infinite joy of having you by my side.")
letter.write("I love you beyond the limits of logic and reason,")
letter.write("for in my universe, you are the only command I wish to execute.")
letter.write("With unconditional love,")letter.write("Your secret admirer")
letter.read()
❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎❤︎
public class LoveLetterReader {
public static void main(String[] args) {
File archivo = new File("lastwords:c.txt");
try (BufferedReader br = new BufferedReader(new FileReader(archivo))) {
String line;
System.out.println("Leyendo las palabras de despedida...");
while ((line = br.readLine()) != null) {
System.out.println(line);
}
System.out.println("\nCada línea es un suspiro, cada palabra una lágrima.");
} catch (IOException e) {
System.err.println("No se pudo leer el archivo. Tal vez el destino nos juega una mala pasada.");
e.printStackTrace();
}
System.out.println("i miss u");
System.out.println("Estas palabras son un eco en el silencio de tu ausencia.");
}
}