Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
15
Task/Queue-Usage/ALGOL-68/queue-usage-1.alg
Normal file
15
Task/Queue-Usage/ALGOL-68/queue-usage-1.alg
Normal 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)
|
||||
)
|
||||
20
Task/Queue-Usage/ALGOL-68/queue-usage-2.alg
Normal file
20
Task/Queue-Usage/ALGOL-68/queue-usage-2.alg
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue