Frooster

Concatinated BGI Programs in One

May 17th, 2015
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 17.54 KB | None | 0 0
  1. //==================this programme was done by=======================
  2. //================a.s.ram narayanan================================
  3.  
  4. note:THIS WORKS only IN TURBO C++
  5. /*In this program 6 sub programs are clubbed together where the
  6. program does the following
  7.  
  8. 1.displays a menu
  9. 2.asks for value to implement the following program accordingly
  10. 3.consists of six programs which are displayed in the menu itself
  11.  
  12. working
  13.  
  14. The working is based on simple function calling feature
  15. according to the value the particular the function is implemented
  16. */  
  17.  
  18.  
  19. #include<iostream.h>
  20. #include<conio.h>
  21. #include<stdlib.h>
  22. #include<graphics.h>
  23. #include<dos.h>
  24. #include<stdio.h>
  25. #include<math.h>
  26. #define address_count 4
  27. void graphic_menu();//menu graphics prototype(not to be confused with void menu)
  28. void solarsys(); //solarsys protoype
  29. void address_book(); //address book prototype
  30. void numbers_to_words(); //numbers into words programme prototype
  31. void smiley();//smiley programme
  32. void moving_bus(); //moving bus progamme
  33. void moving_train();//moving train programme
  34.  
  35. void calc();    /*scientific calculator program function porotypes*/
  36. double cores (double);
  37. double res (double);
  38.  
  39. float sub(float,float);
  40. float div(float,float);
  41. float mul(float,float);
  42. float add(float,float);
  43. float ramp(float,float);
  44. double modulus(double);
  45. void menu();//sci fi calculator protoype
  46.  
  47. float a,b,c,ch; //globl variable sfor scienfi calculator
  48. int ch1;
  49.  
  50. int n1,n2,n3,n4,n5;//declaring global variables for numbers to words
  51.  
  52. void main()  //THE MAIN
  53. {
  54. clrscr();
  55.  int gdriver=DETECT,gmode;
  56.   initgraph(&gdriver,&gmode,"C://TC//bgi");
  57.  
  58.  
  59.  
  60. int ch;
  61.  
  62. graphic_menu();
  63. gotoxy(10,20);
  64. cin>>ch;
  65.  
  66. if(ch==1)
  67.  {
  68.   solarsys();
  69.  }
  70.  
  71.  else if(ch==2)
  72.  {
  73.     address_book();
  74.  }
  75.  
  76.  else if(ch==3)
  77. {
  78.     calc();
  79.  }
  80.  
  81.  else if(ch==4)
  82.   {
  83.  numbers_to_words();
  84.   }
  85.  
  86.   else if(ch==5)
  87.  {
  88.  smiley();
  89.  }
  90.  
  91.  else if(ch==6)
  92. {
  93.  
  94.  moving_bus();
  95.  
  96. }
  97.  
  98. else if(ch==7)
  99. {
  100.   moving_train();
  101.  
  102.   }
  103.  else
  104.  {
  105.  
  106.   cout<<"sorry out of cridentials";
  107.  
  108.  }
  109.  getch();
  110.  closegraph();
  111.  }
  112.  
  113. void graphic_menu()//menu function
  114.  
  115. {
  116.  
  117.  
  118.    setfillstyle(SOLID_FILL,BLUE);
  119.   bar(0,10,300,250);//COLORED RECTANGLE(blue main)
  120.   setfillstyle(SOLID_FILL,BROWN);//small rectangle for menu(only for text)
  121.   bar(20,20,150,50);//small bar
  122.   //setcolor(GREEN);//for rctabgle border(small one)
  123.  
  124.   rectangle(20,20,150,50);//border(small)
  125.  
  126.   settextjustify(30,5);
  127. settextstyle(GOTHIC_FONT,HORIZ_DIR,5);
  128. outtextxy(30,5,"menu");
  129. setcolor(WHITE);//outline color for rectangle
  130. rectangle(0,10,300,250);//border of rectangle
  131.  
  132.  /* ==  TEXT FOR SOLAR SYSTEM===*/
  133. settextjustify(0,60);
  134. settextstyle(SANS_SERIF_FONT,HORIZ_DIR,2);
  135. outtextxy(0,60,"1.solarsystem(bgi)");
  136.  
  137. /*==text for address book==*/
  138. settextjustify(0,80);
  139. settextstyle(SANS_SERIF_FONT,HORIZ_DIR,2);
  140. outtextxy(0,80,"2.addressbook(underconstruct)");
  141.  
  142. /*==text for scientific calculator===*/
  143. settextjustify(0,100);
  144. settextstyle(SANS_SERIF_FONT,HORIZ_DIR,2);
  145. outtextxy(0,100,"3.sci-fi calc(withno inbuilt fn)");
  146.  
  147.  
  148. /*==text for NUMBERS TO WORDS===*/
  149. settextjustify(0,120);
  150. settextstyle(SANS_SERIF_FONT,HORIZ_DIR,2);
  151. outtextxy(0,120,"4.numbers to words");
  152.  
  153.  
  154. /*==text for smiley===*/
  155. settextjustify(0,140);
  156. settextstyle(SANS_SERIF_FONT,HORIZ_DIR,2);
  157. outtextxy(0,140,"5.smiley(bgi)");
  158.  
  159.  
  160. /*==text for bus===*/
  161. settextjustify(0,160);
  162. settextstyle(SANS_SERIF_FONT,HORIZ_DIR,2);
  163. outtextxy(0,160,"6.moving bus(bgi)");
  164.  
  165.  
  166. /*==text for train===*/
  167. settextjustify(0,180);
  168. settextstyle(SANS_SERIF_FONT,HORIZ_DIR,2);
  169. outtextxy(0,180,"7.moving train(bgi)");
  170.  
  171.  
  172. /*==text for choice===*/
  173. settextjustify(0,210);
  174. settextstyle(SMALL_FONT,HORIZ_DIR,5);
  175. outtextxy(0,210,"ENTER YOUR CHOICE 1/2/3/4/5/6/7");
  176.  
  177. }
  178.  
  179.  void solarsys()//solarsys function
  180. {
  181.    for(int i=0;i<20;i++)
  182. {
  183. setcolor(i+1);
  184. delay(100);
  185. settextjustify(100,50);
  186. settextstyle(TRIPLEX_FONT,HORIZ_DIR,5);
  187. outtextxy(100,50,"MAGIC OF GRAPHICS.h");
  188. settextjustify(100,100);
  189. settextstyle(SANS_SERIF_FONT,HORIZ_DIR,5);
  190. outtextxy(100,100,"by ram");
  191.  
  192.  
  193. }
  194.  printf("\n\n\n\n");
  195. setcolor(RED);            //FOR THE CENTRE CIRCLE
  196. setfillstyle(SOLID_FILL,BROWN);
  197. circle(300,300,120);
  198. floodfill(300,300,RED);
  199.  
  200.  
  201. setcolor(WHITE);                //FOR ORBIT PATH ELLIPSE 1
  202. ellipse(300,300,0,360,200,70);
  203. setcolor(BLUE);                 //FOR PLANET 1(YELLOW WITH BLUE BORDER)
  204. setfillstyle(SOLID_FILL,YELLOW);
  205. circle(400,350,30);
  206. floodfill(400,350,BLUE);
  207. setcolor(WHITE);                //FOR ORBIT PATH ELLPSE 2
  208. ellipse(300,300,0,360,250,80);
  209. setcolor(GREEN);                //FOR PLANET 2(BLUE WITH GREEN BORDER)
  210. setfillstyle(SOLID_FILL,BLUE);
  211. circle(550,300,30);
  212. floodfill(550,300,GREEN);
  213. setcolor(WHITE);
  214. ellipse(300,300,0,360,300,90);  //FOR ORBIT PATH ELLIPSE 3
  215. setcolor(BLUE);
  216. setfillstyle(SOLID_FILL,CYAN); //FOR PLANET 3 (GREEN WITH BLUE BORDER
  217. circle(100,300,30);
  218. floodfill(100,300,BLUE);
  219. setcolor(WHITE);
  220. ellipse(300,300,0,360,310,95);
  221. setcolor(GREEN);
  222. setfillstyle(SOLID_FILL,WHITE); //FOR PLANET 4 (GREEN WITH BLUE BORDER
  223. circle(40,300,25);
  224. floodfill(40,300,GREEN);
  225.  
  226. setcolor(RED);                           //for lightgreen planet with red border
  227. setfillstyle(SOLID_FILL,LIGHTGREEN);
  228. circle(540,250,20);
  229. floodfill(540,250,RED);
  230.  
  231. setcolor(YELLOW);   /*FOR THE SUN TEXT*/
  232. settextjustify(300,300);
  233. settextstyle(SANS_SERIF_FONT,HORIZ_DIR,5);
  234. outtextxy(270,250,"SUN");
  235.  
  236. setcolor(MAGENTA);
  237. setfillstyle(SOLID_FILL,MAGENTA);
  238.  
  239. circle(170,370,25);
  240. floodfill(170,370,MAGENTA);
  241.  
  242.  }
  243.  
  244.   struct address
  245.     {
  246.   long long   int housenum,phonenum,pin;
  247.     char houseadd[100],name[50];
  248.  
  249.     };
  250.     void address_book()//start of address book program
  251.     {
  252.  address addres[address_count];//declaring array of addres for more than 1 person to input
  253.  
  254.    int gdriver=DETECT,gmode;    //INITIALSISING GRAPHICS
  255.   initgraph(&gdriver,&gmode,"C://TC//bgi");//INITIALISING GRAPHICS
  256.  
  257.   setbkcolor(BLACK);//BACKGROUND COLOR
  258.  
  259.   setcolor(YELLOW);//SETTING COLOR FOR RECTANGLE
  260.   rectangle(1,1,170,50);  //RECTANGULAR COLUMN FOR INPUT
  261.  
  262.    setfillstyle(YELLOW,SOLID_FILL); //FILLING THE RECTANGLE
  263.  
  264.  
  265.  
  266.  
  267.  
  268.   gotoxy(2,2);
  269.  cout<<"-------INPUT-------";
  270.  cout<<"\n"<<"\n"<<"\n";
  271.  
  272.  
  273.  
  274.  
  275.  
  276.   for(int i=0;i<address_count;i++)//input
  277.       {
  278.   cout<<"enetr the name :";
  279.      gets(addres[i].name);
  280.      cout<<"enter the phone num :";
  281.      cin>>addres[i].phonenum;
  282.      cout<<"enter the house address (max 100 char) :";
  283.      gets(addres[i].houseadd);
  284.      cout<<"enter the pin code :";
  285.      cin>>addres[i].pin;  //pin
  286.  
  287.       cout<<"enetr the house number :";
  288.      cin>>addres[i].housenum;
  289.      cout<<endl;
  290.  
  291.       }
  292.      cout<<endl;
  293.  
  294.     /* setcolor(YELLOW);//SETTING COLOR FOR RECTANGLE
  295.   rectangle(1,300,400,50);  //RECTANGULAR COLUMN FOR INPUT
  296.  
  297.    setfillstyle(YELLOW,SOLID_FILL); //FILLING THE RECTANGLE
  298.    */
  299.      cout<<"---------------OUTPUT----------------"<<endl;
  300.    //  cout<<"-------------"<<"***********************"<<"-------"<<endl;
  301.      for( i=0;i<address_count;i++)
  302.      {
  303.  
  304.    cout<<"name:"<<addres[i].name<<endl;
  305.   cout<<"phone no."<<addres[i].phonenum<<endl;
  306.   cout<<"address :"<<addres[i].houseadd<<endl;
  307.   cout<<"pin code:"<<addres[i].pin<<endl;
  308.   cout<<"house numb:"<<addres[i].housenum<<endl;
  309.   cout<<endl;
  310.   }
  311.  
  312.  
  313.    }
  314.   void calc()
  315. {
  316.  clrscr();
  317.  
  318.   menu();
  319.  
  320.   cin >> ch;
  321.  if (ch == 1)
  322.  {
  323.   c = mul(a, b);
  324.   cout << "the multilication result is" << c;
  325.  }
  326.  else if (ch == 2)
  327.  {
  328.   c = add(a, b);
  329.   cout << "the result is" << c;
  330.  }
  331.  else if (ch == 3)
  332.  {
  333.   c = sub(a, b);
  334.   cout << "the result is" << c;
  335.  }
  336.  else if (ch == 4)
  337.  {
  338.   c = div(a, b);
  339.   cout << "the result is " << c;
  340.  }
  341.  else if (ch == 5)
  342.  {
  343.   cout << "the power is";
  344.   c = ramp(a, b);
  345.   cout << "the result is" << c;
  346.  }
  347.  else if (ch == 6)
  348.  {
  349.   cout << "the modulus o9f the no. is" << endl;
  350.   c = modulus(a);
  351.   cout << c;
  352.  }
  353.  else if (ch == 7)
  354.  {
  355.   cout << "the cos value is" << endl;
  356.   c = cores(a);
  357.   cout << c;
  358.  }
  359.  else if (ch == 8)
  360.  {
  361.   cout << "the sin value is" << endl;
  362.   c = res(a);
  363.   cout << c;
  364.  }
  365.  else
  366.  {
  367.   cout << "out of credentials you asre a piece of shit";
  368.  }
  369.  
  370.    getch();
  371.  
  372.  
  373. }
  374.  
  375.  
  376.  
  377. float mul(float x, float y)
  378. {
  379.  float res;
  380.  
  381.   res = x*y;
  382.  
  383.   return (res);
  384. }
  385.  
  386. float add(float x, float y)
  387. {
  388.  float res;
  389.  
  390.   res = x + y;
  391.  
  392.   return (res);
  393. }
  394.  
  395. float sub(float x, float y)
  396. {
  397.  float res;
  398.  
  399.   res = x - y;
  400.  return (res);
  401. }
  402.  
  403. float div(float x, float y)
  404. {
  405.  float res;
  406.  
  407.   res = x / y;
  408.  
  409.   return (res);
  410. }
  411.  
  412. float ramp(float x, float y)
  413. {
  414.  float i, s = 1;
  415.  for (i = 1; i <= y; i++)
  416.  {
  417.   s = s*x;
  418.  }
  419.  
  420.   return (s);
  421. }
  422.  
  423. double modulus(double x)
  424. {
  425.  double res;
  426.  
  427.   res = fabs(x);
  428.  
  429.   return (res);
  430. }
  431. void menu()
  432. {
  433.  cout << "=======PROGRAM FOR SCIENTIFIC CALCULATOR=======" << endl;
  434.  cout << "enter the variabes" << endl;
  435.  
  436.   cout << "eneter a:" << endl;
  437.  cout << "enter b:" << endl;
  438.  cin >> a;
  439.  cin >> b;
  440.  
  441.   cout << "enter the function which you want to perform" << endl;
  442.  
  443.   cout << "1.mult" << endl << "2.add" << endl << "3.sub" << endl << "4.div" << endl << "5.pow" << endl << "6.modulus" << endl;
  444.  cout << "7.cos" << endl << "8.sin" << endl << "9.tan" << endl;
  445.  
  446. }
  447.  
  448. double cores(double ang)
  449. {
  450.  double result = 0;
  451.  if (ang == 45)
  452.  {
  453.   a = b = 1;
  454.   c = a*a + b*b;
  455.   cout << "the cos value of 45 deg is" << endl;
  456.   result = (b / sqrt(c));
  457.  
  458.  
  459.   }
  460.  else if (ang == 60)
  461.  {
  462.   b = 1, c = 2;
  463.   c = 2 * b;
  464.   a = ((c*c) - (b*b));
  465.  
  466.  
  467.    cout << "the cos value is" << result;
  468.  }
  469.  else if (ang == 30)
  470.  {
  471.   b = 1, c = 2;
  472.   c = 2 * b;
  473.   a = ((c*c) - (b*b));
  474.  
  475.    result = (sqrt(a) / c);
  476.  
  477.  
  478.  
  479.   }
  480.  else if (ang == 90)
  481.  {
  482.   result = 1;
  483.  
  484.    cout << "cos value is ";
  485.  }
  486.  else if (ang == 37)
  487.  {
  488.   a = 3, b = 4;
  489.   c = ((a*a) + (b*b));
  490.   result = b / sqrt(c);
  491.  
  492.    cout << "the cos value of 37 is ";
  493.  }
  494.  else if (ang == 53)
  495.  {
  496.   a = 4, b = 3;
  497.   c = ((a*a) + (b*b));
  498.   result = a / sqrt(c);
  499.  
  500.    cout << "the cos value of 53 is ";
  501.  }
  502.  else if (ang == 0)
  503.  {
  504.   result == 1;
  505.  
  506.    cout << "the cos value is";
  507.  }
  508.  else
  509.  {
  510.   cout << "sorry out of the given credentials";
  511.  }
  512.  
  513.  
  514.  
  515.   //getch();
  516.  
  517.   return (result);
  518. }
  519.  
  520. double res(double ang)
  521. {
  522.  double result = 0;
  523.  
  524.   if (ang == 45)
  525.  {
  526.   a = b = 1;
  527.   c = a*a + b*b;
  528.   cout << "the cos value of 45 deg is" << endl;
  529.   result = (b / sqrt(c));
  530.   cout << result;
  531.  }
  532.  else if (ang == 60)
  533.  {
  534.   b = 1, c = 2;
  535.   c = 2 * b;
  536.   a = ((c*c) - (b*b));
  537.  
  538.  
  539.    result = (sqrt(a) / c);
  540.   cout << "\n" << "the sin value is" << result;
  541.  }
  542.  else if (ang == 30)
  543.  {
  544.   b = 1, c = 2;
  545.   c = 2 * b;
  546.   a = ((c*c) - (b*b));
  547.  
  548.  
  549.    result = (b / c);
  550.   cout << "\n" << "the sin value is" << result;
  551.  
  552.   }
  553.  else if (ang == 90)
  554.  {
  555.  
  556.    result = 0;
  557.   cout << "\n" << "the value of sin wll be" << result;
  558.  }
  559.  else if (ang == 37)
  560.  {
  561.   a = 3, b = 4;
  562.   c = ((a*a) + (b*b));
  563.  
  564.    result = a / sqrt(c);
  565.   cout << "\n" << "the sin value of 37 is" << result;
  566.  }
  567.  else if (ang == 53)
  568.  {
  569.   a = 4, b = 3;
  570.   c = ((a*a) + (b*b));
  571.  
  572.    result = b / sqrt(c);
  573.   cout << "\n" << "the sin value of 53 is" << result;
  574.  }
  575.  else if (ang == 0)
  576.  {
  577.  
  578.    result == 0;
  579.   cout << "\n" << "the sin value is " << result;
  580.  }
  581.  else
  582.  {
  583.   cout << "sorry out of the given credentials";
  584.  }
  585.  
  586.   //getch();
  587.  
  588.   return (result);
  589. }
  590. void numbers_to_words()
  591. {
  592.  
  593.  
  594.     cout<<"enter the five digits ";
  595.     cout<<"\n";
  596.     cin>>n5>>n4>>n1>>n2>>n3;
  597.  
  598.     switch(n5%10000)
  599.      {
  600.        case 0:break;
  601.     case 1: cout<<" ten";break;
  602.     case 2:cout<<" tewnty";break;
  603.     case 3:cout<<" thirty";break;
  604.     case 4:cout<<" forty";break;
  605.     case 5:cout<<" fifty";break;
  606.     case 6:cout<<" sixty";break;
  607.     case 7:cout<<" seventy";break;
  608.     case 8:cout<<" eighty";break;
  609.     case 9:cout<<" ninety";break;
  610.     default:cout<<" ERROR 404";break;
  611.     }
  612.  
  613.      switch(n4%1000)
  614.     {
  615.       case 0:cout<<" thousand";break;
  616.    case 1:cout<<"one thousand";
  617.        break;
  618.     case 2: cout<<"two thousand";break;
  619.  
  620.      case 3: cout<<"three thousand";break;
  621.     case 4: cout<<"four thousand";break;
  622.     case 5:cout<<"five thousand ";break;
  623.     case 6 : cout<<"six  thousand ";break;
  624.     case 7:cout<<"seven thousand ";break;
  625.     case 8: cout<<"eight thousand";break;
  626.     case 9:cout<<"nine thousand";break;
  627.     default:cout<<"error 404";           break;
  628.  
  629.      }
  630.     switch(n1%100)
  631.     {
  632.     case 0:break;
  633.    case 1:cout<<" one hundred and ";
  634.        break;
  635.     case 2: cout<<" two hundred and ";break;
  636.  
  637.      case 3: cout<<" three hundred and";break;
  638.     case 4: cout<<" four hundred and ";break;
  639.     case 5:cout<<" five hundred and ";break;
  640.     case 6 : cout<<" six hundred and ";break;
  641.     case 7:cout<<" seven hundred and ";break;
  642.     case 8: cout<<" eight hundred and ";break;
  643.     case 9:cout<<" nine hunderd and ";break;
  644.     default:cout<<" error 404";           break;
  645.  
  646.      }
  647.  switch(n2%10)
  648.      {
  649.        case 0:break;
  650.     case 1: cout<<" ten";break;
  651.     case 2:cout<<" tewnty";break;
  652.     case 3:cout<<" thirty";break;
  653.     case 4:cout<<" forty";break;
  654.     case 5:cout<<" fifty";break;
  655.     case 6:cout<<" sixty";break;
  656.     case 7:cout<<" seventy";break;
  657.     case 8:cout<<" eighty";break;
  658.     case 9:cout<<" ninety";break;
  659.     default:cout<<" ERROR 404";break;
  660.     }
  661.     switch(n3%10)
  662.      {
  663.    case 0: break;
  664.     case 1: cout<<" one";break;
  665.     case 2:cout<<" two";break;
  666.     case 3:cout<<" three";break;
  667.     case 4:cout<<" four";break;
  668.     case 5:cout<<" five";break;
  669.     case 6:cout<<" six";break;
  670.     case 7:cout<<" seven";break;
  671.     case 8:cout<<" eight";break;
  672.     case 9:cout<<" nine ";break;
  673.     default:cout<<" ERROR 404";break;
  674.     }
  675.  
  676.  
  677.  
  678. }
  679. void smiley()
  680. {
  681.  
  682.  for(int i=1;i<=360;i++)   //start of loop
  683. {
  684.  
  685.  arc(400,250,0,i,210);//THE FACE MAIN PART
  686.  
  687. setcolor(CYAN);
  688.  ellipse(300,200,0,i,100,40);
  689.  
  690.  
  691.  
  692.     circle(300,200,30);//THE FIRST EYE
  693.  
  694.      ellipse(500,200,0,i,100,40);//THE SECOND EYE ELLIPSE 2
  695.     setcolor(CYAN);
  696.      setcolor(CYAN);
  697.     circle(500,200,30);//THE SECOND EYE
  698.     arc(400,300,180,360,100); //THE MOUTH
  699.  
  700.  
  701.      delay(10);
  702.  
  703.      }  //end of loop
  704.  
  705.   }//end of main
  706.  
  707. void moving_bus()
  708.  {
  709.  setcolor(GREEN);
  710. for(int i=1;i<200;i++)
  711. {
  712. line(100,220,700,220);
  713.  
  714. circle(150+i,200,20); //back tyre
  715. circle(150+i,200,15);//rim of back tyre
  716. circle(350+i,200,20);//front tyre
  717. circle(350+i,200,15);//rim of front tyre
  718. delay(10);
  719. cleardevice();
  720. //line(100+i,100+i,50,50);
  721. rectangle(100+i,100,400+i,200); //main body
  722. rectangle(105+i,105,300+i,150);//back window
  723. rectangle(305+i,105,385+i,150);//front window
  724. line(185+i,105,185+i,200);//back part of door
  725. line(265+i,105,265+i,200);//front part of door
  726. rectangle(195+i,160,205+i,165);//door handle
  727. rectangle(390+i,175,400+i,185); //front indicator
  728.  
  729. settextjustify(100,220);
  730. settextstyle(TRIPLEX_FONT,HORIZ_DIR,5);
  731. outtextxy(100,220,"Moving bus");
  732. settextjustify(130,260);
  733. settextstyle(SANS_SERIF_FONT,HORIZ_DIR,5);
  734. outtextxy(130,260,"by RAM");
  735.  
  736. delay(10);
  737.  
  738. //cleardevice();
  739.  }//end of loop
  740. }//end of function
  741.  
  742. void moving_train()//start of train function
  743. {
  744. setcolor(GREEN);
  745. for(int i=1;i<200;i++)
  746. {
  747.  
  748. rectangle(40,220,700,230); //the base of the train(track)
  749.  
  750. /*the tyre part with spokes and rims---------*/
  751.  
  752. circle(150+i,200,20); //back tyre
  753. circle(150+i,200,15);//rim of back tyre
  754. circle(195+i,200,20);//2nd back tyre
  755. circle(195+i,200,15);//rim of 2nd back tyre right hand side
  756. rectangle(150+i,196,200+i,207);//spoke between 2 back tryes
  757. circle(195+i,200,20);//2nd back tyre(right  from left)
  758.  
  759. circle(350+i,200,20);//front 2nd tyre(right most)
  760. rectangle(305+i,196,355+i,207);//spoke between 2 front  tryes
  761. circle(305+i,200,15);//rim of front 1st trye right ahnd side
  762. circle(305+i,200,20);//front 1st trye
  763. circle(350+i,200,15);//rim of 2nd front tyre
  764.  
  765. /*---now for the holding pivot or the attachment of the spoke to the train--*/
  766. rectangle(150+i,180,155+i,200);//pivot of the 1 st tyre (back)
  767. rectangle(195+i,180,200+i,200);//pivot of the 2nd BACK TYRE
  768.  
  769. rectangle(305+i,180,310+i,200);//pivot of 2nd front tyre (2nd form rightmost)
  770. rectangle(350+i,180,355+i,200);//pivot of 1st front tyre (1st from rightmost)
  771.  
  772. /*=========now for the upper part of the train===*/
  773. rectangle(280+i,90,360+i,100);//front (rightmost)
  774. rectangle(120+i,90,200+i,100);//backside
  775.  
  776. /*======electricity connection wire =====*/
  777. line(40,50,500,50);//main line(upper wire)
  778. line(300+i,70,320+i,50);//connector(2) (train with main line)(1st one from right)
  779. line(300+i,70,310+i,90);//small bending in the 1st connector
  780.  
  781. line(150+i,70,160+i,50);//small bending in connector (1)
  782. line(150+i,70,160+i,90);//connector(1)
  783.  
  784.  
  785. delay(10);
  786. cleardevice();
  787.  
  788. /*main body of the train(engine)*/
  789. rectangle(100+i,100,400+i,200); //main body
  790. rectangle(105+i,105,300+i,150);//back window
  791. rectangle(305+i,105,385+i,150);//front window
  792. line(185+i,105,185+i,200);//back part of door
  793. line(265+i,105,265+i,200);//front part of door
  794. rectangle(195+i,160,205+i,165);//door handle
  795. rectangle(390+i,175,400+i,185); //front indicator
  796.  
  797. /*main body of the wagon*/
  798. rectangle(1+i,150,90+i,200);
  799. line(1+i,150,90+i,100);
  800. line(90+i,100,90+i,150);
  801. circle(20+i,200,20);//trye of the small wagon back one
  802. circle(20+i,200,15);//rim of the back one
  803.  
  804. circle(70+i,200,20);
  805. circle(70+i,200,15);
  806.  
  807. rectangle(90+i,180,99+i,200);   //the connection between the engine and the wagon
  808.  
  809.  
  810.  
  811. settextjustify(100,240);
  812. settextstyle(TRIPLEX_FONT,HORIZ_DIR,5);
  813. outtextxy(100,240,"Moving train");
  814. settextjustify(130,280);
  815. settextstyle(SANS_SERIF_FONT,HORIZ_DIR,5);
  816. outtextxy(130,280,"by RAM");
  817.  
  818. delay(10);
  819.  
  820.  
  821. } //end of loop
  822. getch();
  823. closegraph();
  824. }//end of function
  825.  
  826.  
  827. THE OUTPUT
  828.  
  829.  
  830. This video is upto only 0:56 not 2:01
  831. an error occured during the process thats why please cooperate
Advertisement
Add Comment
Please, Sign In to add comment