
uses crt, fastgraph;

var	i, x, y, boxStart, boxEnd, newYLine: byte;
	binLine: string;
	qr: array[0..34] of string;

procedure drawBox(var boxStart, boxEnd, newYLine : byte);
begin
	for i := 0 to 3 do begin
		Line(boxStart, newYLine + i, boxEnd, newYLine + i);
	end;
end;

procedure initQrCode();
begin
	qr[0] := '11111111111111111111111111111111111';
	qr[1] := '10000000100010100111111100100000001';
	qr[2] := '10111110100011010000011111101111101';
	qr[3] := '10100010101001000100111001101000101';
	qr[4] := '10100010100101000110110101101000101';
	qr[5] := '10100010111111001110110100101000101';
	qr[6] := '10111110101100100100001001101111101';
	qr[7] := '10000000101010101010101010100000001';
	qr[8] := '11111111110110011000111100111111111';
	qr[9] := '10011000111101001101010100110100001';
	qr[10] := '10011001010010110010011111011001101';
	qr[11] := '10100010101100111001110011111010011';
	qr[12] := '10101111011001010100111101011111001';
	qr[13] := '11101000001010000001001010111100111';
	qr[14] := '10100011100111111000101100000001101';
	qr[15] := '10110000101011000000111001110010011';
	qr[16] := '10011001001010111001111010100001001';
	qr[17] := '10110110001100100100000111011011111';
	qr[18] := '10110111010110001110101010111101101';
	qr[19] := '10111100001001110101110011111010011';
	qr[20] := '10010001011110110101100011110001111';
	qr[21] := '11100010100101011101000100001011111';
	qr[22] := '10010101010010110010110111011011101';
	qr[23] := '11101100100111100011100011111011011';
	qr[24] := '11110111101001011001110101111101111';
	qr[25] := '10001010110001111101000110000010011';
	qr[26] := '11111111100110001001111110111011011';
	qr[27] := '10000000110111010101100010101000111';
	qr[28] := '10111110101111010100100000111001001';
	qr[29] := '10100010100010001100100110000011101';
	qr[30] := '10100010110101010010011110111111001';
	qr[31] := '10100010111010100001110010111101011';
	qr[32] := '10111110100100000101110011000001111';
	qr[33] := '10000000101000101011000111101111101';
	qr[34] := '11111111111111111111111111111111111';
end;

begin
	InitGraph(8);
	TextBackground(0);
	initQrCode();

    for y := 0 to 34 do begin
		binLine := qr[y];
		newYLine := y * 4;
		for x := 1 to 35 do begin
			boxStart := x * 4;
			boxEnd := boxStart + 3;
			if (binLine[x] = '1') then begin
				SetColor(1);
				end
			else
				SetColor(0);
			drawBox(boxStart, boxEnd, newYLine);
		end;
	end;

	ReadKey;
end.

