diff options
| author | Nic Gaffney <gaffney_nic@protonmail.com> | 2023-12-01 22:20:07 -0600 |
|---|---|---|
| committer | Nic Gaffney <gaffney_nic@protonmail.com> | 2023-12-01 22:20:07 -0600 |
| commit | d767828cee67bae17b811062949653234aa14b28 (patch) | |
| tree | 0a0306acc0fb9db19e6f7eff636d81c44209ee5d /examples | |
| parent | 52f12c6c2c946d8d3c0a7845d48e11ff8b8fb597 (diff) | |
| download | sloth-d767828cee67bae17b811062949653234aa14b28.tar.gz | |
shitty ptrs
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/cgol.sloth | 2 | ||||
| -rw-r--r-- | examples/mem.sloth | 9 |
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)); +} |
