Tabula recta


You can use the following code to print the tabula recta.

#include <stdio.h>

void
print_tabula_recta()
{
	int i, j, k, l;

	/* prepare the top part of the table */
	printf("    |  ");
	for (i = 65; i <= 90; i++)
		printf("%c   ", i);
	putchar('\n');

	/* outer rim */
	for (i = 1; i <= 109; i++)
		printf("-");
	putchar('\n');

	/* print the actual table to stdout */
	for (i = 0; i <= 25; i++) {
		printf(" %c  |  ", i + 65);
		for (j = 65; j <= 90; j++) {
			k = i;
			l = j;

			l = l + k;
			if(l <= 90)
				printf("%c   ", l);
			else {
				l = l - (90 - 65 + 1);
				printf("%c   ", l);
			}
		}
	putchar('\n');
	}
}

int
main()
{
	print_tabula_recta();
	return(0);
}

Compile the code as follows:

gcc -o tabula_recta tabula_recta.c

And run it with:

tabula_recta

To generate the following output:

    |  A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z   
-------------------------------------------------------------------------------------------------------------
 A  |  A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z   
 B  |  B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z   A   
 C  |  C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z   A   B   
 D  |  D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z   A   B   C   
 E  |  E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z   A   B   C   D   
 F  |  F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z   A   B   C   D   E   
 G  |  G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z   A   B   C   D   E   F   
 H  |  H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z   A   B   C   D   E   F   G   
 I  |  I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z   A   B   C   D   E   F   G   H   
 J  |  J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z   A   B   C   D   E   F   G   H   I   
 K  |  K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z   A   B   C   D   E   F   G   H   I   J   
 L  |  L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z   A   B   C   D   E   F   G   H   I   J   K   
 M  |  M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z   A   B   C   D   E   F   G   H   I   J   K   L   
 N  |  N   O   P   Q   R   S   T   U   V   W   X   Y   Z   A   B   C   D   E   F   G   H   I   J   K   L   M   
 O  |  O   P   Q   R   S   T   U   V   W   X   Y   Z   A   B   C   D   E   F   G   H   I   J   K   L   M   N   
 P  |  P   Q   R   S   T   U   V   W   X   Y   Z   A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   
 Q  |  Q   R   S   T   U   V   W   X   Y   Z   A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   
 R  |  R   S   T   U   V   W   X   Y   Z   A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   
 S  |  S   T   U   V   W   X   Y   Z   A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   
 T  |  T   U   V   W   X   Y   Z   A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   
 U  |  U   V   W   X   Y   Z   A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   
 V  |  V   W   X   Y   Z   A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   
 W  |  W   X   Y   Z   A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   
 X  |  X   Y   Z   A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   
 Y  |  Y   Z   A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   
 Z  |  Z   A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   

Which is the tabula recta.


Sources:

Tabula recta