Nie działający program
Ostatnio zmodyfikowano 2013-03-18 20:56
StuFfii Temat założony przez niniejszego użytkownika |
Nie działający program » 2013-03-16 21:39:25 Ten kod podaje żeby się pochwalić co napisałem. Problem dotyczący błędu jest poniżej.
#include <iostream> #include <string> #include <cstdlib> #include <windows.h> #include <ctime> int main() { std::cout << " Witaj w grze RPG o nazwie: " << std::endl; std::cout << " ZUPA ROMANA!!!" << std::endl << std::endl; std::cout << " Podaj imie swojej postaci: "; std::cout << "" << std::endl << std::endl; std::string imie; std::cin >> imie; std::cout << "Witaj w ZUPIE ROMANA " << imie << std::endl; std::cout << "" << std::endl; _sleep( 1000 ); std::cout << "|=====twoje aktualne statystyki=====|" << std::endl; _sleep( 1000 ); std::cout << "| wspolczynnik pnacerza: 0 |" << std::endl; _sleep( 1000 ); std::cout << "| szansa na combo: 3% |" << std::endl; _sleep( 1000 ); std::cout << "| szansa na unik: 10% |" << std::endl; _sleep( 1000 ); std::cout << "| sila ataku: 1-11 |" << std::endl; _sleep( 1000 ); std::cout << "|===================================|" << std::endl; std::cout << "Wybierz miecz(+2hp do obrazen) kilkajac 1" << std::endl << std::endl; std::cout << "lub tarcze(blokuje od 1 do 3hp obrazen) klikajac 2" << std::endl; int orez; std::cin >> orez; switch( orez ) { case 1: { std::cout << "Wybrales miecz. Za 5 sek rozpocznie sie walka z :agresor" << std::endl; _sleep( 1000 ); std::cout << "|=====twoje aktualne statystyki=====|" << std::endl; _sleep( 1000 ); std::cout << "| wspolczynnik pnacerza: 1-3 |" << std::endl; _sleep( 1000 ); std::cout << "| szansa na combo: 3% |" << std::endl; _sleep( 1000 ); std::cout << "| szansa na unik: 10% |" << std::endl; _sleep( 1000 ); std::cout << "| sila ataku: 1-11 |" << std::endl; _sleep( 1000 ); std::cout << "|===================================|" << std::endl << std::endl; std::cout << "Wybrales tarcze. Twoj przeciwnik-agresor" << std::endl << std::endl; _sleep( 1000 ); std::cout << "|=====statystyki agresora=====|" << std::endl; _sleep( 1000 ); std::cout << "| wspolczynnik pnacerza: 0 |" << std::endl; _sleep( 1000 ); std::cout << "| szansa na combo: 0% |" << std::endl; _sleep( 1000 ); std::cout << "| szansa na unik: 5% |" << std::endl; _sleep( 1000 ); std::cout << "| sila ataku: 3-13 |" << std::endl; _sleep( 1000 ); std::cout << "|=============================|" << std::endl; _sleep( 1000 ); std::cout << "Za chwile zacznie sie walka. Prosze czekac." << std::endl; std::cout << " Przepraszamy za wszystkie niedogodnosci" << std::endl; _sleep( 10000 ); std::cout << "" << std::endl; std::cout << "Za 5 sek rozpocznie sie walka z :agresor" << std::endl; _sleep( 1000 ); std::cout << "za 4 sek." << std::endl; _sleep( 1000 ); std::cout << "za 3 sek." << std::endl; _sleep( 1000 ); std::cout << "za 2 sek." << std::endl; _sleep( 1000 ); std::cout << "za 1 sek." << std::endl; _sleep( 1000 ); std::cout << "---!Fight!---" << std::endl << std::endl; std::cout << "Stan poczatkowy twojego zycia: 45" << std::endl; std::cout << "Stan poczatkowy zycia agresora: 40" << std::endl; srand( time( NULL ) ); std::cout << "" << std::endl; std::cout << "--------------------------------------------------------------" << std::endl; std::cout << "" << std::endl; _sleep( 3000 ); std::cout << imie << " zaatakowal agresora" << std::endl; _sleep( 2000 ); int bonusm =( rand() % 100 ); if( bonusm >= 6 ) { int zycieagresoram =(( rand() % 10 ) + 3 ); std::cout << "obrazenia:" << zycieagresoram << std::endl; int zycieagresoramm = 40 - zycieagresoram; std::cout << "stan zycia agresora= " << zycieagresoramm << std::endl; } else; if( bonusm == 1, 2, 3, 4, 5 ) { int zycieagresoram = 0; std::cout << "wykonano unik!" << std::endl; int zycieagresorajm = 40; std::cout << "stan zycia agresora= " << zycieagresorajm << std::endl; } else; std::cout << "" << std::endl; std::cout << "--------------------------------------------------------------" << std::endl; std::cout << "" << std::endl; _sleep( 3000 ); std::cout << "agresor zaatakowal " << imie << std::endl; _sleep( 2000 ); int twojezyciem =(( rand() % 10 ) + 1 ); std::cout << "obrazenia:" << twojezyciem << std::endl; std::cout << "stan zycia " << imie << "=" << 45 - twojezyciem << std::endl; std::cout << "" << std::endl; std::cout << "--------------------------------------------------------------" << std::endl; std::cout << "" << std::endl; _sleep( 3000 ); std::cout << imie << " zaatakowal agresora" << std::endl; _sleep( 2000 ); int zycieagresoraam =(( rand() % 10 ) + 3 ); std::cout << "obrazenia:" << zycieagresoraam << std::endl; int zycieagresora2m = zycieagresoramm - zycieagresoraam; std::cout << "stan zycia agresora= " << zycieagresora2m << std::endl; std::cout << "" << std::endl; std::cout << "--------------------------------------------------------------" << std::endl; std::cout << "" << std::endl; _sleep( 3000 ); std::cout << "agresor zaatakowal " << imie << std::endl; _sleep( 2000 ); int twojezycieam =(( rand() % 10 ) + 1 ); std::cout << "obrazenia:" << twojezycieam << std::endl; int twojezycie2m = twojezyciem - twojezycieam; std::cout << "stan zycia " << imie << "=" << twojezycie2m << std::endl; std::cout << "" << std::endl; std::cout << "--------------------------------------------------------------" << std::endl; std::cout << "" << std::endl; _sleep( 3000 ); std::cout << imie << " zaatakowal agresora" << std::endl; _sleep( 2000 ); int zycieagresorabm =(( rand() % 10 ) + 1 ); std::cout << "obrazenia:" << zycieagresorabm << std::endl; int zycieagresora3m = zycieagresora2m - zycieagresorabm; std::cout << "stan zycia agresora= " << zycieagresora3m << std::endl; std::cout << "" << std::endl; std::cout << "--------------------------------------------------------------" << std::endl; std::cout << "" << std::endl; _sleep( 3000 ); std::cout << "agresor zaatakowal " << imie << std::endl; _sleep( 2000 ); int twojezyciebm =(( rand() % 10 ) + 1 ); std::cout << "obrazenia:" << twojezyciebm << std::endl; int twojezycie3m = twojezycie2m - twojezyciebm; std::cout << "stan zycia " << imie << "=" << twojezycie3m << std::endl; std::cout << "" << std::endl; std::cout << "--------------------------------------------------------------" << std::endl; std::cout << "" << std::endl; _sleep( 3000 ); std::cout << imie << " zaatakowal agresora" << std::endl; _sleep( 2000 ); int zycieagresoracm =(( rand() % 10 ) + 1 ); std::cout << "obrazenia:" << zycieagresoracm << std::endl; int zycieagresora5m = zycieagresora3m - zycieagresoracm; std::cout << "stan zycia agresora= " << zycieagresora5m << std::endl; if( zycieagresora5m <= 0 ) { std::cout << "Agresor zginol-wygrywasz" << std::endl; std::cout << "=========================================" << std::endl; std::cout << "===================WIN===================" << std::endl; std::cout << "=========================================" << std::endl; } else; std::cout << "" << std::endl; std::cout << "--------------------------------------------------------------" << std::endl; std::cout << "" << std::endl; _sleep( 3000 ); std::cout << "agresor zaatakowal " << imie << std::endl; _sleep( 2000 ); int twojezyciecm =(( rand() % 10 ) + 1 ); std::cout << "obrazenia:" << twojezyciecm << std::endl; int twojezycie4m = twojezycie3m - twojezyciecm; std::cout << "stan zycia " << imie << "=" << twojezycie4m << std::endl; if( twojezycie4m <= 0 ) { std::cout << "Przegrales" << std::endl; std::cout << " !!!KONIEC GRY!!!" << std::endl; } else; std::cout << "" << std::endl; std::cout << "--------------------------------------------------------------" << std::endl; std::cout << "" << std::endl; _sleep( 3000 ); std::cout << imie << " zaatakowal agresora" << std::endl; _sleep( 2000 ); int zycieagresoradm =(( rand() % 10 ) + 1 ); std::cout << "obrazenia:" << zycieagresoradm << std::endl; int zycieagresora6m = zycieagresora5m - zycieagresoradm; std::cout << "stan zycia agresora= " << zycieagresora6m << std::endl; if( zycieagresora6m <= 0 ) { std::cout << "Agresor zginol-wygrywasz" << std::endl; std::cout << "=========================================" << std::endl; std::cout << "===================WIN===================" << std::endl; std::cout << "=========================================" << std::endl; } else; std::cout << "" << std::endl; std::cout << "--------------------------------------------------------------" << std::endl; std::cout << "" << std::endl; _sleep( 3000 ); std::cout << "agresor zaatakowal " << imie << std::endl; _sleep( 2000 ); int twojezyciedm =(( rand() % 10 ) + 1 ); std::cout << "obrazenia:" << twojezyciedm << std::endl; int twojezycie5m = twojezycie4m - twojezyciedm; std::cout << "stan zycia " << imie << "=" << twojezycie5m << std::endl; if( twojezycie5m <= 0 ) { std::cout << "Przegrales" << std::endl; std::cout << " !!!KONIEC GRY!!!" << std::endl; } else; std::cout << "" << std::endl; std::cout << "--------------------------------------------------------------" << std::endl; std::cout << "" << std::endl; _sleep( 3000 ); std::cout << imie << " zaatakowal agresora" << std::endl; _sleep( 2000 ); int zycieagresoraem =(( rand() % 10 ) + 1 ); std::cout << "obrazenia:" << zycieagresoraem << std::endl; int zycieagresora7m = zycieagresora6m - zycieagresoraem; std::cout << "stan zycia agresora= " << zycieagresora7m << std::endl; if( zycieagresora7m <= 0 ) { std::cout << "Agresor zginol-wygrywasz" << std::endl; std::cout << "=========================================" << std::endl; std::cout << "===================WIN===================" << std::endl; std::cout << "=========================================" << std::endl; } else; std::cout << "" << std::endl; std::cout << "--------------------------------------------------------------" << std::endl; std::cout << "" << std::endl; _sleep( 3000 ); std::cout << "agresor zaatakowal " << imie << std::endl; _sleep( 2000 ); int twojezycieem =(( rand() % 10 ) + 1 ); std::cout << "obrazenia:" << twojezycieem << std::endl; int twojezycie6m = twojezycie5m - twojezycieem; std::cout << "stan zycia " << imie << "=" << twojezycie6m << std::endl; if( twojezycie6m <= 0 ) { std::cout << "Przegrales" << std::endl; std::cout << " !!!KONIEC GRY!!!" << std::endl; } std::cout << "" << std::endl; std::cout << "--------------------------------------------------------------" << std::endl; std::cout << "" << std::endl; _sleep( 3000 ); std::cout << imie << " zaatakowal agresora" << std::endl; _sleep( 2000 ); int zycieagresorafm =(( rand() % 10 ) + 1 ); std::cout << "obrazenia:" << zycieagresorafm << std::endl; int zycieagresora8m = zycieagresora7m - zycieagresorafm; std::cout << "stan zycia agresora= " << zycieagresora8m << std::endl; if( zycieagresora8m <= 0 ) { std::cout << "Agresor zginol-wygrywasz" << std::endl; std::cout << "=========================================" << std::endl; std::cout << "===================WIN===================" << std::endl; std::cout << "=========================================" << std::endl; } else; std::cout << "" << std::endl; std::cout << "--------------------------------------------------------------" << std::endl; std::cout << "" << std::endl; _sleep( 3000 ); std::cout << "agresor zaatakowal " << imie << std::endl; _sleep( 2000 ); int twojezyciefm =(( rand() % 10 ) + 1 ); std::cout << "obrazenia:" << twojezyciefm << std::endl; int twojezycie7m = twojezycie6m - twojezyciefm; std::cout << "stan zycia " << imie << "=" << twojezycie7m << std::endl; if( twojezycie7m <= 0 ) { std::cout << "Przegrales" << std::endl; std::cout << " !!!KONIEC GRY!!!" << std::endl; } } break; case 2: { _sleep( 1000 ); std::cout << "|=====twoje aktualne statystyki=====|" << std::endl; _sleep( 1000 ); std::cout << "| wspolczynnik pnacerza: 1-3 |" << std::endl; _sleep( 1000 ); std::cout << "| szansa na combo: 3% |" << std::endl; _sleep( 1000 ); std::cout << "| szansa na unik: 10% |" << std::endl; _sleep( 1000 ); std::cout << "| sila ataku: 1-11 |" << std::endl; _sleep( 1000 ); std::cout << "|===================================|" << std::endl << std::endl; std::cout << "Wybrales tarcze. Twoj przeciwnik-agresor" << std::endl << std::endl; _sleep( 1000 ); std::cout << "|=====statystyki agresora=====|" << std::endl; _sleep( 1000 ); std::cout << "| wspolczynnik pnacerza: 0 |" << std::endl; _sleep( 1000 ); std::cout << "| szansa na combo: 0% |" << std::endl; _sleep( 1000 ); std::cout << "| szansa na unik: 5% |" << std::endl; _sleep( 1000 ); std::cout << "| sila ataku: 1-11 |" << std::endl; _sleep( 1000 ); std::cout << "|=============================|" << std::endl; _sleep( 1000 ); std::cout << "Za chwile zacznie sie walka. Prosze czekac." << std::endl; std::cout << " Przepraszamy za wszystkie niedogodnosci" << std::endl; _sleep( 10000 ); std::cout << "" << std::endl; std::cout << "Za 5 sek rozpocznie sie walka z :agresor" << std::endl; _sleep( 1000 ); std::cout << "za 4 sek." << std::endl; _sleep( 1000 ); std::cout << "za 3 sek." << std::endl; _sleep( 1000 ); std::cout << "za 2 sek." << std::endl; _sleep( 1000 ); std::cout << "za 1 sek." << std::endl; _sleep( 1000 ); std::cout << "---!Fight!---" << std::endl << std::endl; std::cout << "Stan poczatkowy twojego zycia: 45" << std::endl; std::cout << "Stan poczatkowy zycia agresora: 40" << std::endl; std::cout << "" << std::endl; std::cout << "--------------------------------------------------------------" << std::endl; std::cout << "" << std::endl; _sleep( 3000 ); std::cout << imie << " zaatakowal agresora" << std::endl; _sleep( 2000 ); int bonus =(( rand() % 100 ) + 0 ); if( bonus >= 6 ) { int zycieagresora =(( rand() % 10 ) + 1 ); std::cout << "obrazenia:" << zycieagresora << std::endl; int zycieagresora2 = 40 - zycieagresora; std::cout << "stan zycia agresora= " << zycieagresora2 << std::endl; } if( bonus == 1 && bonus == 2 && bonus == 3 && bonus == 4 && bonus == 5 ) { int zycieagresora = 40 - 40; std::cout << "wykonano unik!" << std::endl; int zycieagresora2 = 40; std::cout << "stan zycia agresora= " << zycieagresora2 << std::endl; } std::cout << "" << std::endl; std::cout << "--------------------------------------------------------------" << std::endl; std::cout << "" << std::endl; _sleep( 3000 ); std::cout << "agresor zaatakowal " << imie << std::endl; _sleep( 2000 ); int twojezycie =(( rand() % 10 ) + 1 ); int obrona =(( rand() % 3 ) + 1 ); std::cout << "obrazenia:" << twojezycie + obrona << std::endl; std::cout << "zablokowano " << obrona << " punktow obrazen" << std::endl; int twojezycie2 = 45 - twojezycie + obrona; std::cout << "stan zycia " << imie << "=" << 45 - twojezycie << std::endl; std::cout << "" << std::endl; std::cout << "--------------------------------------------------------------" << std::endl; std::cout << "" << std::endl; _sleep( 3000 ); std::cout << imie << " zaatakowal agresora" << std::endl; _sleep( 2000 ); int zycieagresoraa =(( rand() % 10 ) + 1 ); std::cout << "obrazenia:" << zycieagresoraa << std::endl; int zycieagresora3 = zycieagresora2 - zycieagresoraa; std::cout << "stan zycia agresora= " << zycieagresora3 << std::endl; std::cout << "" << std::endl; std::cout << "--------------------------------------------------------------" << std::endl; std::cout << "" << std::endl; _sleep( 3000 ); std::cout << "agresor zaatakowal " << imie << std::endl; _sleep( 2000 ); int twojezyciea =(( rand() % 10 ) + 1 ); int obrona2 =(( rand() % 3 ) + 1 ); std::cout << "obrazenia:" << twojezyciea + obrona2 << std::endl; std::cout << "zablokowano " << obrona2 << " punktow obrazen" << std::endl; int twojezycie3 = twojezycie2 - twojezyciea; std::cout << "stan zycia " << imie << "=" << twojezycie3 << std::endl; std::cout << "" << std::endl; std::cout << "--------------------------------------------------------------" << std::endl; std::cout << "" << std::endl; _sleep( 3000 ); std::cout << imie << " zaatakowal agresora" << std::endl; _sleep( 2000 ); int zycieagresorab =(( rand() % 10 ) + 1 ); std::cout << "obrazenia:" << zycieagresorab << std::endl; int zycieagresora4 = zycieagresora3 - zycieagresorab; std::cout << "stan zycia agresora= " << zycieagresora4 << std::endl; std::cout << "" << std::endl; std::cout << "--------------------------------------------------------------" << std::endl; std::cout << "" << std::endl; _sleep( 3000 ); std::cout << "agresor zaatakowal " << imie << std::endl; _sleep( 2000 ); int twojezyciec =(( rand() % 10 ) + 1 ); int obrona3 =(( rand() % 3 ) + 1 ); std::cout << "obrazenia:" << twojezyciec + obrona3 << std::endl; std::cout << "zablokowano " << obrona3 << " punktow obrazen" << std::endl; int twojezycie4 = twojezycie3 - twojezyciec; std::cout << "stan zycia " << imie << "=" << twojezycie4 << std::endl; std::cout << "" << std::endl; std::cout << "--------------------------------------------------------------" << std::endl; std::cout << "" << std::endl; _sleep( 3000 ); std::cout << imie << " zaatakowal agresora" << std::endl; _sleep( 2000 ); int zycieagresorac =(( rand() % 10 ) + 1 ); std::cout << "obrazenia:" << zycieagresorac << std::endl; int zycieagresora5 = zycieagresora4 - zycieagresorac; std::cout << "stan zycia agresora= " << zycieagresora5 << std::endl; if( zycieagresora5 <= 0 ) { std::cout << "Agresor zginol-wygrywasz" << std::endl; std::cout << "=========================================" << std::endl; std::cout << "===================WIN===================" << std::endl; std::cout << "=========================================" << std::endl; } else; std::cout << "" << std::endl; std::cout << "--------------------------------------------------------------" << std::endl; std::cout << "" << std::endl; _sleep( 3000 ); std::cout << "agresor zaatakowal " << imie << std::endl; _sleep( 2000 ); int twojezycied =(( rand() % 10 ) + 1 ); int obrona4 =(( rand() % 3 ) + 1 ); std::cout << "obrazenia:" << twojezycied + obrona4 << std::endl; std::cout << "zablokowano " << obrona4 << " punktow obrazen" << std::endl; int twojezycie5 = twojezycie4 - twojezycied; std::cout << "stan zycia " << imie << "=" << twojezycie5 << std::endl; if( twojezycie5 <= 0 ) { std::cout << "Przegrales" << std::endl; std::cout << " !!!KONIEC GRY!!!" << std::endl; } else; std::cout << "" << std::endl; std::cout << "--------------------------------------------------------------" << std::endl; std::cout << "" << std::endl; _sleep( 3000 ); std::cout << imie << " zaatakowal agresora" << std::endl; _sleep( 2000 ); int zycieagresorad =(( rand() % 10 ) + 1 ); std::cout << "obrazenia:" << zycieagresorad << std::endl; int zycieagresora6 = zycieagresora5 - zycieagresorad; std::cout << "stan zycia agresora= " << zycieagresora6 << std::endl; if( zycieagresora6 <= 0 ) { std::cout << "Agresor zginol-wygrywasz" << std::endl; std::cout << "=========================================" << std::endl; std::cout << "===================WIN===================" << std::endl; std::cout << "=========================================" << std::endl; } else; std::cout << "" << std::endl; std::cout << "--------------------------------------------------------------" << std::endl; std::cout << "" << std::endl; _sleep( 3000 ); std::cout << "agresor zaatakowal " << imie << std::endl; _sleep( 2000 ); int twojezyciee =(( rand() % 10 ) + 1 ); int obrona5 =(( rand() % 3 ) + 1 ); std::cout << "obrazenia:" << twojezyciee + obrona5 << std::endl; std::cout << "zablokowano " << obrona5 << " punktow obrazen" << std::endl; int twojezycie6 = twojezycie5 - twojezyciee; std::cout << "stan zycia " << imie << "=" << twojezycie6 << std::endl; if( twojezycie6 <= 0 ) { std::cout << "Przegrales" << std::endl; std::cout << " !!!KONIEC GRY!!!" << std::endl; } else; std::cout << "" << std::endl; std::cout << "--------------------------------------------------------------" << std::endl; std::cout << "" << std::endl; _sleep( 3000 ); std::cout << imie << " zaatakowal agresora" << std::endl; _sleep( 2000 ); int zycieagresorae =(( rand() % 10 ) + 1 ); std::cout << "obrazenia:" << zycieagresorae << std::endl; int zycieagresora7 = zycieagresora6 - zycieagresorae; std::cout << "stan zycia agresora= " << zycieagresora7 << std::endl; if( zycieagresora7 <= 0 ) { std::cout << "Agresor zginol-wygrywasz" << std::endl; std::cout << "=========================================" << std::endl; std::cout << "===================WIN===================" << std::endl; std::cout << "=========================================" << std::endl; } else; std::cout << "" << std::endl; std::cout << "--------------------------------------------------------------" << std::endl; std::cout << "" << std::endl; _sleep( 3000 ); std::cout << "agresor zaatakowal " << imie << std::endl; _sleep( 2000 ); int twojezycief =(( rand() % 10 ) + 1 ); int obrona6 =(( rand() % 3 ) + 1 ); std::cout << "obrazenia:" << twojezycief + obrona6 << std::endl; std::cout << "zablokowano " << obrona6 << " punktow obrazen" << std::endl; int twojezycie7 = twojezycie6 - twojezycief; std::cout << "stan zycia " << imie << "=" << twojezycie7 << std::endl; if( twojezycie7 <= 0 ) { std::cout << "Przegrales" << std::endl; std::cout << " !!!KONIEC GRY!!!" << std::endl; } std::cout << "" << std::endl; std::cout << "--------------------------------------------------------------" << std::endl; std::cout << "" << std::endl; _sleep( 3000 ); std::cout << imie << " zaatakowal agresora" << std::endl; _sleep( 2000 ); int zycieagresoraf =(( rand() % 10 ) + 1 ); std::cout << "obrazenia:" << zycieagresoraf << std::endl; int zycieagresora8 = zycieagresora7 - zycieagresoraf; std::cout << "stan zycia agresora= " << zycieagresora8 << std::endl; if( zycieagresora8 <= 0 ) { std::cout << "Agresor zginol-wygrywasz" << std::endl; std::cout << "=========================================" << std::endl; std::cout << "===================WIN===================" << std::endl; std::cout << "=========================================" << std::endl; } else; std::cout << "" << std::endl; std::cout << "--------------------------------------------------------------" << std::endl; std::cout << "" << std::endl; _sleep( 3000 ); std::cout << "agresor zaatakowal " << imie << std::endl; _sleep( 2000 ); int twojezycieg =(( rand() % 10 ) + 1 ); int obrona7 =(( rand() % 3 ) + 1 ); std::cout << "obrazenia:" << twojezycieg + obrona7 << std::endl; std::cout << "zablokowano " << obrona7 << " punktow obrazen" << std::endl; int twojezycie8 = twojezycie7 - twojezycieg; std::cout << "stan zycia " << imie << "=" << twojezycie8 << std::endl; if( twojezycie8 <= 0 ) { std::cout << "Przegrales" << std::endl; std::cout << " !!!KONIEC GRY!!!" << std::endl; } } break; } return 0; }
@edit
nieaktualne. Problem znajduje się dalej.
OK. Wyskakuja mi dwa errory:
1.zycieagresoram( to jest w case 1) was not decclared in this. ( linijka nr 137)
2.zycieagresora2 (to jest w case 2)
was not decclared in this. ( linijka nr 442)
Co jest błędnie zrobione.
W grze są wymienione statystyki- jeszcze nie działają ale początki próby robienia uniku można zauważyć.
|
|
sasa32010 |
:-) » 2013-03-16 21:44:34 pozadnie sie ::std napisales :-)
ja poczatkuje ale moge powiedziec ze mogles nie dodac jakiejs biblioteki lub nie zadeklarowac zmiennych
:-)
ale kod jest super i zagram jak skonczysz :-)
B-)
:-D
:-)
|
|
pekfos |
» 2013-03-16 21:52:01 Zmiennych nie znajduje, bo definiujesz je w ifach. Ten zapis jest błędny. if( bonusm = 1, 2, 3, 4, 5 )
sasa32010: nie ma to jak odpowiadać na temat.. |
|
sasa32010 |
» 2013-03-16 21:56:44 << nie na temat, removed by ison >> |
|
StuFfii Temat założony przez niniejszego użytkownika |
» 2013-03-16 22:01:51 Napewno nie będzie if( bonus != 1, 2, 3, 4, 5 ) ten zapis oznacza liczbe różną od a tego nie chce.
@sasa32010
std
std
std
będze mieć po tym koszmary. Ogólnie cały program pisałem 3 dni więc pełna wersja nie wyjdzie zbyt szybko. 3 dni na jedną walke. Żeby gra była wciągająca na początek musi być ok.50 walk, zbroje , miecze, ciosy specjalne, eliksiry...
Porwałem się z motyką na słońce ale kiedyś podołam.
@sasa32010
na początku kodu dajesz[.cpp]...a na końcu[./cpp]
Tylko bez kropek w nawiasach kwadratowych. Napisałem tak bo to co w środku zmieniło by się na kod
:-> |
|
SeaMonster131 |
» 2013-03-16 22:05:52 Oba warunki są złe. Jak już to if( bonus == 1 && bonus == 2 && bonus == 3 &&...)
Kod w ramce: [cpp] kod [/cpp] |
|
sasa32010 |
» 2013-03-16 22:07:56 o i sea monster rozwiazal problem SeaMonster131: Proszę, nie spamuj. |
|
|
pekfos |
» 2013-03-16 22:08:57 = to operator przypisania, a nie porównania. Poza tym nie można w ten sposób porównywać. Dla przykładu: #include <iostream>
int main() { int x = 50; if( x == 1, 2, 3, 4 ) std::cout << x; } Jak już to
if( bonus == 1 && bonus == 2 && bonus == 3 &&...)
|
Jak bonus jest równe 1, to nie jest równe 2, itd |
|
« 1 » 2 3 4 5 |