Computer Science Canada Need ur help |
Author: | Mike [ Tue Nov 12, 2002 4:32 pm ] |
Post subject: | Need ur help |
Write a program to fill execution window with diagonal lines of Asterisks separated by diagonal blank lines.(note that this can be Accomplished easily by outputting lines of alternating asterisks and Blanks using, in turn , either Put repeat("*",40) |
Author: | FizixMan [ Tue Nov 12, 2002 7:23 pm ] | ||
Post subject: | |||
If you wanted: * * * * * * .* * * * * * * * * * * * .* * * * * * * * * * * * .* * * * * * * * * * * * .* * * * * * (btw, I put the period in 'cause the web browser didn't register the space in front of the even lines. So think of the period as a space.) then this code will work.
I use the "mod" thing to get the remainder of "count" so I can alternate between putting " *" and " *" on the rows. Because if the row is odd, I'll get a remainder of 1 and if the row is even then I'll get 0. I had to add the extra "*" on the odd rows 'cause there was still space for one to fit an asterix but not the extra space. That's also why it repeats only 39 times.[/code] |