Thread: Diamond asterisk

  1. #16
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    Quote Originally Posted by Prelude
    ...because a good programmer tests her code thoroughly before releasing it....
    What a sexist you are, assuming that a good programmer would be a "her"
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  2. #17
    System.out.println("");
    Join Date
    Jan 2005
    Posts
    84
    Sorry for giving the answer. I thought I was just helping, but I absolutely can see why it's wrong to do his work for him.

    The reason I said "but I am pretty sure that it works" is because I tested it with a few numbers and it gave me the correct results so I couldn't find anything wrong with it, but I didn't exhaustively check for errors. Such as what if they enter too few columns such that for the given number of rows it trims off part of the diamond? I suppose I could check for more errors, but it's really not that important to me for this little program.

  3. #18
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >What a sexist you are, assuming that a good programmer would be a "her"
    I'm not sexist. I'm egotistical.



    Well, probably a little sexist too, now that I think about it.
    My best code is written with the delete key.

  4. #19
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    A good programmer is a master programmer. One filled with Tao. That lives within the Tao. He, is the Tao and the Tao is he.

    ... consequently, a good programmer is an it.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  5. #20
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    *bows*
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  6. #21
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >... consequently, a good programmer is an it.
    A good programmer may be an it, but that sounds too much like objectifying programmers, which can only be bad. How about being a great programmer? A great programmer is nothing because nothing is everything and a great programmer knows everything, so by knowing everything a great programmer ends up being everything and to become everything you must be nothing. So to become a great programmer you need...um...you need to...uhhh...not be a programmer at all? Drat! Now I've gone and confused myself.


    As you were.
    My best code is written with the delete key.

  7. #22
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Some are born great.
    Some have greatness thrust upon them.
    Some accidentally discover greatness, then run away from it.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  8. #23
    carry on JaWiB's Avatar
    Join Date
    Feb 2003
    Location
    Seattle, WA
    Posts
    1,972
    One thing a programmer is not...a philosopher
    "Think not but that I know these things; or think
    I know them not: not therefore am I short
    Of knowing what I ought."
    -John Milton, Paradise Regained (1671)

    "Work hard and it might happen."
    -XSquared

  9. #24
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    Quote Originally Posted by Salem
    ...Some have greatness thrust upon them...
    or into them.

    OOOHHHHhhhh... that was so unlike me. I'm very concerned
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  10. #25
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >or into them.
    >OOOHHHHhhhh... that was so unlike me. I'm very concerned
    I can't decide if you said something profound or dirty. I've been around you guys too long it seems.
    My best code is written with the delete key.

  11. #26
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    Daoist theory attempts to explain greatness.
    To be great is to go on;
    to go on is to go far;
    to go far is to return.

    Therefore you can be great as long as you keep trying and succeed in doing that. I'm positive, when applied to programming, the last line has something to do with "going back to basics" in order to fully understand something more complex.

    But this is of course my own boring interpretation. Thinking is hard!

  12. #27
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >But this is of course my own boring interpretation.
    That's the problem. It sounds good but nobody really knows what it means. I wonder how many philosophers were clinically insane.
    My best code is written with the delete key.

  13. #28
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,212
    I believe this fulfills all the requirements:
    Code:
    #include <stdio.h>
    
    int main(void)
    {
        int i, j;
        char *diamond[8] = { "      *\n",
                             "    * * *\n",
                             "  * * * * *\n",
                             "* * * * * * *\n",
                             "  * * * * *\n",
                             "    * * *\n",
                             "      *\n", NULL };
                             
        for (i = 0; diamond[i] != NULL; i++) {
            for (j = 0; diamond[i][j] != '\0'; j++) {
                printf("%c", diamond[i][j]);
            }
        }
        
        return 0;
    }
    edit: oh, hello c++ board, thought I was on the c one.
    Last edited by Brian; 07-22-2006 at 07:01 PM.

  14. #29
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    Quote Originally Posted by Prelude
    >But this is of course my own boring interpretation.
    That's the problem. It sounds good but nobody really knows what it means. I wonder how many philosophers were clinically insane.
    All of them. Just like the mathematicians.

  15. #30
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Quote Originally Posted by Prelude
    I wonder how many philosophers were clinically insane.
    One has to be at least partially insane to try and explain human behavior and existence. Actually... those who did a good job at it had to be definitely insane, I think.

    Which brings us to the original post in this thread...

    ... It doesn't. But i'm desperatly trying not to have it closed.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Simple Blackjack Program
    By saber1357 in forum C Programming
    Replies: 1
    Last Post: 03-28-2009, 03:19 PM
  2. Bitwise Unwanted Output
    By pobri19 in forum C++ Programming
    Replies: 4
    Last Post: 09-15-2008, 04:07 AM
  3. command line asterisk converted to list
    By linucksrox in forum C++ Programming
    Replies: 19
    Last Post: 07-14-2006, 03:22 PM
  4. making a diamond using functions
    By Nikisha in forum C++ Programming
    Replies: 4
    Last Post: 03-30-2003, 09:05 PM
  5. Diamond
    By C++Nerd in forum C++ Programming
    Replies: 1
    Last Post: 10-04-2002, 04:36 AM