Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. #include "Menu.hpp"
  2. #include <windows.h>
  3. #include <string>
  4. #include <iostream>
  5. #include <conio.h>
  6.  
  7. using namespace std;
  8.  
  9. void gotoxy( const int x, const int y )
  10. {
  11. COORD coord = { x, y };
  12. SetConsoleCursorPosition( GetStdHandle( STD_OUTPUT_HANDLE ), coord );
  13. }
  14.  
  15. int OpcjaA()
  16. {
  17. return 0;
  18. }
  19.  
  20. int OpcjaB()
  21. {
  22. return 0;
  23. }
  24.  
  25. int main()
  26. {
  27. int wybor;
  28. int poprzedniWybor;
  29. bool wykonujPetle;
  30.  
  31. while( 1 )
  32. {
  33. wybor = 0;
  34. poprzedniWybor = wybor;
  35. wykonujPetle = true;
  36.  
  37. system( "cls" );
  38. gotoxy( 3, 1 );
  39. cout << "Rozpocznij Gre";
  40. gotoxy( 3, 3 );
  41. cout << "Wczytaj Gre";
  42. gotoxy( 3, 5 );
  43. cout << "Wyjscie";
  44.  
  45. while( wykonujPetle )
  46. {
  47. gotoxy( 1, wybor * 2 + 1 );
  48. cout << static_cast < char >( 16 );
  49.  
  50. poprzedniWybor = wybor;
  51. switch( getch() )
  52. {
  53. case 224:
  54. switch( getch() )
  55. {
  56. case 72:
  57. if( 0 < wybor ) wybor--;
  58. else wybor = 2;
  59.  
  60. break;
  61.  
  62. case 80:
  63. if( wybor < 2 ) wybor++;
  64. else wybor = 0;
  65.  
  66. break;
  67.  
  68. case 77:
  69. switch( wybor )
  70. {
  71. case 0:
  72. OpcjaA();
  73. break;
  74.  
  75. case 1:
  76. OpcjaB();
  77. break;
  78.  
  79. case 2:
  80. return 0;
  81. }
  82. }
  83. break;
  84. }
  85.  
  86. gotoxy( 1, poprzedniWybor * 2 + 1 );
  87. cout << " ";
  88. }
  89. }
  90. return 0;
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement