-- Purpose: Simple client of word package
-- Prompts the user to guess a secret word with the length as a clue
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
with WordPkg; use WordPkg;
procedure SimpleWord is
Secret, Guess: Word;
begin
Secret := New_Word("Joe");
New_Line;
Put( "The length of the secret word is ");
Put( Length(Secret), width => 1 );
New_Line;
Put("Guess the secret word: ");
Get(Guess);
Put(Guess);
if Secret = Guess then
Put( " is the secret word!");
else
Put( " is not the secret word!");
end if;
New_Line;
exception
when wordtoolong =>
Put("Your word is too long.");
New_Line;
end simpleword;