Board index » delphi » programming help **please help me** its not hard

programming help **please help me** its not hard

i need help creating a looping program so that the following is displayed when
you press enter.
                                    *
                                   * *
                                  * * *
and so on until the last line as 41.
The problem i ahve is because the star is a charactor not a number so i can not
add, so i thatught about using ASCI but was not sure how to do it.
***PLEASE HELP ME***
Thanks
 

Re:programming help **please help me** its not hard


On 12 Oct 2000 19:00:40 GMT, danre...@aol.com (DANRENIX) wrote:

Quote
>i need help creating a looping program so that the following is displayed when
>you press enter.
>                                    *
>                                   * *
>                                  * * *
>and so on until the last line as 41.
>The problem i ahve is because the star is a charactor not a number so i can not
>add, so i thatught about using ASCI but was not sure how to do it.
>***PLEASE HELP ME***
>Thanks

Your statement about "the star is a charactor not a number so i can
not add" speaks of some confusion regarding computation vs. display,
and I'm having trouble imagining where the precise confusion might be
since I don't know your background or where you are in your study of
Pascal.

Are you familiar with using the Write and/or WriteLn() routines?  

Using your current knowledge can you write a single star to the
display?  That would be a starting place if you're really stuck.

In any case, the "gurus" in the UseNet programming groups prefer to
see some concrete work toward the solution of a problem before
providing assistance for what is pretty obviously a class assignment.

We (here I'm making the big leap that I can include myself among the
gurus ;-))  are not in the habit of doing students' homework for them.

So, show us what you've done.

Stephen Posey
slpo...@concentric.net

Re:programming help **please help me** its not hard


On 12 Oct 2000 19:00:40 GMT, danre...@aol.com (DANRENIX) wrote:

Quote
>i need help creating a looping program so that the following is displayed when
>you press enter.
>                                    *
>                                   * *
>                                  * * *
>and so on until the last line as 41.
>The problem i ahve is because the star is a charactor not a number so i can not
>add, so i thatught about using ASCI but was not sure how to do it.
>***PLEASE HELP ME***
>Thanks

If you make the last line 41 you will cutoff the top of your Christmas
tree on the screen! Maybe you are supposed to print it out. I am not
sure what you need but 21 lines looks nice on screen. When you get
that working, you can expand to 41 lines on your printer.  There are
several ways to do this but the easiest is to use a string which you
concatente within the loop to make it ' *' longer and use the format
statement Write(s:x) where x starts in the center of the screen (or
page) and increments by 1 each time through the loop.

Re:programming help **please help me** its not hard


Quote
danre...@aol.com (DANRENIX) wrote:
>i need help creating a looping program so that the following is displayed when
>you press enter.

When is it due?

Jud McCranie

Re:programming help **please help me** its not hard


You need GotoXY(42 - j, j) in an i loop that steps in two's up to 41 and
increments j by one. And you need Write('*') in a t loop nested inside the i
loop with the t loop running from 1 to each i.

Quote
> i need help creating a looping program so that the following is displayed
when
> you press enter.
>                                     *
>                                    * *
>                                   * * *
> and so on until the last line as 41.
> The problem i ahve is because the star is a charactor not a number so i
can not
> add, so i thatught about using ASCI but was not sure how to do it.
> ***PLEASE HELP ME***
> Thanks

Re:programming help **please help me** its not hard


JRS:  In article <02D4285ED68CEDE3.7ECA413E405CCDA4.C69D5A0FFCEE7AA3@lp.
airnews.net> of Fri, 13 Oct 2000 12:50:24 seen in
news:comp.lang.pascal.borland, Clif Penn <clifp...@airmail.net> wrote:

Quote

>If you make the last line 41 you will cutoff the top of your Christmas
>tree on the screen!

Why so?  Not necessarily.  He could be writing for Windows (with WinCrt,
IIRC), or he could be running in 50-line mode, for example.

On this Win98 machine I maintain two DOS boxes ready-built, each 80*50.
With a TT 8*13 font, they are very legible.  The IDE, like most other
programs, is very content with that setting, and easier to use.

One should never assume that someone else will be using an 80*25
display; though one should always allow for the possibility.

--
? John Stockton, Surrey, UK.  j...@merlyn.demon.co.uk   Turnpike v4.00   MIME. ?
 <URL: http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c., FAQqy topics & links;
 <URL: http://www.merlyn.demon.co.uk/clpb-faq.txt> Pedt Scragg: c.l.p.b. mFAQ;
 <URL: ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip> Timo Salmi's Turbo Pascal FAQ.

Re:programming help **please help me** its not hard


Oh, the print out should be 1, 2, 3 instead of one, three, five. Well the 2
will be a three if it also prints one space and the 3 will be a five if it
also prints two spaces. So:

Use GotoXY(42 - i, i) in an i loop running up to 24. Then use Write('* ') in
a t loop nested inside the i loop with the t loop runing from 1 to i. Both
loops step by one.

Quote

> You need GotoXY(42 - j, j) in an i loop that steps in two's up to 41 and
> increments j by one. And you need Write('*') in a t loop nested inside the
i
> loop with the t loop running from 1 to each i.

> > i need help creating a looping program so that the following is
displayed
> when
> > you press enter.
> >                                     *
> >                                    * *
> >                                   * * *
> > and so on until the last line as 41.
> > The problem i ahve is because the star is a charactor not a number so i
> can not
> > add, so i thatught about using ASCI but was not sure how to do it.
> > ***PLEASE HELP ME***
> > Thanks

Other Threads