aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/cgol.sloth2
-rw-r--r--examples/mem.sloth9
2 files changed, 10 insertions, 1 deletions
diff --git a/examples/cgol.sloth b/examples/cgol.sloth
index fafe440..db578f9 100644
--- a/examples/cgol.sloth
+++ b/examples/cgol.sloth
@@ -1,7 +1,7 @@
fn populate() [Int]
{
# Initialize life vector
- var life: [Int] = [1];
+ var life: [Int] = ["Hello World"];
vpopi(life);
# Fill the vector with random values
diff --git a/examples/mem.sloth b/examples/mem.sloth
new file mode 100644
index 0000000..cb52191
--- /dev/null
+++ b/examples/mem.sloth
@@ -0,0 +1,9 @@
+fn main() {
+ var intpointer: Int = memalloc(64);
+ println("We vibin");
+ assignrefi(intpointer, 10);
+ println("Still vibin");
+ var derefd: Int = drefi(intpointer);
+ print("Val of drefd: ");
+ println(istr(derefd));
+}