dos_compilers/Artek Ada v125/SAMPLE10.ADA
2024-07-08 09:31:49 -07:00

34 lines
663 B
Ada
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

with TEXT_IO; use TEXT_IO;
procedure SAMPLE10 is
package INTIO is new INTEGER_IO (INTEGER);
type BYTE is array (0..7) of BOOLEAN;
A, B, C : BYTE;
procedure PUT (B : in BYTE) is
begin
for I in B'RANGE loop
INTIO . PUT (INTEGER (B (I)), WIDTH => 1);
end loop;
NEW_LINE;
end PUT;
begin
PUT_LINE ("Boolean array operator test");
A := (FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE);
B := (TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE);
PUT (A);
PUT (B);
PUT (A and B);
PUT (A or B);
PUT (A xor B);
PUT (not A);
PUT (not B);
end SAMPLE10;