Data update

This commit is contained in:
Ingy döt Net 2023-08-01 14:30:30 -07:00
parent 07c7092a52
commit 61b93a2cd1
313 changed files with 6160 additions and 346 deletions

View file

@ -1,4 +1,4 @@
module tree<Type>;
module tree(<Type>);
struct Tree
{
@ -7,9 +7,9 @@ struct Tree
Tree* right;
}
fn void Tree.replaceAll(Tree* a_tree, Type new_value)
fn void Tree.replace_all(&self, Type new_value)
{
a_tree.value = new_value;
if (a_tree.left) a_tree.left.replaceAll(new_value);
if (a_tree.right) a_tree.right.replaceAll(new_value);
self.value = new_value;
if (self.left) self.left.replace_all(new_value);
if (self.right) self.right.replace_all(new_value);
}

View file

@ -1,7 +1,7 @@
define IntTree = tree<int>::Tree;
import tree;
fn void test()
{
IntTree inttree;
inttree.replaceAll(3);
Tree(<int>) inttree;
inttree.replace_all(3);
}