Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,15 @@
# -*- coding: utf-8 -*- #
MODE DIETITEM = STRUCT(
STRING food, annual quantity, units, REAL cost
);
# Stigler's 1939 Diet ... #
FORMAT diet item fmt = $g": "g" "g" = $"zd.dd$;
[]DIETITEM stigler diet = (
("Cabbage", "111","lb.", 4.11),
("Dried Navy Beans", "285","lb.", 16.80),
("Evaporated Milk", "57","cans", 3.84),
("Spinach", "23","lb.", 1.85),
("Wheat Flour", "370","lb.", 13.33),
("Total Annual Cost", "","", 39.93)
)

View file

@ -0,0 +1,20 @@
#!/usr/bin/a68g --script #
# -*- coding: utf-8 -*- #
MODE OBJVALUE = DIETITEM;
PR read "prelude/link.a68" PR;# c.f. [[rc:Queue/Definition]] #
PR read "prelude/queue_base.a68" PR; # c.f. [[rc:Queue/Definition]] #
PR read "test/data_stigler_diet.a68" PR;
OBJQUEUE example queue; obj queue init(example queue);
FOR i TO UPB stigler diet DO
# obj queue put(example queue, stigler diet[i]) or ... #
stigler diet[i] +=: example queue
OD;
printf($"Get remaining values from queue:"l$);
WHILE NOT obj queue is empty(example queue) DO
# OR example queue ISNT obj queue empty #
printf((diet item fmt, obj queue get(example queue), $l$))
OD