On Wed, Jul 16, 2008 at 8:58 PM, John Gaughan <[EMAIL PROTECTED]> wrote:
> jay-r wrote:
>> what's wrong with this code? [strike]i can't create a triangle..[/strike]
Emphasis included. Code below deliberately included.
>> int rows = 10;
>> double cols = rows*1.5;
>> string s = " ";
>> string::size_type space = s.size();
>> for (int r = 0; r != rows; ++r)
>> { string::size_type c = 0;
>> while (c != cols)
>> { if (c == space - 1)
>> {cout<< "*";
>> c += space; }
>> else
>> { if (r == rows - 1 || c == 0)
>> cout<< "*";
>> else
>> cout<< " ";
>> ++c;}}
>> cout<<endl;}
>>
>
> How are you writing the "diagonal" leg?
I thought it was gmail, but from the reply from someone not on gmail.....
The first thing wrong with the the code is the indentation. Or general
presentation.
There is none. I suspected the author, but would charitably blame the
sending email client.
I was not inclined to read the original code because it was unreadable.
To the OP:
Assume your code will be seen by others, even if you think it won't.
If you want comment/help with code, you must spend the effort to make
it effortless for the many eyes that will view that code.
Badly presented code: You spend 0s on it, 1000+ people spend 15s+
deciding to ignore it....
Good code: You spend 180s on it, 1000+ people spend 15s+ deciding to
ignore it, <10 people spend 5 mins looking at it and give
construstive comments...
--
PJH
'Two Dead in Baghdad' not 'product-friendly' - Kent Ertugrul, chief
executive of Phorm.
http://shabbleland.myminicity.com/env