Jump to content
xisto Community

Dark_Prisoner

Members
  • Content Count

    23
  • Joined

  • Last visited

Everything posted by Dark_Prisoner

  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
  15. I had lived this kind of relationship , The girl , in the beginning seemed to love me but .. something happened , we made some fight's and now i am trying to make a relationship with another one I dont think that there is a perfect girl or boy , I guess these things are just " illusions and nightmares"
  16. I think you are dreaming , actual space ships cannot go further than moon , so ? other planets ? it will need time , and ressources , any they'd better make it quickly cuz the atmosphere is getting worser here and we need a place where to live if something happened to earth
  17. PHP is simply what makes web dynamic , for example : forums , online rpg games , mails , etc ... is made by phpWithout php we'll just see the same things all the time
  18. Introduction to programmation I heard so many people talking about programmation but I dont know exactly what it does mean!. Well it's true that when we hear somebody talking about programmation, we feel that he is speaking in a foreign language .. But know you will understand him at least a little bit . You must know that programmation is making programs. "A program" means any thing could be executed in a machine, it could be software or hardware (a software program is a program that runs in a computer and have effect with the user) and (a hardware program is a program that runs in the machine micro-ships and circuits).In our case , We will programm software programs. To achieve that we need a programmation language. Euh , What's a programmation language? A programmation language is the language that we use to make the programs. The one that the compiler understand. A program is not made by some simple clicks by your mouse! There are many programmation language such as : C/C++ Visual Basic Python Java .. And we class them by level "height", for example "Assembler" is a very low level language. In the opposite way "Java" is a high level one. Why do we class them this way? We class programmation languages because every height of level has its appropriate caracteristics. We must retain: A low level language is very fast and it doesn't require a lot of the system power, but in fact a simple program in a low level language require much of code lines , a very big number! Opposite sens , the high level languages are very easy to be manupilated by the programmer but it requires a lot of the machin power!. Ok , but are we going to use all these languages? and wich level are we going to program on? Of course we are not going to use all the programmation languages! The language that we're gonna use is the C language, and let me introduce it in few lines (a general culture have never killed any one;): The first language made was "Assembler" it was very hard. And it spoke directly to the the micro-processor of the computer. So it was more a machine language then a Human language.This is why they invented language "A" wich didn't stay long so the "B" language came and relaced it. The "B" language didn't disappear but programmer's developped it to become "C" language and we will learn it now. It is a "portable" language ( that doesn't mean that it works in the mobile phone ). Protable means that the same source code can work on any Operating system , such as :Windows, Linux, Mac, symbian ( so it work also on phones lol ). The C language isn't a low level nor a high level language but we can say that it is in the middle of the stears . The Assembler didn't disappear ! It still be used in many programs especially in high damage viruses because it's the closest to the machine and it moves directly the values of the micro-processor registery's. This doesn't help by nothing now but it is just a general culture ! Excuse me , What can you're language do ? It can do what you want it to do ! It can make 3Dimensional games , Text editors, Mp3 player , .. Any thing . For your information half life 2 was made by the C++ language wich is a new "version" of the C language and this doesn't mean that C is limited . Remember one thing THERE ARE NO LIMITS ! All right now ,it is enough for today .. You have a little knowledge about programmation and the programmation languages .. In the next chapter we'll configure our machines and move into the battle field ! //Please comment this tutorial
  19. Well i am developping an RPG game , i think you can help me on it , we'll discuss by private message(Learn SFML (Simple and Fast Multimedia Library))
  20. Well as i believe , we are born to be tested another day , to see who done good and who done bad things; The place (earth ) has a divin answer ; We are different from animals and creatures because we have brain to think and protect our selves with it, and to answer questions of existing the source , and the future; This is my opinion , And You have to think and find a good answer
×
×
  • 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.