save mutiple writeln's into an array 
Author Message
 save mutiple writeln's into an array

I am writing a hangman program for a course in Borland's Turbo Pascal.
I will write a hangman part for each wrong guess made. Here is the
problem: I wold like to write each body part(head,arms,legs,scaffold
ect.) into an array. I am just doing a introductory course in Turbo
Pascal, and am using Turbo Pascal 5.5 to compile my code so please use
compatible and very easy code. I desparately need this information, so
please reply quickly!!

Thanks,

rats60



Tue, 08 Nov 2005 18:53:37 GMT  
 save mutiple writeln's into an array
rats60 schrieb:

Quote:
> I am writing a hangman program for a course in Borland's Turbo Pascal.
> I will write a hangman part for each wrong guess made. Here is the
> problem: I wold like to write each body part(head,arms,legs,scaffold
> ect.) into an array. I am just doing a introductory course in Turbo
> Pascal, and am using Turbo Pascal 5.5 to compile my code so please use
> compatible and very easy code. I desparately need this information, so
> please reply quickly!!

> Thanks,

> rats60

Here is some example:

program arr;

uses crt;

var myarr:ARRAY [1..5] OF STRING;
     i:BYTE;

BEGIN
   FOR i:=1 TO 5 DO READLN(myarr[i]);

   WRITELN('Contents of myarr is:');
   FOR i:=1 TO 5 DO WRITELN(myarr[i]);
END.

Is this what you need?

Greetings

Markus



Tue, 08 Nov 2005 21:01:31 GMT  
 save mutiple writeln's into an array

Quote:

> I am writing a hangman program for a course in Borland's Turbo Pascal.
> I will write a hangman part for each wrong guess made. Here is the
> problem: I wold like to write each body part(head,arms,legs,scaffold
> ect.) into an array. I am just doing a introductory course in Turbo
> Pascal, and am using Turbo Pascal 5.5 to compile my code so please use
> compatible and very easy code. I desparately need this information, so
> please reply quickly!!

> Thanks,

> rats60

Is it a requirement of this 'assignment' to use arrays?
I'd much rather consider a Procedure, that, given a body part ('Head',
'Left Arm', 'Left Leg', etc), would use a case statement to branch to
the writelns necessary to draw that part. This would be called by a
procedure that would, of course, determine the next part to draw for a
wrong answer (teachers like this level of modularity, for the most
part. Unless your instructor is the guy who wrote "Programming
Pearls"!)
In any event, don't expect anyone here to do your homework.


Wed, 09 Nov 2005 02:20:11 GMT  
 save mutiple writeln's into an array

Quote:

> I am writing a hangman program for a course in Borland's Turbo Pascal.

Apropos hangman (my source code not publicly available, though):

ftp://garbo.uwasa.fi/pc/ts/tsgmee13.zip Educational games V, Timo Salmi
Filename        Comment                              Date      Time
--------        --------------------------------     ----      ----
ENGLNOUN.VOC    English nouns for hangman         Dec-03-1990  17:42:04
FILE_ID.DIZ     Brief characterization of tsgmee  Feb-08-1998  08:15:46
FINOUN.VOC      Finnish nouns for hangman         Dec-15-1990  14:51:34
FRENOUN.VOC     Some French nouns for hangman     Dec-15-1990  17:12:20
HANGMAN.EXE     The classic guess a word          Feb-08-1998  08:28:46
HANGMAN.ICO     Windows icon for Hangman          Dec-31-1996  10:22:42
TOWERS.EXE      Towers of Hanoi, arrange disks    Feb-08-1998  08:44:34
TOWERS.ICO      Windows icon for Towers of Hanoi  Jan-01-1997  07:13:06
TSGMEE.INF      Document and a readme             Feb-08-1998  08:53:18
TSGMEE.NWS      News concerning this package      Feb-08-1998  08:55:42
TSPROG.INF      List of programs by Timo Salmi    Oct-04-1997  16:04:18
VAASA.INF       Info: Finland, Vaasa, U of Vaasa  Oct-18-1997  13:18:46
----            ------             ------  -----
0012            140525             102946   27%

   All the best, Timo

--
Prof. Timo Salmi ftp & http://garbo.uwasa.fi/ archives 193.166.120.5
Department of Accounting and Business Finance  ; University of Vaasa

Timo's  FAQ  materials  at   http://www.uwasa.fi/~ts/http/tsfaq.html



Wed, 09 Nov 2005 02:25:36 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. WriteLn's Syntax / Interrupt Questions

2. saving an array of pixels to a recognised picture format

3. saving an array of pixels to a recognised picture format

4. Need help saving a record with arrays.

5. Delphi: How do I save array to file?

6. Saving array of real in a memo ?

7. How to 'Redim' an array

8. mutiple application simultanuous running important

9. Relocating an array - 'absolute'

10. saving TDBGrid's column position

11. RichEdit, saving TTextAttributes in DBF/DBT memo's Apollo

 

 
Powered by phpBB® Forum Software