اطلاعیه

Collapse
No announcement yet.

اشکال زدایی برنامه های کنسولی شما با کمک دیگران

Collapse
X
 
  • فیلتر
  • زمان
  • Show
Clear All
new posts

    اشکال زدایی برنامه های کنسولی شما با کمک دیگران

    سلام

    اگه برنام های نوشتین که می خواین ایراداتشو پیدا کنین (مثل نسخه ی بتای نرم افزار ها) لینکشو می تونین اینجا بذارین تا بقیه براتون اشکالاتشو پیدا کنن.
    البته می تونین یه فایل لاگ برا برنامه تون تعبیه کنین تا در صورت پیدا شده ارور ، بقیه اینو هتون برگردونن تا اشکالات احتمالی رو پیدا کنین که کجاست/
    طرز بکار بردن این فایل های لاگ رو در برنامه هاتون عرض می کنم.

    من دارم یه بازی تخته نرد می نویسم ، گه کامل شد پلودش می کنم و لینکشو می ذارم تا اشکالاتشو پیدا کنین.

    مرسی.


    Upload your files Here. Great Azeri Resumable File Host: http://endir.az/index.php?lang=5

    #2
    پاسخ : اشکال زدایی برنامه های کنسولی شما با کمک دیگران

    سلام بزرگان

    من پروژه ی طراحی الگوریتم خودم رو پلود می کنم.

    دو تا مرتب سازی Heap Sort و Radix Sort هست که هر کدومشون هم کنسولی نوشته شدن و هم گرافیکی. پس میشه 4 تا برنامه

    ببینین چه خبره

    فقط دقت داشته باشین برای برنامه های گرافیکی باید داخل پوشه ی res که موجوده یه فایل با آهنگ با نام music.ogg اضافه کنین تا برنامه کار کنه. این فایلو پاک کردم تا برنامه کوچیک تر بشه برای پلود/
    لطفا یه آهنگ یانی براش بذارین. :mrgreen:

    تو این برنامه ها تفاوت کارایی این دو سبک مرتب سازی کاملا واضحه. (اونم با تعداد اعداد متفاوت)

    اعداد ورودی رو داخل فایل input.txt اضافه کنین.

    مرسی.
    Upload your files Here. Great Azeri Resumable File Host: http://endir.az/index.php?lang=5

    دیدگاه


      #3
      پاسخ : اشکال زدایی برنامه های کنسولی شما با کمک دیگران

      سلام
      اینم لینک اون برنامه
      http://www.4shared.com/file/56590231/78b9fdd2/ABED_SORT.html

      مرسی
      Upload your files Here. Great Azeri Resumable File Host: http://endir.az/index.php?lang=5

      دیدگاه


        #4
        پاسخ : اشکال زدایی برنامه های کنسولی شما با کمک دیگران

        سلام

        برنامه چطور بود

        راستی برای کسایی که نمی دونن عرض می کنم برای تبدیل یه فایل صوتی به ogg که برای این برنامه نیازه ،میتونین از jet audio استفاده کنین.

        مرسی
        نظری بدین لااقل :mrgreen: :mrgreen:
        Upload your files Here. Great Azeri Resumable File Host: http://endir.az/index.php?lang=5

        دیدگاه


          #5
          پاسخ : اشکال زدایی برنامه های کنسولی شما با کمک دیگران

          سلام بزرگان

          کسی نظری نداره

          برنامه بدرد میخوره نمیخوره چشه؟

          Upload your files Here. Great Azeri Resumable File Host: http://endir.az/index.php?lang=5

          دیدگاه


            #6
            پاسخ : اشکال زدایی برنامه های کنسولی شما با کمک دیگران

            سلام بزرگان
            این برنامه ای که الان میذارم کار خودمه و برای پیدا کردن اعداد اول کوچکتر از یه عددی هست که شما وارد می کنین. سرعتشم بالاست.

            این یکی با devcpp کامپایل میشه:



            #include <iostream>
            using namespace std;
            #include <iomanip> //for setw()
            using namespace std;
            #include <cmath> //for sqrt()
            using namespace std;
            #include <ctime>
            using namespace std;
            #include <cstdlib> //for exit()
            using namespace std;
            #include <fstream>
            using namespace std;
            #include <conio.h> //for getch()
            ///////////////////////////////////////////////////////////////////////////
            #ifndef PAUSE
            #define PAUSE
            //pause() pauses the program and waits for <ENTER>.
            void pause() {
            char k; do k=getch();
            while (k!=static_cast<char>(13));
            return;
            }
            #endif
            ///////////////////////////////////////////////////////////////////////////
            #ifndef clrscr()
            #define clrscr() system("cls&quot
            #endif
            ///////////////////////////////////////////////////////////////////////////
            #ifndef LENGTH
            #define LENGTH
            int length(int n) { //returns length of its argument in decimal form.
            int lng=0;
            while (n) { n=static_cast<int>(n/10); lng++; }
            return lng;
            } //end length()
            #endif
            ///////////////////////////////////////////////////////////////////////////
            int main() {
            system("color 0a"
            unsigned long nm;
            char choice;
            do {
            do {
            clrscr();
            cout<<"\n Enter a number greater than 4 ";
            cout<<"to find prime numbers smaller than it:\n number: ";
            cin>>nm;
            } while (nm<5); //end do...while
            do {
            clrscr();
            cout<<"\n Select a choice:";
            cout<<"\n 1. Prime numbers will be stored in the file \"primes.txt\"";
            cout<<"\n 2. Prime numbers will be shown on the screen ";
            cout<<"without being stored";
            cout<<"\n 3. Prime numbers will be shown and ";
            cout<<"will be stored in the file \"primes.txt\"";
            cout<<"\n 4. Enter the number again ( Currently entered number is ";
            cout<<nm<<" )";
            cout<<"\n 5. Exit\n ";
            choice=getch();
            } while ((choice<'1&#039||(choice>'5&#039);
            if (choice=='5&#039 exit(0); //immediate exit
            } while (choice=='4'
            unsigned long num=nm;
            bool skip=1;
            #define R num%6
            switch (R) {
            case 0: num--; break;
            case 1: skip=0; break;
            case 2: skip=0; num--; break;
            case 3: skip=0; num-=2; break;
            case 4: skip=0; num-=3; break;
            } //end switch
            #define W length(num)
            #define K static_cast<int>(79/(W+1))
            bool jump,flag=1;
            unsigned long j,cnt=2;
            short lng=0;
            cout<<"\n Press <ENTER> to continue.";
            pause();
            clrscr();
            time_t *st_time=new time_t;
            time_t *fn_time=new time_t;
            switch (choice) {
            case '1': {
            cout<<"Please wait while processing...\n";
            ofstream file;
            file.open("primes.txt",ios::trunc);
            file<<"The following are Prime Numbers smaller than or equal to ";
            file<<nm<<" :"<<endl;
            file<<left;
            file<<"################################ ########";
            file<<"################################ #######"<<endl;
            time(st_time);
            for (unsigned long i=num;i>=5;skip=!skip) {
            if (!(i%3)) flag=0;
            j=5;jump=0;
            #define RI static_cast<unsigned long>(sqrt(i))
            while ((j<=RI)&&(flag)) {
            if (!(i%j)) flag=0;
            if (jump) { j+=4; jump=0; } else { j+=2; jump=1; }
            } //end while
            if (flag) {
            file<<setw(W)<<i<<" ";
            cnt++;
            lng++;
            if (lng==K) { file<<endl; lng=0; }
            } else flag=1; //end if...else
            if (skip) i-=4; else i-=2;
            #undef RI
            } //end if
            file<<setw(W)<<3<<" ";
            if (lng+1==K) file<<endl;
            file<<setw(W)<<2<<endl;
            time(fn_time);
            file<<"################################ ########";
            file<<"################################ #######"<<endl;
            clrscr();
            cout<<"Processing completed...";
            cout<<"\nPress <ENTER> to view the statistics...";
            pause();
            clrscr();
            cout<<"There are "<<cnt<<" prime numbers smaller than or equal to ";
            cout<<nm<<" ."<<endl;
            file<<"There are "<<cnt<<" prime numbers smaller than or equal to ";
            file<<nm<<" ."<<endl;
            cout<<"Elapsed time during calculation : ";
            file<<"Elapsed time during calculation : ";
            time_t T,H,M,S;
            T=*fn_time-*st_time;
            H=static_cast<time_t>(T/3600);
            T%=3600;
            M=static_cast<time_t>(T/60);
            S=T%60;
            cout<<H<<":"<<M<&lt ;":"<<S<<endl;
            file<<H<<":"<<M<&lt ;":"<<S<<endl;
            file<<"Zabihollah Babazadeh. (Success1917@gmail.com)"<<endl;
            file.close();
            cout<<"Results had been saved in the file \"primes.txt\"";
            break;
            } //end case '1'
            case '2': {
            cout<<left;
            cout<<"################################ ########";
            cout<<"################################ #######"<<endl;
            time(st_time);
            for (unsigned long i=num;i>=5;skip=!skip) {
            if (!(i%3)) flag=0;
            j=5;jump=0;
            #define RI static_cast<unsigned long>(sqrt(i))
            while ((j<=RI)&&(flag)) {
            if (!(i%j)) flag=0;
            if (jump) { j+=4; jump=0; } else { j+=2; jump=1; }
            } //end while
            if (flag) {
            cout<<setw(W)<<i<<" ";
            cnt++;
            lng++;
            if (lng==K) { cout<<endl; lng=0; }
            } else flag=1; //end if...else
            if (skip) i-=4; else i-=2;
            #undef RI
            } //end if
            cout<<setw(W)<<3<<" ";
            if (lng+1==K) cout<<endl;
            cout<<setw(W)<<2<<endl;
            time(fn_time);
            cout<<"################################ ########";
            cout<<"################################ #######"<<endl;
            cout<<"There are "<<cnt<<" prime numbers smaller than or equal to ";
            cout<<nm<<" ."<<endl;
            cout<<"Elapsed time during calculation : ";
            time_t T,H,M,S;
            T=*fn_time-*st_time;
            H=static_cast<time_t>(T/3600);
            T%=3600;
            M=static_cast<time_t>(T/60);
            S=T%60;
            cout<<H<<":"<<M<&lt ;":"<<S<<endl;
            cout<<"Zabihollah Babazadeh. (Success1917@gmail.com)"<<endl;
            break;
            } //end case '2'
            case '3': {
            ofstream file;
            file.open("primes.txt",ios::trunc);
            file<<"The following are Prime Numbers smaller than or equal to ";
            file<<nm<<" :"<<endl;
            cout<<left;
            file<<left;
            cout<<"################################ ########";
            cout<<"################################ #######"<<endl;
            file<<"################################ ########";
            file<<"################################ #######"<<endl;
            time(st_time);
            for (unsigned long i=num;i>=5;skip=!skip) {
            if (!(i%3)) flag=0;
            j=5;jump=0;
            #define RI static_cast<unsigned long>(sqrt(i))
            while ((j<=RI)&&(flag)) {
            if (!(i%j)) flag=0;
            if (jump) { j+=4; jump=0; } else { j+=2; jump=1; }
            } //end while
            if (flag) {
            cout<<setw(W)<<i<<" ";
            file<<setw(W)<<i<<" ";
            cnt++;
            lng++;
            if (lng==K) { cout<<endl; file<<endl; lng=0; }
            } else flag=1; //end if...else
            if (skip) i-=4; else i-=2;
            #undef RI
            } //end if
            cout<<setw(W)<<3<<" ";
            file<<setw(W)<<3<<" ";
            if (lng+1==K) { cout<<endl; file<<endl; }
            cout<<setw(W)<<2<<endl;
            file<<setw(W)<<2<<endl;
            time(fn_time);
            cout<<"################################ ########";
            cout<<"################################ #######"<<endl;
            cout<<"There are "<<cnt<<" prime numbers smaller than or equal to ";
            cout<<nm<<" ."<<endl;
            cout<<"Elapsed time during calculation : ";
            file<<"################################ ########";
            file<<"################################ #######"<<endl;
            file<<"There are "<<cnt<<" prime numbers smaller than or equal to ";
            file<<nm<<" ."<<endl;
            file<<"Elapsed time during calculation : ";
            time_t T,H,M,S;
            T=*fn_time-*st_time;
            H=static_cast<time_t>(T/3600);
            T%=3600;
            M=static_cast<time_t>(T/60);
            S=T%60;
            cout<<H<<":"<<M<&lt ;":"<<S<<endl;
            cout<<"Zabihollah Babazadeh. (Success1917@gmail.com)"<<endl;
            file<<H<<":"<<M<&lt ;":"<<S<<endl;
            file<<"Zabihollah Babazadeh. (Success1917@gmail.com)"<<endl;
            file.close();
            cout<<"Results had been saved in the file \"primes.txt\"";
            break;
            } //end case '3'
            } //end switch
            cout<<"\nPress <ENTER> to exit...";
            pause();
            return 0;
            } //end main()





            نظر یادتون نره.
            مرسی
            Upload your files Here. Great Azeri Resumable File Host: http://endir.az/index.php?lang=5

            دیدگاه

            لطفا صبر کنید...
            X