diff --git a/programs/arithmetic.chalk b/programs/basic_arithmetic.chalk similarity index 100% rename from programs/arithmetic.chalk rename to programs/basic_arithmetic.chalk diff --git a/programs/call.chalk b/programs/basic_call.chalk similarity index 100% rename from programs/call.chalk rename to programs/basic_call.chalk diff --git a/programs/basic_draw_number.chalk b/programs/basic_draw_number.chalk new file mode 100644 index 0000000..2489faf --- /dev/null +++ b/programs/basic_draw_number.chalk @@ -0,0 +1,3 @@ +fun main(): u0 { + draw_number(69, 1, 1); +} diff --git a/programs/empty.chalk b/programs/basic_empty.chalk similarity index 100% rename from programs/empty.chalk rename to programs/basic_empty.chalk diff --git a/programs/basic_if.chalk b/programs/basic_if.chalk new file mode 100644 index 0000000..10a4c6b --- /dev/null +++ b/programs/basic_if.chalk @@ -0,0 +1,17 @@ +fun main(): u0 { + var a = 3+3; + if(a) { + a = 0; + } + + var b = 0; + if(b) { + b = 4; + } + + if(b) { + b = 4; + } else { + b = 5; + } +} diff --git a/programs/basic_input.chalk b/programs/basic_input.chalk new file mode 100644 index 0000000..c8ebd4c --- /dev/null +++ b/programs/basic_input.chalk @@ -0,0 +1,4 @@ +fun main(): u0 { + var a = get_key(); + var b = get_key(); +} diff --git a/programs/basic_while.chalk b/programs/basic_while.chalk new file mode 100644 index 0000000..9c52d59 --- /dev/null +++ b/programs/basic_while.chalk @@ -0,0 +1,8 @@ +fun main(): u0 { + var a = 5; + var b = 0; + while(a) { + b = b + 2; + a = a - 1; + } +} diff --git a/programs/comb_fib.chalk b/programs/comb_fib.chalk new file mode 100644 index 0000000..f37d584 --- /dev/null +++ b/programs/comb_fib.chalk @@ -0,0 +1,14 @@ +fun main(): u0 { + var a = 1; + var b = 1; + while(233 - a) { + draw_number(a, 24, 13); + set_delay(30); + var temp = a; + a = b; + b = b + temp; + while(get_delay()){} + draw_number(temp, 24, 13); + } + draw_number(a, 24, 13); +} diff --git a/programs/comb_input.chalk b/programs/comb_input.chalk new file mode 100644 index 0000000..2468495 --- /dev/null +++ b/programs/comb_input.chalk @@ -0,0 +1,13 @@ +fun main(): u0 { + var a = 1; + var b = 0; + var previous = 0; + draw_number(0, 24, 13); + + while(a) { + previous = b; + b = get_key(); + draw_number(previous, 24, 13); + draw_number(b, 24, 13); + } +}