Skip to content

Commit

Permalink
🎉 first Cairo quine ever?
Browse files Browse the repository at this point in the history
  • Loading branch information
tekkac committed Oct 8, 2024
1 parent 0a0c4ad commit c598aa6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/formatted_quine.cairo
Original file line number Diff line number Diff line change
@@ -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}"
);
}
5 changes: 5 additions & 0 deletions src/test.cairo
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
use quines::formatted_quine::main as formatted_quine_main;

#[test]
fn test_formatted_quine() {
formatted_quine_main();
}

0 comments on commit c598aa6

Please sign in to comment.