reorganized build-ins and implement a circular queue as an example

This commit is contained in:
cozis
2022-08-18 19:01:26 +02:00
parent b5b3a3e315
commit 782985e8b7
36 changed files with 486 additions and 259 deletions
+13 -6
View File
@@ -1,8 +1,15 @@
# This script reads the contents of a file.
name = 'examples/algorithms/bubble_sort.noja';
buff = buffer.new(1024);
handle, err = files.openFile(name, files.READ);
if handle == none:
error(err);
n = files.read(handle, buff);
resl = buffer.toString(buffer.sliceUp(buff, 0, n));
buff = newBuffer(1024);
name = 'examples/bubble_sort.noja';
hdle = files.openFile(name, files.READ);
n = files.read(hdle, buff);
resl = bufferToString(sliceBuffer(buff, 0, n));
print('Read ', n, ' bytes.\n');
print(resl);
print(resl);