Dev - C++ - Salva_pantallas

 
Vista:
sin imagen de perfil

Salva_pantallas

Publicado por Marlon (2 intervenciones) el 04/10/2013 03:54:47
NECESITO QUE MI CODIGO SE EJECUTE DESDE EL MENU QUE ES,
1= SETEO (osea que el usuario elige el caracter)
2= EJECUTAR (que se muestre cualquier caracter aletoriamente)
3= SALIR (Que acabe el ciclo)

Ayuda.. a crear ese menu.... que supuestamente debo de hacer con un swicht.


#include <iostream.h>
#include <stdio.h>
#include <windows.h>
#include <conio.h>
#include <stdlib.h>
#if defined(_WIN32) || defined(WIN32) // Windows-way ~
#include <Windows.h>
#define gotoxy(x,y) {COORD a;a.X = x; a.Y = y;SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),a);}
#else // Linux-Way =)
#endif

int main(int argc, char* argv[])
{

cout<<"ÍÍÍÍÍÍÍ MENU SALVA PANTALLAS ÍÍÍÍÍÍÍÍÍÍÍÍ\n\n\n\n\ 1= Seteo \n 2= Ejecutar\n 3= Salir\n\n\n\n\ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ\n"<<endl;
system("color 74");
int tiempo;
char caracter_;


cout<<"INGRESE EL TIEMPO (SEGUNDOS)."<<endl;
cin>>tiempo;
cout<<"INGRESE UN CARACTER"<<endl;
cin>>caracter_;
system("color 2f");


while ( true )
{
system("cls");

for(int j=0; j<1; j++)
{
Sleep(500*tiempo);

}
int coordenada_1 = rand() % (79+1);
int coordenada_2 = rand() % (23+1);

gotoxy(coordenada_1,coordenada_2);
cout<<caracter_<<endl;
Sleep(500*tiempo);


}

system("pause");
{
system("cls");
}

}
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder