From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1192c1137d7a2b6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-12-30 09:19:25 PST Path: supernews.google.com!sn-xit-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: Bruce or Tracy Newsgroups: comp.lang.ada Subject: Re: I need advice please on this Ada95 hangman game Date: Sat, 30 Dec 2000 11:12:57 -0600 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <3A4E1799.60B0D126@hiwaay.net> X-Mailer: Mozilla 4.6 [en] (Win95; I) X-Accept-Language: en MIME-Version: 1.0 References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: newsabuse@supernews.com Xref: supernews.google.com comp.lang.ada:3467 Date: 2000-12-30T11:12:57-06:00 List-Id: Done similar things in the past by keeping each keyboard entry in a linked list or an array. Hangman only allows only a certain number of "tries" before the man is hanged. So, that will tell you at what size to constrain your array. After each guess, loop through and up to the number of guess thus far and output it all to the same line (or different line, doesn't matter). The implementation of things like this is easy, but can be tricky if you aren't on your toes. Something even more fun would be to figure out how to make your Ada program do some nifty pixel-type graphics. Here is a good place to start for that: Windex: http://users.erols.com/leakstan/Stephe/Ada/windex.html Have fun, Bruce Mark Pagdin wrote: > > Hi > > I hope you had a nice Christmas! I am looking for your help and advice. I am > a student at university in England and have just started learning to use Ada > 95. This is my first programming language and obviously I am finding it hard > to learn it. However I have been set a project to create a program to play > hangman (a word game). > > I have been working hard to create this and am slowly getting there. However > I am stuck on the main procedure which searches for the letter in the hidden > word and then display any correct letters. > > Here is the output I get when i run the program (the word is revealed at the > moment for testing purposes): > > Enter a word to test the Hangman game > mark2 > Enter a Leter > m > m_ _ _ _ Enter a Leter > a > _ a_ _ _ Enter a Leter > r > _ _ r_ _ Enter a Leter > k > _ _ _ k_ Enter a Leter > 2 > _ _ _ _ 2Enter a Leter > > Please would it be possible for anyone to point out a way of storing each > attempt so that when the player attempts to guess again the program is able > to store the result from the previous guess. > > Please I don't want to cheat i.e. I only want you to give me hints not do it > for me. > > Thank you, > > Mark Pagdin