14,697,418 members
See more:
*---*---*
-*--*--*-
--*-*-*--
---***---
*********
---***---
--*-*-*--
-*--*--*-
*---*---*

'-' stand for spaces
Posted
Updated 11-Oct-14 7:55am
v2
[no name] 11-Oct-14 12:58pm

Have you at least tried to do your homework assignment yourself?
Member 11146011 11-Oct-14 13:20pm

Im trying just dont know how to do the diagonals :D i have a cross so far
enhzflep 11-Oct-14 13:37pm

I'm assuming so far you have a cross, like this: +
This means you draw a * if x==1/2 of width-1 or if y== 1/2 of height-1.

Let's just look at the top-left corner. Assuming the origin (0,0) is the top left, what do you notice about the relationship of the x and y axis where the *s are printed? Simple - if (x==y) then draw a *. This works for the whole line extending from the top-left to the bottom-right.
A very small modification to this check will tell you when you need to draw a * to do the line from top-right --> bottom-left. :)
Member 11146011 11-Oct-14 13:51pm

Thank you so much. I should`ve thought about that sooner :)
enhzflep 11-Oct-14 14:01pm

No problem. You're welcome. :)

## Solution 1

How about `printf` each line, e.g. for the first two lines:
```printf("*---*---*\n");
printf("-*--*--*-\n");
...```
You say nowhere that you need to calculate anything.
Cheers
Andi
v3