From 4c8409da359cf0da14214ccc939c10ac759f76a5 Mon Sep 17 00:00:00 2001 From: mRnea Date: Thu, 22 Aug 2024 00:24:19 +0300 Subject: added new examples --- examples/rule110/rule110.kurt | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 examples/rule110/rule110.kurt (limited to 'examples/rule110/rule110.kurt') diff --git a/examples/rule110/rule110.kurt b/examples/rule110/rule110.kurt new file mode 100644 index 0000000..181ca2e --- /dev/null +++ b/examples/rule110/rule110.kurt @@ -0,0 +1,40 @@ +makro boyut 100 son +makro stdout 1 son +makro sys-write 1 son +makro print-buffer + stdout bel boyut + boyut 1 + sys-write syscall-3 +son + +;; initialize board +0 döngü eş boyut < iken + eş bel + 0 yaz + 1 + +yap düş +boyut 2 - bel + 1 yaz + +;; iteration count +0 döngü eş boyut 2 - < iken + ;; write board to buffer + 0 döngü eş boyut < iken + eş bel + oku 1 = ise + eş bel boyut + + '*' yaz ;; 42 = '*' + yoksa + eş bel boyut + + ' ' yaz ;; 32 = ' ' + yap + 1 + + yap + bel boyut + + '\n' yaz ;; 10 '\n' + ;; write to screen + print-buffer + + ;; pattern init + bel 0 + oku 1 << bel 1 + oku | + 1 döngü eş boyut 1 - < iken + eş bel 1 + + oku ;; (pattern i cell) + rot 1 << 7 & | ;; (i new-pattern) + üst bel + üst 110 değiş >> 1 & yaz + değiş 1 + + yap düş düş + 1 + +yap + -- cgit v1.2.3