Skip to main content

Posts

Showing posts from February, 2021

Snake Game Proggramming code in C

Programming Languages Welcome to coding world Snake Game code in C #include <graphics.h> #include <stdio.h> #include <stdlib.h> #define T 2000 int n=0,px,py; main() {   int gd=DETECT,gm,i,j;   clrscr();   gotoxy(25,4);   printf("DON'T TUCH THE BORDER");   gotoxy(25,6);   printf("Press < p > for pause");   gotoxy(17,8);   printf("IN MIDDLE OF GAME, PRESS < Esc > TO EXIT");   x:   gotoxy(26,10);   printf("press < s > to start ");   gotoxy(26,12);   printf(" Use SMALL case only");   gotoxy(34,10);   if(getch()=='s')   initgraph(&gd,&gm,"c:\tc\bgi");   else {   clrscr();   goto x;   }   line(0,0,0,479);   line(0,0,639,0);   line(639,0,639,479);   line(0,479,639,479);   pause();   print();   right(100,100); }   right(int x,int y)   { ...