Rechercher
Derniers sujets
Qui est en ligne ?
Il y a en tout 7 utilisateurs en ligne :: 0 Enregistré, 0 Invisible et 7 Invités Aucun
Le record du nombre d'utilisateurs en ligne est de 24 le Jeu 19 Sep - 16:12:34
Programmation
3 participants
BoostCraft :: Discussions générales :: Blabla :: Poubelle
Page 1 sur 1
Programmation
BonDour,
Esce que qqn dans ce serveur sais programmer. (en C ou en html/css)
Esce que qqn dans ce serveur sais programmer. (en C ou en html/css)
Incolas...- Membre actif
- Messages : 360
Date d'inscription : 03/10/2011
Localisation : Palaiseau
Re: Programmation
Nop. Mais si y a besoin je peux me démerder pour faire un truc avec des tutos
Zombini- Admin
- Messages : 277
Date d'inscription : 27/09/2011
Re: Programmation
Nn pas besoin. Je sais programmer en C mais je voulais juste savoir qui savaient
Incolas...- Membre actif
- Messages : 360
Date d'inscription : 03/10/2011
Localisation : Palaiseau
Re: Programmation
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
const int NOMBRE_DE_VIES_INITIALES = 5;
int nombreDeVies;
int niveau;
int age = 0;
nombreDeVies = 4;
niveau = 2;
printf("Il vous reste %d vie et vous etes au niveau %d\n\n",nombreDeVies, niveau);
printf("***BOUM***\n\n");
nombreDeVies = 3;
niveau = 1;
printf("Oups, tu n'as plus que %d vies. Tu es maintenant au niveau %d \n\n", nombreDeVies, niveau);
printf("Ce n'est pas grave, quel age avez vous ?");
scanf("%d", &age);
printf("Ah, vous avez %d ans !\n", age);
return 0;
}
=P
#include <stdlib.h>
int main(int argc, char *argv[])
{
const int NOMBRE_DE_VIES_INITIALES = 5;
int nombreDeVies;
int niveau;
int age = 0;
nombreDeVies = 4;
niveau = 2;
printf("Il vous reste %d vie et vous etes au niveau %d\n\n",nombreDeVies, niveau);
printf("***BOUM***\n\n");
nombreDeVies = 3;
niveau = 1;
printf("Oups, tu n'as plus que %d vies. Tu es maintenant au niveau %d \n\n", nombreDeVies, niveau);
printf("Ce n'est pas grave, quel age avez vous ?");
scanf("%d", &age);
printf("Ah, vous avez %d ans !\n", age);
return 0;
}
=P
az912- Membre actif
- Messages : 271
Date d'inscription : 01/10/2011
Age : 27
Localisation : Tinqueux
Re: Programmation
#include <iostream>
using namespace std;
void Store(){
cout << "The Item store is not finished yet\n" << endl;
int Mainmenu();
Mainmenu();
}
void Character(){
int PlayerHp, PlayerStr, PlayerMana;
cout << "Your character has:\n\n";
cout << PlayerHp << " Health" << endl;
cout << PlayerStr << " Strength" << endl;
cout << PlayerMana << " Mana" << endl;
cout << endl;
int Mainmenu();
Mainmenu();
}
void Inventory(){
cout << "Your inventory contains:\n" << endl;
int Mainmenu();
Mainmenu();
}
void Wilderness(){
cout << "You search the Jungle and find:\n" << endl;
string Creatures[10];
Creatures[0] = "1";
Creatures[1] = "2";
Creatures[2] = "3";
Creatures[3] = "4";
cout << Creatures << " Is really dangerous " << endl;
int Mainmenu();
Mainmenu();
}
void Mainmenu(){
string choice;
cout << "1: Attack creature" << endl;
cout << "2: Buy equipment" << endl;
cout << "3: Inventory" << endl;
cout << "4: Stats" << endl;
// invalid option returns to this
InvalidOption:
cin >> choice;
if (choice == "1"){
Wilderness ();
}
else if (choice == "2"){
Store();
}
else if (choice == "3"){
Inventory();
}
else if (choice == "4"){
Character();
}
else{
cout << "You have not chosen a valid option" << endl;
goto InvalidOption;
}
}
int main()
{
int PlayerHp = 100, PlayerStr = 20, PlayerMana = 50;
Mainmenu ();
}
using namespace std;
void Store(){
cout << "The Item store is not finished yet\n" << endl;
int Mainmenu();
Mainmenu();
}
void Character(){
int PlayerHp, PlayerStr, PlayerMana;
cout << "Your character has:\n\n";
cout << PlayerHp << " Health" << endl;
cout << PlayerStr << " Strength" << endl;
cout << PlayerMana << " Mana" << endl;
cout << endl;
int Mainmenu();
Mainmenu();
}
void Inventory(){
cout << "Your inventory contains:\n" << endl;
int Mainmenu();
Mainmenu();
}
void Wilderness(){
cout << "You search the Jungle and find:\n" << endl;
string Creatures[10];
Creatures[0] = "1";
Creatures[1] = "2";
Creatures[2] = "3";
Creatures[3] = "4";
cout << Creatures << " Is really dangerous " << endl;
int Mainmenu();
Mainmenu();
}
void Mainmenu(){
string choice;
cout << "1: Attack creature" << endl;
cout << "2: Buy equipment" << endl;
cout << "3: Inventory" << endl;
cout << "4: Stats" << endl;
// invalid option returns to this
InvalidOption:
cin >> choice;
if (choice == "1"){
Wilderness ();
}
else if (choice == "2"){
Store();
}
else if (choice == "3"){
Inventory();
}
else if (choice == "4"){
Character();
}
else{
cout << "You have not chosen a valid option" << endl;
goto InvalidOption;
}
}
int main()
{
int PlayerHp = 100, PlayerStr = 20, PlayerMana = 50;
Mainmenu ();
}
Incolas...- Membre actif
- Messages : 360
Date d'inscription : 03/10/2011
Localisation : Palaiseau
BoostCraft :: Discussions générales :: Blabla :: Poubelle
Page 1 sur 1
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum
|
|
Ven 3 Avr - 22:29:40 par Plumeex
» Canditature de gabi3025
Dim 14 Oct - 19:19:06 par gabi3025
» [Candidature] Aromax
Ven 14 Sep - 19:21:48 par Aromax
» candidature de gus433
Mer 1 Aoû - 16:39:06 par gus433
» Candi de Arsurus
Mar 24 Juil - 15:15:47 par Arsurus
» Candidature de Zz_Ghost_Rusher
Dim 17 Juin - 16:29:55 par Zz_Ghost_Rusher
» candidature
Dim 17 Juin - 16:28:41 par diable2211
» Périados s'excuse pour de bon !
Sam 26 Mai - 11:49:25 par Incolas...
» NOUVEAU SITE !!!
Sam 12 Mai - 18:06:06 par Plumeex