/* Originally Written by Mike */ main asc_shapes int parallel shapetype[$]; real parallel basepoint_x[$]; real parallel basepoint_y[$]; real parallel radius[$]; real parallel length[$]; real parallel width[$]; real parallel base[$]; real parallel height[$]; real parallel area[$]; define (CIRCLE, 0); define (RECTANGLE, 1); define (TRIANGLE, 2); logical parallel shapes_db[$]; index parallel xx[$]; associate shapetype[$], basepoint_x[$], basepoint_y[$], radius[$], length[$], width[$], base[$], height[$], area[$] with shapes_db[$]; read shapetype[$], basepoint_x[$], basepoint_y[$], radius[$], length[$], width[$], base[$], height[$] in shapes_db[$]; print shapetype[$] in shapes_db[$]; setscope shapes_db[$] /* .masc fork */ if shapetype[$] .eq. CIRCLE then area[$] = 3.14159 * radius[$] * radius[$]; else if shapetype[$] .eq. RECTANGLE then area[$] = length[$] * width[$]; else if shapetype[$] .eq. TRIANGLE then area[$] = 0.5 * base[$] * height[$]; endif; endif; endif; endsetscope; print area[$] in shapes_db[$]; end;