@shady1234,
Why don't you break it down into 3 stages?
STAGE 1: Just loop through degrees 0, 10, 20, ..., 360 and output the sine of the angle.
STAGE 2: Same loop, but this time output the NUMBER of stars instead of the sine value.
STAGE 3: Same, but change the number of stars into actually printing out that many.
Thus:
STAGE 1 - just the value of sine (careful degrees -> radians)
sin( 0) = 0
sin( 10) = 0.173648
sin( 20) = 0.34202
sin( 30) = 0.5
sin( 40) = 0.642788
sin( 50) = 0.766044
sin( 60) = 0.866025
sin( 70) = 0.939693
sin( 80) = 0.984808
sin( 90) = 1
sin(100) = 0.984808
sin(110) = 0.939693
sin(120) = 0.866025
sin(130) = 0.766044
sin(140) = 0.642788
sin(150) = 0.5
sin(160) = 0.34202
sin(170) = 0.173648
sin(180) = 1.22461e-016
sin(190) = -0.173648
sin(200) = -0.34202
sin(210) = -0.5
sin(220) = -0.642788
sin(230) = -0.766044
sin(240) = -0.866025
sin(250) = -0.939693
sin(260) = -0.984808
sin(270) = -1
sin(280) = -0.984808
sin(290) = -0.939693
sin(300) = -0.866025
sin(310) = -0.766044
sin(320) = -0.642788
sin(330) = -0.5
sin(340) = -0.34202
sin(350) = -0.173648
sin(360) = -2.44921e-016 |
STAGE 2: convert to numbers of stars (note: include a negative sign where appropriate); there's actually a little bit of ambiguity here, if every row is to have at least one star.
sin( 0) = stars( 1 )
sin( 10) = stars( 4 )
sin( 20) = stars( 7 )
sin( 30) = stars( 10 )
sin( 40) = stars( 13 )
sin( 50) = stars( 15 )
sin( 60) = stars( 17 )
sin( 70) = stars( 19 )
sin( 80) = stars( 20 )
sin( 90) = stars( 20 )
sin(100) = stars( 20 )
sin(110) = stars( 19 )
sin(120) = stars( 17 )
sin(130) = stars( 15 )
sin(140) = stars( 13 )
sin(150) = stars( 10 )
sin(160) = stars( 7 )
sin(170) = stars( 4 )
sin(180) = stars( 1 )
sin(190) = stars( -4 )
sin(200) = stars( -7 )
sin(210) = stars( -10 )
sin(220) = stars( -13 )
sin(230) = stars( -15 )
sin(240) = stars( -17 )
sin(250) = stars( -19 )
sin(260) = stars( -20 )
sin(270) = stars( -20 )
sin(280) = stars( -20 )
sin(290) = stars( -19 )
sin(300) = stars( -17 )
sin(310) = stars( -15 )
sin(320) = stars( -13 )
sin(330) = stars( -10 )
sin(340) = stars( -7 )
sin(350) = stars( -4 )
sin(360) = stars( -1 ) |
STAGE 3: actually output (spaces + ) stars
sin(0) = *
sin(10) = ****
sin(20) = *******
sin(30) = **********
sin(40) = *************
sin(50) = ***************
sin(60) = *****************
sin(70) = *******************
sin(80) = ********************
sin(90) = ********************
sin(100) = ********************
sin(110) = *******************
sin(120) = *****************
sin(130) = ***************
sin(140) = *************
sin(150) = **********
sin(160) = *******
sin(170) = ****
sin(180) = *
sin(190) = ****
sin(200) = *******
sin(210) = **********
sin(220) = *************
sin(230) = ***************
sin(240) = *****************
sin(250) = *******************
sin(260) = ********************
sin(270) = ********************
sin(280) = ********************
sin(290) = *******************
sin(300) = *****************
sin(310) = ***************
sin(320) = *************
sin(330) = **********
sin(340) = *******
sin(350) = ****
sin(360) = * |