Jump to content
xisto Community

Dark_Prisoner

Members
  • Content Count

    23
  • Joined

  • Last visited

1 Follower

About Dark_Prisoner

  • Rank
    Newbie [Level 1]
  1. Good work for a beginner Any way you was able to put each procedures running in 2 if() conditions having the same condition int the same if() *And there is a word replacing "\n" in the C++ language which is : endl = End line . I think it is easier to be read . *Why don't you replace : cin.get(); by system("PAUSE");which shows you a beautiful line in the console *Always return a 0 status from you program , in fact i always use : return EXIT_SUCCESS which means that the program encountered no problem . ->After modifications you code will be like this : (Your actual code is correct but it will be more ... Professional ? ) #include using namespace std; int main() { [indent]// Define variables int anumber; cout<<"Please enter a number between 1 and 10"; cin>> anumber; cout< if (anumber > 10) { [indent]cout<<"Number above 10!"; cout<<< endl; cout<<"Decreasing number entered to 10...."; cout<<< endl; for (int a = anumber; a >= 10; a--) { [indent]cout<< a <<endl; [/indent] } [/indent]} else if (anumber < 1) { [indent]cout<<"Number below 1!"; cout<<< endl; cout<<"Increasing number entered to 1...."; cout<<< endl; for (int b = anumber; b <= 1; b++) { [indent]cout<< b <<endl; [/indent]} [/indent]} else { [indent]cout<<"You entered "<< anumber <<" which is between 1 and 10"; cout<<< endl; [/indent]} cout<<< endl; system("PAUSE"); return EXIT_SUCCESS; [/indent]}Now what do you think ? Notice from rvalkass: Your code needs to have Code tags around it. Added them.
  2. how does that : Shows that : ? Console :On the first day of Christmas my true love gave to mea partridge in a pear tree.On the second day of Christmas my true love gave to metwo turtle dovesand a partridge in a pear tree.On the third day of Christmas my true love gave to methree french hens, two turtle dovesand a partridge in a pear tree.On the fourth day of Christmas my true love gave to mefour calling birds, three french hens, two turtle dovesand a partridge in a pear tree.On the fifth day of Christmas my true love gave to mefive gold rings;four calling birds, three french hens, two turtle dovesand a partridge in a pear tree.On the sixth day of Christmas my true love gave to mesix geese a-laying, five gold rings;four calling birds, three french hens, two turtle dovesand a partridge in a pear tree.On the seventh day of Christmas my true love gave to meseven swans a-swimming,six geese a-laying, five gold rings;four calling birds, three french hens, two turtle dovesand a partridge in a pear tree.On the eighth day of Christmas my true love gave to meeight maids a-milking, seven swans a-swimming,six geese a-laying, five gold rings;four calling birds, three french hens, two turtle dovesand a partridge in a pear tree.On the ninth day of Christmas my true love gave to menine ladies dancing, eight maids a-milking, seven swans a-swimming,six geese a-laying, five gold rings;four calling birds, three french hens, two turtle dovesand a partridge in a pear tree.On the tenth day of Christmas my true love gave to meten lords a-leaping,nine ladies dancing, eight maids a-milking, seven swans a-swimming,six geese a-laying, five gold rings;four calling birds, three french hens, two turtle dovesand a partridge in a pear tree.On the eleventh day of Christmas my true love gave to meeleven pipers piping, ten lords a-leaping,nine ladies dancing, eight maids a-milking, seven swans a-swimming,six geese a-laying, five gold rings;four calling birds, three french hens, two turtle dovesand a partridge in a pear tree.On the twelfth day of Christmas my true love gave to metwelve drummers drumming, eleven pipers piping, ten lords a-leaping,nine ladies dancing, eight maids a-milking, seven swans a-swimming,six geese a-laying, five gold rings;four calling birds, three french hens, two turtle dovesand a partridge in a pear tree. Can you please explain it ?
  3. You must make your tuto attractive :Remove the quotation box and put some colors than say that it is not your tutoThis is not clear at all !Just a piece of advice.
  4. It is not so interesting , it is just an extension of the C++ languageAnd i guess that a language that every one understands is better than this one.So i'll keep using c/c++ until the D language become officially the most used language .
  5. I am using the C++ language but i can't forget the C (The base )I made with the C language some console games , and a mario sokoban in GUI by SDL (a library )If you have some questions i can answer you !
  6. This is small program that generates a random number and asks you for it If you guess it than it is right If you don't it will tell you if it is more or less It is in french but i think you'll understand the idea (may be i'll make another edition in english !) ///////////////////////////////////////////////////////////////////////////////// Excellence micro systemsŽ 2007Š //// //// We are glad to present for you our "Plus ou moin v2.0" it is a little ////game running under a console for example ms-dos or Konsole ... The "Plus ou////moin v1.1.exe" file runs under MS-dos and Windows console.. With the source////code you can compile the application and make it work with any OS such as ////Windows , Linux , mac OS ... To see what's new on that version pleaze run ////the file named "what's new.txt" .... Now we wish for you a funy time;) //// //// To contact us please send a mail to Mr Dhia Eddine Chouchane ////"assir2@hotmail.fr" ////Or take a look at our main site : "http://excellence.247ihost.com" /////////////////////////////////////////////////////////////////////////////////#include <stdio.h>#include <stdlib.h>#include <time.h> //librairie qui permet de tirer un nombre au hazardint main(int argc, char *argv[]){ //Tout d'abord défénir les variables de l'environnement long nombreDevined = 0 , nombreMystere = 0 , nombreDeCoups = 0 , choix; int MAX = 100 , MIN = 1 , Jeu = 1; //L'intro! printf("Excellence micro systems presente :\n\nLe jeu de plus ou moin ..."); printf(" \n\n\n\n\n\n\n"); //Puis definir la fonction de choix aleatoire srand(time(NULL)); //Apres on commence dans le programme //On demande le choix de l'utilisateur printf("Que voulez vous faire?\n"); printf("\n1. Jouer\n"); printf("2. Quitter l'application\n"); printf("\n== Entrez le Numero de votre choix et puis ENTRER\n"); printf("\n\n\n\n\n\nREMARQUE : Pour quitter durant le jeu appuyer sur 0 puis sur ENTRER\n\n"); scanf("%ld", &choix); switch (choix) { case 1 :; break; case 2 : printf("Tu vas quitter le jeu !!\n\n\n"); Jeu = 0; break; default : printf("Ton choix ne figure pas dans la liste\n"); break; } // On entre dans une boucle pour pouvoir rejouer afin d'accomplir le jeu while (Jeu) { //Le programme charge un nombre au hasard nombreMystere = (rand() % (MAX - MIN + 1)) + MIN; /* On redefinie nombreDevined en 0 pour que ça ne pe jamais etre égal avec nombreMystere*/ nombreDevined = 0; while (nombreDevined != nombreMystere) { //On demande le nombre printf("Quel est le nombre ?"); scanf("%ld", &nombreDevined); nombreDeCoups++; //Puis on fait l'analyse if (nombreDevined == nombreMystere) { printf("Bravo, vous avez trouve le nombre mystere en %ld essais!!!\n\n" , nombreDeCoups); //On demande de l'utilisateur si il veux rejouer printf("Voulez vous jouer une deuxieme fois?\n"); printf("si oui tapez 1 puis ENTRER\n"); printf("si non tapez 2 puis ENTRER\n"); scanf("%ld", &choix); switch (choix) { case 1 : Jeu = 1; break; case 2 : Jeu = 0; break; default : printf("Ton choix ne figure pas dans la liste\n"); printf("Tu vas quitter le jeu\n"); break; } } //N'oublions pas que nous sommes toujours en analyse if (nombreDevined == 0) { printf("\n\nTus va quitter le jeu\n\n\n"); Jeu = 0; nombreDevined = nombreMystere; } else if (nombreDevined > nombreMystere) { printf("C'est moins !\n\n"); } else if (nombreDevined < nombreMystere) { printf("C'est plus !\n\n"); } else printf("Ce que tu a entre est faux ou tu a choisis de quitter l'application\n\n"); } } /*demander de l'utilisateur de taper une touche pour continuer afin qu'il peut voir ce qui c'est écrit*/ system("PAUSE"); return 0;}////////////////////////////////////////////////////////////////////////////////// All rights reserved to Excellence micro systemsŽ 18/08/2007Š //// and to its owner Mr. Dhia Eddine Chouchane ////////////////////////////////////////////////////////////////////////////////// Now how about some optimizations ?
  7. If you want my advice , here is a comparation : *-* Linux is the most secure system , it is also : open-source witch means that it is free and its source code is available . It is also updated every 2months (depends on your edition ) It had many desktop environments , a lot of them are amazing . and if you are a good programmer you can make your own desktop environment. 90% of the programs working on it are open-source too There are some programs that let you open windows programs on it , I am thinking about : -Wine : present in about all the editions -Play on linux : http://forums.xisto.com/no_longer_exists/ *-*Windows Xp professional I advise you to use it if you are not a linux pro or you don't want to leave windows It can be safe 50% with a good antivirus. It is not free you should have a liscence for it. *-*Windows Vista : Good only on the graphics and the transparent windows Security is not clear. It has many problems with the explorer.exe (trust me i close it and re run it about 10 times a day ) All your programs must be up to date to work on it , and some times they doesn't work even if they're updated ! Finally i think that you should get : 1- If you understand it : Linux 2- Win Xp Pro as an alternative system to linux I hope that was the answer to your question
  8. I think that this won't work : (i guess) we can't put preprocessor directives on a function If we can , it won't work also , because the compiler or the processor had completed the line : fun();so he won't replace it . if the preprocessor works in functions i guess this will be the answer void fun(void){#define printf("i = %d\n", i) i=0}int main(){int i = 20;fun();printf("i = %d\n", i);return 0;} What do you think ???
  9. Well the medical report said that he was poisoned . And take a look please at the statistics ... Who is killing more ? Palestenians with their small rocks , or Isrealis with their Guns and their Tanks and their bombs And their aerofighters? Every day : * 3-6 Palestinians die which are about 70% *women and children* * 5-9 Palestinians lose their home and become homeless * about 3 *Soldiers* Do you think that these peoples are not going to revenge ? They invented the "suicide bombers" way to defend their selves and their sons , wives , etc.. And finally who came first ? Israelis or Palestinians .. The land was owned by palestinians but Israelis came to it by war .. and now they want us to believe that they're doing that for peace , and to defend their selves . I completely agree with you
  10. Hi every body . I am "Dark Prisoner" known also as "Assir2" (well this is not my real name , but it is a good nickname i guess )However i am from Tunisia , a country on the mideterranean - african coasts , where life is wonderful because of peaceI study on the second class at a Pioneer High school called "Monastir Model High School , LPM" and I am 15 years old.I love computer science , so i think i will study in the computer sciences section. ; I am a programmer using C/C++ Language , a xHTML/PHP coder , Code::Blocks user and GNU/Linux loverI like "heavy metal / symphonic rock / gothic rock " types of music .. I prefere (Metallica , System Of A Down , Rammstein , The cranberries , and Linkin Park a little bit)I hope that you greet me warm in this forum !
  11. You forgot :Pros : All the world is developping open-source programs for it , (you can find anything you want but not made by a big company ; and it works fine )
  12. I used it on my phone running under Symbian OS (Nokia Series 60S) and it is working fine , and free . It is better than the standard symbian browser because it displays an entire web page written in HTML with no modifications (we should say a little bit modified to be adapted with the screen) . May be your Opera is not going well because you are using a "Windows Mobile " Operating system , Well i don't and i won't ; I will never use a Microsoft product , even on my phone. Notice : Opera is free ! recheck it on the official webpage ... And reinstall it , may be it we'll repare the problem
  13. Good news , because i read an article posted in this forum telling that the SQL server doesn't go well , so i decided to not host until you repare the problem .Now i 'll continue collecting the points or credits needed to host a premium account without ads..
  14. Well sometimes the code is well written but when the navigator download it's source linbreaks disappears and it become impossible to read , that happened with me Any way it is really important to be organized when coding , because as you said , sometimes we can't understand what we made by our selves
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.