1 Replies - 542 Views - Last Post: 07 December 2012 - 04:06 AM Rate Topic: -----

#1 DimiBy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 28-September 11

Print the words inside the ring. Pascal

Posted 07 December 2012 - 03:43 AM

Hello!

Please help to bring the phrase "Hello, World!" strictly centered on the screen, in the ring of stars (the program below displays a ring of stars).

1

uses graph;
{рисование 1 звезды}
procedure Zvezda(x,y:integer);
var i:integer;
    u:real;
    p:array[1..11] of pointtype;
begin
u:=-pi/10;
for i:=1 to 10 do
 begin
  if i mod 2=0 then
   begin
    p[i].x:=x+round(10*cos(u));
    p[i].y:=y-round(10*sin(u));
   end
  else
   begin
    p[i].x:=x+round(5*cos(u));
    p[i].y:=y-round(5*sin(u));
    end;
  u:=u+pi/5;
 end;
p[11]:=p[1];
setcolor(12);
setfillstyle(1,12);
fillpoly(11,p);
end;
 
var  xc,yc,i,x,y:integer;
     u:real;
begin
initgraph(x,y,'');
xc:=getmaxX div 2;
yc:=getmaxY div 2;
u:=0;
for i:=0 to 11 do
 begin
  x:=xc+round(40*cos(u));
  y:=yc-round(40*sin(u));
  Zvezda(x,y);
  u:=u+pi/6
 end;
readln
end.


Is This A Good Question/Topic? 0
  • +

Replies To: Print the words inside the ring. Pascal

#2 sepp2k  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2149
  • View blog
  • Posts: 3,303
  • Joined: 21-June 11

Re: Print the words inside the ring. Pascal

Posted 07 December 2012 - 04:06 AM

Moved to "Other Languages". Pascal is not a functional programming language.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1