Practicas con C++

Page 17

Omar Gurrola

01/30/05

http://www.proprojects.wordpress.com

cin >> r; }while(r < 1 || r > 4); return r; } //-------------------------------------------------int CMenu::m_boca(){ do{ system("CLS"); cout << "Boca / Labios:" << endl; cout << "1.- Grande / Grueso" << endl; cout << "2.- Peque単a / Delgada" << endl; cout << "3.- Grande / Normal" << endl; cout << "4.- Grande / Delgada" << endl; cout << "Selecciona el rasgo: "; cin >> r; }while(r < 1 || r > 4); return r; } //-------------------------------------------------void m_robot(CRobot ROB){ cout << '\n' << '\n'; ROB.cabello(ROB.rasgos[0]); ROB.ojos(ROB.rasgos[1]); ROB.orejas_nariz(ROB.rasgos[2]); ROB.boca_labios(ROB.rasgos[3]); } /*-------------------------------------------------Funciones Friend --------------------------------------------------*/ void b_rasgos(CRobot &ROB){ for(int x = 0; x < 4; x++) ROB.rasgos[x] = 1; } //-------------------------------------------------void g_rasgos(CRobot &ROB, int r, int v){ ROB.rasgos[r] = v; } /*-------------------------------------------------Programa Principal --------------------------------------------------*/ void main() { CMenu menu; CRobot robot; int IOtravez = 1; do{ system("CLS"); m_robot(robot); switch(menu.m_main()){ case 1: g_rasgos(robot,0,menu.m_cabello()); break; case 2: g_rasgos(robot,1,menu.m_ojos()); break; case 3: g_rasgos(robot,2,menu.m_orejas()); break; case 4: g_rasgos(robot,3,menu.m_boca()); break; case 5: b_rasgos(robot); break; default : IOtravez = 0; }


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.