From d767828cee67bae17b811062949653234aa14b28 Mon Sep 17 00:00:00 2001 From: Nic Gaffney Date: Fri, 1 Dec 2023 22:20:07 -0600 Subject: shitty ptrs --- examples/cgol.sloth | 2 +- examples/mem.sloth | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 examples/mem.sloth (limited to 'examples') 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)); +} -- cgit v1.2.3