Computer Science Canada A little help |
Author: | Fubar [ Sun May 15, 2005 1:03 pm ] |
Post subject: | A little help |
I figured it out thanks Cervantes. |
Author: | Cervantes [ Sun May 15, 2005 2:17 pm ] |
Post subject: | |
Welcome to compsci.ca. Your question sounds like homework to me. Know that we don't do homework for you. I hope that's not what you're asking. To help you, though: You'll definately need to know for loops. Getting the top and bottom lines of the z should be easy using for loops (actually, it's easier without for loops and with using repeat). Getting the middle line is a little harder. Use a for loop to go down from the top of the z to the bottom and the number of spaces to put before the '*' is directly related to how far down the z you are. Hopefully you understood that. If not... well, it's really not that hard. Thinking about it for a minute or two should do the trick. Oh, and if you don't know for loops, here's a link to the tutorial. |
Author: | Fubar [ Sun May 15, 2005 2:42 pm ] | ||
Post subject: | |||
well basically i couldn't get the middle part of the 'z'.
still working on it. thanks, Fubar |
Author: | sockoo [ Sun May 15, 2005 3:27 pm ] | ||
Post subject: | |||
i modified ur code to what i beleive you want .. lemme know
|
Author: | Fubar [ Sun May 15, 2005 3:35 pm ] |
Post subject: | |
That's not what i meant ^^. Say the user inputs 3, it would draw this: *** ^*^ *** so it looks like a 'z'. |
Author: | Notoroge [ Sun May 15, 2005 3:49 pm ] | ||
Post subject: | |||
You're welcome. |
Author: | Notoroge [ Sun May 15, 2005 3:52 pm ] |
Post subject: | |
Wow sockoo, You're really over complicating it. If it works, it works though. Update: Haha, what a way to delete your post just in time. |
Author: | Fubar [ Sun May 15, 2005 4:07 pm ] |
Post subject: | |
Notorage it doesn't work. this is how it's supposed to look: See how it's suppose to allign. |
Author: | Cervantes [ Sun May 15, 2005 4:07 pm ] | ||
Post subject: | |||
That's the connection I was getting at, Notoroge, between size and the position of the star in the diagonal line. Now that you've given him the answer... let's improve it.
There's no need to use a loop like you did, when we know how many times we want it to execute and when we want a counter variable. Just use a for loop! |
Author: | Notoroge [ Sun May 15, 2005 4:09 pm ] |
Post subject: | |
Dude, I updated it. Look at it. It works perfectly. Ah! I should have typed that in the Update as well. Look at it though. IT WORKS! |
Author: | sockoo [ Sun May 15, 2005 7:00 pm ] |
Post subject: | |
Notoroge wrote: Wow sockoo, You're really over complicating it. If it works, it works though.
Update: Haha, what a way to delete your post just in time. lol yes i deleted my post as i saw ur's works perfectly |