Advertisement
rowers

waz

Mar 12th, 2014
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.56 KB | None | 0 0
  1. #include "GraphLib.h"
  2.  
  3. struct WarmSegment
  4. {
  5.     int x;
  6.     int y;
  7. };
  8.  
  9.  
  10. struct MoveDirecton
  11. {
  12.     int dx;
  13.     int dy;
  14. };
  15.  
  16.  
  17. // head is at Warm[0]
  18. struct WarmSegment Warm[100] = { { 40, 10 }, { 41, 10 }, { 42, 10 }, { 43, 10 }, { 44, 10 } };
  19. int WarmLength = 5;
  20.  
  21. // current direction
  22. struct MoveDirecton WarmDirection = { -1, 0 };
  23.  
  24. void DrawScreen()
  25. {
  26.  
  27.     int i;
  28. //  clrscr();
  29.     hidecursor();
  30.  
  31.     for (i = 0; i < WarmLength; i++)
  32.     {
  33.  
  34.         gotoxy(Warm[i].x, Warm[i].y);
  35.         printf("@");
  36.     }
  37. }
  38.  
  39.  
  40.  
  41. void main() {
  42.  
  43.     while (1)
  44.     {
  45.         DrawScreen();
  46.     }
  47.     pause();
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement