Last active
November 27, 2017 02:32
-
-
Save borregs/03782a7157fec826f520fee7626b3166 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<string.h> | |
#include<ncurses.h> | |
#include<stdlib.h> | |
int main(){ | |
int x,y,o; | |
int score=0; | |
//int cuerpo[200][2]; | |
char tecla; | |
initscr(); | |
// Siempre que uses ventanas interactivas: | |
box(stdscr,0,0); | |
keypad(stdscr,TRUE); | |
refresh(); | |
//SIEMPRE IGUALITO; AQUI!! | |
//MAS DESMADRE VVV | |
/* | |
; | |
//lineas verticales | |
for(x=2; x<38; x++) | |
{ | |
mvprintw(x,3,"%d",o); | |
mvprintw(x,73,"%d",o); | |
} | |
//lineas horizontales | |
for(x=4; x<74; x++) | |
{ | |
mvprintw(2,x,"%d",o); | |
mvprintw(37,x,"%d",o); | |
} | |
*/ | |
//loq querias hacer aqui era una ventana de 37 * 73 entonces: | |
WINDOW *cualquiercosa; // puntero a ventana para reservar N bytes q van a ser una ventanilla x | |
cualquiercosa=newwin(37,73,2,2); // una ventana nueva en la direccion de cualquiercosa q valga 37*73 y q empieze en el reglon 2 y la fila 2 | |
box(cualquiercosa,0,0); | |
mvwprintw(cualquiercosa,1,3,"SCORE: %d",score); | |
mvwprintw(cualquiercosa,1,25,"\tWELCOME TO THE GAME"); | |
mvwprintw(cualquiercosa,30,3,"\tPRESS CTRL+Z TO EXIT GAME"); // igual q antes soloqla funcion es wprintw() o mvwprintw() y el primer argumento q recibe es el nombre de la ventana | |
wrefresh(cualquiercosa);// reimpre todo en ventana: cualquiercosa | |
getch();//awantame las carnitas... | |
//while(tecla!='z'){ | |
//printf() | |
getch(); | |
refresh(); | |
endwin(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment