Skip to content

Instantly share code, notes, and snippets.

@joseph-montanez
Created June 18, 2011 00:54
Show Gist options
  • Save joseph-montanez/1032681 to your computer and use it in GitHub Desktop.
Save joseph-montanez/1032681 to your computer and use it in GitHub Desktop.
Simple utf8 console based tile map rendering
with Ada.Wide_Text_IO;
procedure Main is
subtype Tile_Width is Wide_String (1 .. 3);
Dot : constant Tile_Width := ". ";
Map : constant array (1 .. 5, 1 .. 5) of Tile_Width :=
(("╔", "═", "═", "═", "╗"),
("║", Dot, Dot, Dot, "║"),
("║", Dot, Dot, Dot, "║"),
("║", Dot, Dot, Dot, "║"),
("╚", "═", "═", "═", "╝"));
Item : Tile_Width;
begin
for X in Map'Range (1) loop
for Y in Map'Range (2) loop
Item := Map (X, Y);
if Item = Dot then
Ada.Wide_Text_IO.Put (Item (1));
else
Ada.Wide_Text_IO.Put (Item);
end if;
end loop;
Ada.Wide_Text_IO.Put_Line ("");
end loop;
end Main;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment