Berikut adalah Source Code Pohon atau Looping Sederhana dalam Bahasa Pascal.

Data arsip dari Die Coding, silakan digunakan dan diubah sesuka hati, semoga bermanfaat.

program pohon;
uses crt;

var
	n, i, j : shortint;

begin
	clrscr;
	writeln (' ------------------------------------------ ');
	writeln ('|                                          |');
	writeln ('|           source: diecoding.com          |');
	writeln ('|                                          |');
	writeln (' ------------------------------------------ ');
	writeln;
	write ('Silakan tekan enter untuk melanjutkan..');
	readkey;
	while not eof do begin
		clrscr;
		writeln (' ---------------------------- ');
		writeln ('|       PROGRAM POHON        |');
		writeln (' ---------------------------- ');
		writeln;writeln;
		write ('Tampilkan Jumlah Pohon : '); readln (n);
		writeln;
		if n < 1 then
			writeln ('Input Error')
		else begin

			{
				1
				1 2
				1 2 3
				1 2 3 4
				1 2 3 4 5
			}
			for i := 1 to n do begin
				for j := 1 to i do begin
			    	write (j, ' ');
			    end;			
			    writeln;
			end;

			writeln;
			writeln ('------------------------------');
			writeln;
			{
				5
				4 5
				3 4 5
				2 3 4 5
				1 2 3 4 5
 			}
			for i := n downto 1 do begin
				for j := i to n do begin
			    	write (j, ' ');
			    end;			
			    writeln;
			end;

			writeln;
			writeln ('------------------------------');
			writeln;

			{
				1 2 3 4 5
				2 3 4 5 4
				3 4 5 4 3
				4 5 4 3 2
				5 4 3 2 1
			}

			for i := 1 to n do begin
				for j := i to n do begin
			    	write (j, ' ');
			    end;
			    for j := n-1 downto n-i+1 do begin
			    	write (j, ' ');
			    end;
			    writeln;
			end;

			writeln;
			writeln ('------------------------------');
			writeln;

			{
				5 4 3 2 1
				4 3 2 1 5
				3 2 1 5 4
				2 1 5 4 3
				1 5 4 3 2
				5 4 3 2 1
			}

			for i := n downto 1 do begin
				for j := i downto 1 do begin
			    	write (j, ' ');
			    end;
			    for j := n downto i+1 do begin
			    	write (j, ' ');
			    end;
			    writeln;
			end;
			for i := n downto 1 do begin
		    	write (i, ' ');
		    end;
			writeln;
		end;
		readkey;
	end;
end.