Advertisement
BladeMechanics

Racetrack

Sep 10th, 2017
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.90 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<conio.h>
  3. #include<stdlib.h>
  4. #include<Windows.h>
  5.  
  6. void main()
  7. {
  8.     int width,row,positionT=35,positionH=36;
  9.     for (row = 2; row; row--)
  10.     {
  11.  
  12.             for (width = 71; width; width--) printf("-");
  13.             printf("\n");
  14.             for (width = 71; width; width--)
  15.                 if ((width % 2) == 0)
  16.                     if (((positionT > 35 && row == 2) && (width / 2 == positionT - 35))|| ((positionT <= 35 && row == 1) && (width / 2 == positionT))) printf("T");
  17.                 else printf(" ");
  18.             else printf("|");
  19.             printf("\n");
  20.         for (width = 71; width; width--)
  21.             if ((width % 2) == 0)
  22.                 if (((positionH > 35 && row == 2) && (width / 2 == positionH - 35)) || ((positionH <= 35 && row == 1) && (width / 2 == positionH))) printf("H");
  23.                 else printf(" ");
  24.             else printf("|");
  25.             printf("\n");
  26.                 for (width = 71; width; width--) printf("-");
  27.                 printf("\n");
  28.  
  29.         printf("\n");
  30.  
  31.     }
  32.         _getch();
  33. }//end program
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement