Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "GraphLib.h"
- struct WarmSegment
- {
- int x;
- int y;
- };
- struct MoveDirecton
- {
- int dx;
- int dy;
- };
- // head is at Warm[0]
- struct WarmSegment Warm[100] = { { 40, 10 }, { 41, 10 }, { 42, 10 }, { 43, 10 }, { 44, 10 } };
- int WarmLength = 5;
- // current direction
- struct MoveDirecton WarmDirection = { -1, 0 };
- void DrawScreen()
- {
- int i;
- // clrscr();
- hidecursor();
- for (i = 0; i < WarmLength; i++)
- {
- gotoxy(Warm[i].x, Warm[i].y);
- printf("@");
- }
- }
- void main() {
- while (1)
- {
- DrawScreen();
- }
- pause();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement