Created
June 18, 2011 00:54
-
-
Save joseph-montanez/1032681 to your computer and use it in GitHub Desktop.
Simple utf8 console based tile map rendering
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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