0% found this document useful (0 votes)
23 views4 pages

Message

This C++ program simulates a bicycle race descent game. It includes functions to display a menu, color text, draw 5 cyclists, animate the cyclists moving down the screen in a race, and display a randomized ranking at the end. The main function calls the menu, bicycle race simulation, and ranking display functions to run the full program.

Uploaded by

Jesus Cotrina
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views4 pages

Message

This C++ program simulates a bicycle race descent game. It includes functions to display a menu, color text, draw 5 cyclists, animate the cyclists moving down the screen in a race, and display a randomized ranking at the end. The main function calls the menu, bicycle race simulation, and ranking display functions to run the full program.

Uploaded by

Jesus Cotrina
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

#include <iostream>

#include <conio.h>
#include <windows.h>
#include <algorithm>
using namespace std;
using namespace System;

void menu() {

cout << " :: SIMULADOR DE DESCENSO DE BICLICLETAS ::


\n";
cout << "
\n";
cout << " .
\n";
cout << " ...
\n";
cout << " ... .,*/(/
\n";
cout << " .,,**, .*(#(,
\n";
cout << " .*///////(((/,.,*/////*,. .,,,,,,,.,,.
\n";
cout << "
.,**///////////////////((//*******////(/***//(((((((///,. \n";
cout << " .,*////////////(#%&&&&&&&&&&&&&%%#(/////////////*,.
\n";
cout << " .,*//////(#&&&&&&&&&&&&%#(//////////***,,..
\n";
cout << " .,,******,..,**//////((#%%&%%((///////*,.
\n";
cout << " .*#%%#(////*,.....*//////////////////*****/%%&&&&&%%#/,
\n";
cout << " *#&&&%#(///*,...,*/*,.*//////////////*, ,****(#(///((#(/*,.
\n";
cout << " .(%&%(*,. ....,/#%%#,..*////////////*. /%&#/***,......
..,/*. \n";
cout << " ./%&%/, .... .,/%&%( .*////((((((//*,*(((/*,... ..**///#
%&(, \n";
cout << " ,(%&#*. .. .*#&&#..*////(((((((/*******,,,**///,. .,(%&#,
\n";
cout << " ./%&%/, ,/%&%( .,,,,,,***,,,. *%&%(*... ,/#&&(.
\n";
cout << " ./%&%#/,. .,*#%&%(. *%&%#/,. .,*(%&&(,
\n";
cout << " ,(&&&%##(((##%&&&#, ./%&&%%#((((#%&&&#*.
\n";
cout << " ,(%%&&&&&%%(, ,/#%&&&&&%%(*.
\n";
cout << "
\n\n";
cout << " -------------------------------------------------
\n";
cout << " PRESIONE UNA TECLA PARA COMENZAR EL JUEGO
\n";
system("pause>0");
system("cls");
}

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++) {

for (int i = 0; i < 5; i++) {


color(1);
Console::SetCursorPosition(43, 19);
//Console::SetCursorPosition(ancho,alto)
cout << char(177) << char(177) << char(177) <<
char(177) << char(177) << char(177) << char(177) << char(177) << char(177) <<
char(177) << char(177) << char(177) << char(177) << char(177) << char(177) <<
char(177) << char(177) << char(177) << char(177) << char(177);
}
}

for (int i = 0; i < 30; i++) {

if (Y[i] >= 19)


Y[i] = 19;
else
Y[i] += rand() % 4;

}
}
system("cls");
}

void Ranking() {
srand(time(0));
string nombres[5] = { "Pegaso", "Andromeda", "Yin", "Locusp", "Thinny" };

random_shuffle(nombres, nombres + 5);

cout << "Ranking" << endl;


cout <<
"=====================================================================" << endl;
for (int i = 0; i < 5; i++) {

int kaleatorio = rand() % 10 + 1;

int irand = rand() % 5;


string naleatorio = nombres[irand];

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;
}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy