Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // eedede.cpp : main project file.
- #include "stdafx.h"
- #include <conio.h>
- using namespace System;
- void vacioFuncion1(){
- /*
- void dibuja(){
- int i;
- for(i=0;i<3;i++){
- Console::Write("***");
- Console::SetCursorPosition(Console::CursorLeft-3,Console::CursorTop+1);}
- }
- int main(array<System::String ^> ^args)
- {
- Console::Title=("Dibuja Cuadrado");
- dibuja();
- _getch();
- }
- */}
- void vacioFuncion2(){
- /*
- void dibuja(int px, int py,int ancho,int alto, String^c){
- Console::SetCursorPosition(px,py);
- int i,j;
- for(i=0;i<alto;i++){
- for(j=0;j<ancho;j++)Console::Write(c);
- Console::SetCursorPosition(Console::CursorLeft-ancho,Console::CursorTop+1);
- }
- }
- int main(array<System::String ^> ^args)
- {
- String^c;
- c="o";
- Console::BackgroundColor=ConsoleColor::Blue;
- Console::Clear();
- Console::Title="Cuadrado";
- Console::BackgroundColor=ConsoleColor::Red;
- Console::ForegroundColor=ConsoleColor::Black;
- dibuja(10,20,5,3,c);
- _getch();
- return 0;
- }*/}
- void dibuja(int px, int py,int ancho,int alto, String^c){
- Console::SetCursorPosition(px,py);
- int i,j;
- for(i=0;i<alto;i++){
- for(j=0;j<ancho;j++)Console::Write(c);
- Console::SetCursorPosition(Console::CursorLeft-ancho,Console::CursorTop+1);
- }
- }
- void presion(){
- int x;
- x=1;
- while(1){
- ConsoleKeyInfo a = Console::ReadKey(true);
- Console::Clear();
- Console::SetCurrentPosition(50,0);
- switch(a.Key){
- case ConsoleKey::UpArrow:Console::Write("Arriba ");break;
- case ConsoleKey::DownArrow:Console::Write("Abajo ");break;
- case ConsoleKey::LeftArrow:Console::Write("Izquierda ");break;
- case ConsoleKey::RightArrow:Console::Write("Derecha ");break;}
- }
- }
- void control(){
- while(1){
- ConsoleKeyInfo b = Console::ReadKey(true);
- switch(b.Key){
- case ConsoleKey::DownArrow:Console::SetCursorPosition(Console::CursorLeft,Console::CursorTop+1);break;
- case ConsoleKey::UpArrow:Console::SetCursorPosition(Console::CursorLeft,Console::CursorTop-1);break;
- case ConsoleKey::LeftArrow:Console::SetCursorPosition(Console::CursorLeft-1,Console::CursorTop);break;
- case ConsoleKey::RightArrow:Console::SetCursorPosition(Console::CursorLeft+1,Console::CursorTop);break;
- }
- }
- }
- int main(array<System::String ^> ^args)
- {
- //String^c;
- //c="o";
- //Console::BackgroundColor=ConsoleColor::Blue;
- //Console::Clear();
- //Console::BackgroundColor=ConsoleColor::Red;
- //Console::ForegroundColor=ConsoleColor::Black;
- //dibuja(10,20,5,3,c);
- Console::Title="Cuadrado";
- presion();
- control();
- _getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement