From c598aa64fb8fe2c6a73303c35362cd38973cc758 Mon Sep 17 00:00:00 2001 From: tekkac Date: Tue, 8 Oct 2024 20:41:25 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=89=20first=20Cairo=20quine=20ever=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/formatted_quine.cairo | 12 +++++++++++- src/test.cairo | 5 +++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/formatted_quine.cairo b/src/formatted_quine.cairo index f328e4d..2c96a4a 100644 --- a/src/formatted_quine.cairo +++ b/src/formatted_quine.cairo @@ -1 +1,11 @@ -fn main() {} +pub fn main() { + let mut q = Default::default(); + let mut n = q.clone(); + q.append_word(34, 1); + n.append_word(10, 1); + let s: ByteArray = + "pub fn main() {{{n} let mut q = Default::default();{n} let mut n = q.clone();{n} q.append_word(34, 1);{n} n.append_word(10, 1);{n} let s: ByteArray ={n} {q}{s}{q};{n} println!({n} {q}{s}{q}{n} );{n}}}{n}"; + println!( + "pub fn main() {{{n} let mut q = Default::default();{n} let mut n = q.clone();{n} q.append_word(34, 1);{n} n.append_word(10, 1);{n} let s: ByteArray ={n} {q}{s}{q};{n} println!({n} {q}{s}{q}{n} );{n}}}{n}" + ); +} diff --git a/src/test.cairo b/src/test.cairo index 8b13789..6ccf024 100644 --- a/src/test.cairo +++ b/src/test.cairo @@ -1 +1,6 @@ +use quines::formatted_quine::main as formatted_quine_main; +#[test] +fn test_formatted_quine() { + formatted_quine_main(); +}