Snake Mejorado

  • June 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Snake Mejorado as PDF for free.

More details

  • Words: 109
  • Pages: 2
#include #include #include #include

"conio.h" "stdio.h" "condefs.h" "windows.h"

void main() {char tecla; int col=1,fil=1,condicion,pre; pre=16; while(1) { clrscr(); char imprime=pre; gotoxy(col,fil);printf("%c",imprime); if(kbhit()) { flushall(); tecla=getch(); if(tecla==0) { if(kbhit()) { tecla=getch(); switch(tecla) { case 72: if(condicion==4) break; else condicion=1; break; case 75: if(condicion==3) break; else condicion=2; break; case 77: if(condicion==2) break; else condicion=3; break; case 80: if(condicion==1) break; else condicion=4; break; } } } if(tecla=='1') //con el ingreso de 1 el p�rograma se cierra exit(0); } switch(condicion) { case 1: fil--; pre=30; break;

case 2: col--; pre=17; break; case 3: col++; pre=16; break; case 4: fil++; pre=31; break; } if(col==0) col=80; if(col==81) col=1; if(fil==0) fil=25; if(fil==26) fil=1; Sleep(50); } }

Related Documents

Snake Mejorado
June 2020 13
Snake
October 2019 34
Snake
October 2019 27
Snake
June 2020 13
Mejorado Oferta.docx
November 2019 10
Ci Mejorado
November 2019 17