Message
Message
Message
#include <conio.h>
#include <windows.h>
#include <algorithm>
using namespace std;
using namespace System;
void menu() {
void color(int x) {
switch (x) {
case 1: Console::ForegroundColor = ConsoleColor::White; break;
case 2: Console::ForegroundColor = ConsoleColor::Red; break;
case 3: Console::ForegroundColor = ConsoleColor::Blue; break;
case 4: Console::ForegroundColor = ConsoleColor::Yellow; break;
case 5: Console::ForegroundColor = ConsoleColor::Magenta; break;
case 6: Console::ForegroundColor = ConsoleColor::Green; break;
}
}
void ciclista_1() {
Console::ForegroundColor = ConsoleColor::Green;
Console::SetCursorPosition(3, 0); cout << char(184);
Console::SetCursorPosition(5, 0); cout << char(184); Console::SetCursorPosition(3,
2); cout << char(200); Console::SetCursorPosition(5, 2); cout << char(188);
Console::SetCursorPosition(4, 1); cout << char(219);
}
void ciclista_2() {
Console::ForegroundColor = ConsoleColor::Blue;
Console::SetCursorPosition(18, 0); cout << char(184);
Console::SetCursorPosition(20, 0); cout << char(184);
Console::SetCursorPosition(18, 2); cout << char(200);
Console::SetCursorPosition(20, 2); cout << char(188);
Console::SetCursorPosition(19, 1); cout << char(219);
}
void ciclista_3() {
Console::ForegroundColor = ConsoleColor::DarkRed;
Console::SetCursorPosition(33, 0); cout << char(184);
Console::SetCursorPosition(35, 0); cout << char(184);
Console::SetCursorPosition(33, 2); cout << char(200);
Console::SetCursorPosition(35, 2); cout << char(188);
Console::SetCursorPosition(34, 1); cout << char(219);
}
void ciclista_4() {
Console::ForegroundColor = ConsoleColor::White;
Console::SetCursorPosition(48, 0); cout << char(184);
Console::SetCursorPosition(50, 0); cout << char(184);
Console::SetCursorPosition(48, 2); cout << char(200);
Console::SetCursorPosition(50, 2); cout << char(188);
Console::SetCursorPosition(49, 1); cout << char(219);
}
void ciclista_5() {
Console::ForegroundColor = ConsoleColor::Magenta;
Console::SetCursorPosition(63, 0); cout << char(184);
Console::SetCursorPosition(65, 0); cout << char(184);
Console::SetCursorPosition(63, 2); cout << char(200);
Console::SetCursorPosition(65, 2); cout << char(188);
Console::SetCursorPosition(64, 1); cout << char(219);
}
void biclicletas() {
int* Y = new int[35];
int* X = new int[30];
for (int i = 0; i < 30; i++) {
Y[i] = 1;
X[i] = 50 + i;
}
for (int c = 1; c < 22; c++) {
for (int i = 0; i < 5; i++) {
color(1 + rand() % 6);
Console::SetCursorPosition(X[i], Y[i]);
//Console::SetCursorPosition(ancho,alto)
cout << "*";
}
_sleep(500);
//Borrando el rastro
for (int i = 0; i < 30; i++) {
Console::SetCursorPosition(X[i], Y[i]);
//Console::SetCursorPosition(ancho,alto)
cout << " ";
}
for (int c = 1; c < 22; c++) {
}
}
system("cls");
}
void Ranking() {
srand(time(0));
string nombres[5] = { "Pegaso", "Andromeda", "Yin", "Locusp", "Thinny" };
cout << "Puesto " << i + 1 << ": " << nombres[i] << " - " << kaleatorio
<< " km/h" << endl;
cout << " __o " << endl;
cout << " `\<, " << endl;
cout << "()/()" << endl;
cout << "__ " << endl;
cout << " " << endl;
}
_getch();
}
int main() {
menu();
biclicletas();
Ranking();
return 0;
}