summaryrefslogtreecommitdiff
path: root/Modules/towns.b
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/towns.b')
-rw-r--r--Modules/towns.b22
1 files changed, 22 insertions, 0 deletions
diff --git a/Modules/towns.b b/Modules/towns.b
new file mode 100644
index 0000000..c417462
--- /dev/null
+++ b/Modules/towns.b
@@ -0,0 +1,22 @@
+implement Towns;
+
+include "towns.m";
+
+init() {
+ persons = load Persons "./persons.dis";
+}
+
+mktown(): ref Town {
+ return ref Town;
+}
+
+Town.stringify(t: self ref Town): string {
+ Person: import persons;
+
+ s := "Name: " + t.name + "\nSize: " + string len t.pop + "\nMembers:";
+
+ for(i := 0; i < len t.pop; i++)
+ s += "\n→ " + t.pop[i].stringify();
+
+ return s;
+}