From 7a91d322cf94b7eea015f4a4e05b61de607ffe91 Mon Sep 17 00:00:00 2001 From: xolatile Date: Sun, 16 Jun 2024 20:24:02 -0400 Subject: [PATCH] Work in progress on Ada version... --- .gitignore | 2 ++ xerbia.adb | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 xerbia.adb diff --git a/.gitignore b/.gitignore index 87f146d..a6cb9ff 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ xerbia +xerbia.o +xerbia.ali diff --git a/xerbia.adb b/xerbia.adb new file mode 100644 index 0000000..db2430e --- /dev/null +++ b/xerbia.adb @@ -0,0 +1,66 @@ +with ada.text_io; +use ada.text_io; + +procedure xerbia is + + type resource_type is ( + wheat, gold, wood, stone + ); + + type construction_type is ( + granary, mine, storehouse, quarry + ); + + type reply_type is ( + quit, help, report, status, build, train, trade, plant, + turn + ); + + grey : constant string := ascii.esc & "[1;30m"; + red : constant string := ascii.esc & "[1;31m"; + green : constant string := ascii.esc & "[1;32m"; + yellow : constant string := ascii.esc & "[1;33m"; + blue : constant string := ascii.esc & "[1;34m"; + pink : constant string := ascii.esc & "[1;35m"; + cyan : constant string := ascii.esc & "[1;36m"; + white : constant string := ascii.esc & "[1;37m"; + cancel : constant string := ascii.esc & "[0m"; + + population : natural := 0; + reputation : integer := 0; + migration : integer := 0; + + resource : array (resource_type) of integer := (others => 0); + construction : array (construction_type) of natural := (others => 0); + + reply_text : constant array (reply_type) of access string := ( + new string'("Quit game."), + new string'("Print reply strings and their explanation, like this one."), + new string'("Request a report from your court advisors about the state of your fortress."), + new string'("Request a meeting with lords and merchants about affairs in your fiefdom."), + new string'("Propose what kind of construction should be built this month to your architect."), + new string'("Spend more time training with your warriors this entire month."), + new string'("Discuss what goods should be sold or bought this month with merchant guild."), + new string'("Order what kind of plants should your peasants harvest this month."), + new string'("Submit your monthly strategy to the council and wait until next month.") + ); + + construction_price : array (construction_type, resource_type) of natural := ( + (0, 10, 60, 30), + (0, 120, 60, 10), + (0, 30, 10, 60), + (0, 60, 30, 10) + ); + + procedure separator is + begin + put_line (grey & "------------------------------------------------------------------------------------------" & cancel); + end separator; + +begin + + separator; + separator; + separator; + +end xerbia;