Advertisement
NoExisteLink

asdasdsad

May 23rd, 2014
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1. // eedede.cpp : main project file.
  2.  
  3. #include "stdafx.h"
  4. #include <conio.h>
  5.  
  6. using namespace System;
  7. void vacioFuncion1(){
  8. /*
  9. void dibuja(){
  10. int i;
  11. for(i=0;i<3;i++){
  12. Console::Write("***");
  13. Console::SetCursorPosition(Console::CursorLeft-3,Console::CursorTop+1);}
  14. }
  15.  
  16. int main(array<System::String ^> ^args)
  17. {
  18. Console::Title=("Dibuja Cuadrado");
  19. dibuja();
  20. _getch();
  21.  
  22. }
  23. */}
  24. void vacioFuncion2(){
  25. /*
  26. void dibuja(int px, int py,int ancho,int alto, String^c){
  27. Console::SetCursorPosition(px,py);
  28. int i,j;
  29. for(i=0;i<alto;i++){
  30. for(j=0;j<ancho;j++)Console::Write(c);
  31. Console::SetCursorPosition(Console::CursorLeft-ancho,Console::CursorTop+1);
  32. }
  33. }
  34. int main(array<System::String ^> ^args)
  35. {
  36. String^c;
  37. c="o";
  38. Console::BackgroundColor=ConsoleColor::Blue;
  39. Console::Clear();
  40. Console::Title="Cuadrado";
  41. Console::BackgroundColor=ConsoleColor::Red;
  42. Console::ForegroundColor=ConsoleColor::Black;
  43. dibuja(10,20,5,3,c);
  44. _getch();
  45. return 0;
  46. }*/}
  47. void dibuja(int px, int py,int ancho,int alto, String^c){
  48. Console::SetCursorPosition(px,py);
  49. int i,j;
  50. for(i=0;i<alto;i++){
  51. for(j=0;j<ancho;j++)Console::Write(c);
  52. Console::SetCursorPosition(Console::CursorLeft-ancho,Console::CursorTop+1);
  53. }
  54. }
  55. void presion(){
  56. int x;
  57. x=1;
  58. while(1){
  59. ConsoleKeyInfo a = Console::ReadKey(true);
  60. Console::Clear();
  61. Console::SetCurrentPosition(50,0);
  62. switch(a.Key){
  63. case ConsoleKey::UpArrow:Console::Write("Arriba ");break;
  64. case ConsoleKey::DownArrow:Console::Write("Abajo ");break;
  65. case ConsoleKey::LeftArrow:Console::Write("Izquierda ");break;
  66. case ConsoleKey::RightArrow:Console::Write("Derecha ");break;}
  67. }
  68. }
  69. void control(){
  70. while(1){
  71. ConsoleKeyInfo b = Console::ReadKey(true);
  72. switch(b.Key){
  73. case ConsoleKey::DownArrow:Console::SetCursorPosition(Console::CursorLeft,Console::CursorTop+1);break;
  74. case ConsoleKey::UpArrow:Console::SetCursorPosition(Console::CursorLeft,Console::CursorTop-1);break;
  75. case ConsoleKey::LeftArrow:Console::SetCursorPosition(Console::CursorLeft-1,Console::CursorTop);break;
  76. case ConsoleKey::RightArrow:Console::SetCursorPosition(Console::CursorLeft+1,Console::CursorTop);break;
  77. }
  78. }
  79. }
  80. int main(array<System::String ^> ^args)
  81. {
  82. //String^c;
  83. //c="o";
  84. //Console::BackgroundColor=ConsoleColor::Blue;
  85. //Console::Clear();
  86. //Console::BackgroundColor=ConsoleColor::Red;
  87. //Console::ForegroundColor=ConsoleColor::Black;
  88. //dibuja(10,20,5,3,c);
  89. Console::Title="Cuadrado";
  90. presion();
  91. control();
  92. _getch();
  93. return 0;
  94. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement