#A translation of the C code posted
html_table := proc(str)
local char;
printf("
\n| ");
for char in str do
if char = "\n" then
printf(" |
\n| ")
elif char = "," then
printf(" | ")
elif char = "<" then
printf("<")
elif char = ">" then
printf(">")
elif char = "&" then
printf("&")
else
printf(char)
end if;
end do;
printf(" |
\n
");
end proc;
html_table("Character,Speech
The multitude,The messiah! Show us the messiah!
Brians mother,Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!
The multitude,Who are you?
Brians mother,I'm his mother; that's who!
The multitude,Behold his mother! Behold his mother!");