Hi guys,
I need to write a prog that will display 4 different shapes when a menu is selected, I haven't as yet written the menu (please don't help with this -)
need to draw a normal triangle, an upside down one, a pyramid and a diamond.
the issue I'm having is with the diamond.
I figured I'd have a loop for 1 to 10 do and then follow that up with a 10 downto 1 to create the reverse effect but I'm getting some odd results and all sorts of errors.
Could/would you mind pointing me in the right direction?
thanks.
code so far -
Thanks in advance.Code:program STARS2TEST(output); uses crt; const Title:string = ' STARS '; By:string = ' By Steve Green '; var i,j,k,l: integer; begin {main program} ClrScr; textcolor(red); writeln (Title); writeln; writeln (by); writeln; textcolor(green); for i := 1 to 10 do begin for j:= 1 to 10-i do //this is normal pyramid write(' '); for j:= 1 to i do write('*'); for j:=1 to i-1 do write('*'); writeln; end; { for i := 10 downto 1 do begin for j:= 1 to 10-i do //this is upside down pyramid write(' '); for j:= 1 to i do write('*'); for j:=1 to i-1 do //these don't work together... write('*'); writeln; end; } writeln; writeln; writeln; textcolor(red); writeln ('Press <Return> to continue'); readln (); end.
'Heres to hoping the otehr guys in class don't check this and thieve my code (as weak and poor as it is)'Jay....Leave code alone!
![]()


)
Jay....Leave code alone!
Reply With Quote


