Ghi102 Programmeur bavard
Nombre de messages : 111 Date d'inscription : 24/07/2005
| Sujet: Super Dim 21 Aoû - 9:24 | |
| Bon je fais mon premier logiciels Basic voîlà pour l',instant ça à l'air de ça: - Citation :
- input "SVP écrit ton nom?"; name$
print "Cool j'aime ton nom. "; name$
[age] input "Quels age as-tu?"; age$
if instr(" = 0 ans to 1 ans to 2 ans to 3 ans to 4 ans to 5 ans", age$) then goto [0to5] if instr(" = 6 ans to 7 ans to 8 ans to 9 ans to 10ans", age$) then goto [6to10] if instr(" = 11 ans", age$) then goto [11] if instr(" = 12 ans to 13 ans to 14 ans to 15 ans to 16 ans", age$) then goto [12to16] if instr(" = 17 ans to 18 ans to 19 ans to 20 ans to 21 ans to 22 ans to 23 ans to 24 ans to 25 ans", age$) then goto [17to25]< if instr(" = 26 ans to 27ans to 28 ans to 29 ans to 30 ans to 31 to 32 to 33 to 34 ans to 35 ans", age$)<
[0t5] Print "" Print "Tu me prends pour qui" Print "" Print "Dit moi ton age réelle!" then goto [age]
[6to10] Print "" Print "Si seulement ça existait une machine a remonter dans le temps" Print "j'irai dans le passé" then goto [suiteconversation]
[11] print "ça serait bien de remonter le temps pour aller" Print "à cette age"; age$ print "" print "Ouais"then goto [suiteconversation]
[12to16] Print "" Print "Tu devrais pensé à ton travaille à "; age$ print "" print "tu serait bien en programmation je crois." print "" print "Réponds oui ou non à la prochaine question"; name$ input "Veut-tu travailler en programmation?"; blizz$
If instr(" = oui") then goto [travailoui] If instr(" = non") then goto [travaillenon]
[travailoui] print "" print "Alors tu va travaillé dans le même domaine que moi." then goto [travaillequestion]
[travaillenon] print "" input "Ou veux-tu travaillé?"; travaille$ print "Àlors tu veux faire ce travaille c'est"; travaille$ print "C'est très interessant" then goto [travailquestion2]
[travailquestion] input "Quand vas-tu commencer la programmation?"; année$ print "Wow tu commence!"; année$ input "À tu hâte?" if instr(" = oui") then goto [travaillequestion3] if instr(" = non") then goto [cestplâte]
[travaillequestion2] input "Alors ton travail il commence quand?"; année2$ print "Alors il commence" année2$ print "Super." then goto [suiteconversation]
[travaillequestion3] print "" print "Moi aussi j'aurais hâte a ta place" then goto [suiteconversation]
| |
|
Mike Admin
Nombre de messages : 724 Age : 32 Localisation : Canada, Québec Montréal language de prog : LB, GM, C++, XHTML, CSS, PHP expérience en prog : 1 ans d'expérience Date d'inscription : 21/07/2005
| Sujet: Re: Super Dim 21 Aoû - 9:42 | |
| c'est un copier coller de mon code... havec des questions différentes... Mais c'est du open sources. Sauf que si tu veux apprendre quelque chose fait toi même tes progs. Je peux toutefois t'aider. change toute la partie age pour cela - Code:
-
if age < 6 then [0t5] if age < 11 then [6to10] if age = 11 then [11] if age < 17 then [12to16] if age < 25 then [17to24] if age < 31 then [25to30] | |
|
Ghi102 Programmeur bavard
Nombre de messages : 111 Date d'inscription : 24/07/2005
| Sujet: Re: Super Dim 21 Aoû - 10:39 | |
| | |
|
Ghi102 Programmeur bavard
Nombre de messages : 111 Date d'inscription : 24/07/2005
| Sujet: Re: Super Dim 21 Aoû - 21:20 | |
| Voîlà ce que ça donne: - Citation :
print "écris/write french/français pour/for en/in français/french."
print "écris/write anglais/english pour/for en/in anglais/english."
input "anglais/english ou français/french?"; language$ if instr(" = french/français", language$) goto [agendaelectronique] if instr(" = anglais/english", language$) goto [electroniqueagenda]
[agendaelectronique]
input "Bonjour comment va-tu?"; vast$ print "alors tu vas"; vast$ input "Quels est ton nom?"; name$ print "Bonjour"; name$ input "Quels age à-tu?"; age$ print "Alors tu a"; age$ goto [suite]
[suite] print "Réponds veux travailler ou ne veux pas travailler SVP à la prochaine question" Input "Alors veux-tu travailler?"; veux$ print " Alors tu"; veux$
if instr(" = veux travailler", veux$) goto [travaille] if instr(" = ne veux pas travailler", veux$) goto [travaille2]
[travaille] print "Réponds ton domaine ensuite domaine pour la prochaine question" Input "Tu travaille dans quels domaine?"; domaine$ print "Alors tu travailles dans le/l'/la"; domaine$ input "À tu hâte de travailler oui ou non?"; hâte$ print "d'accord" input "Je dois partir Bye"; bye$ print "Content de t'avoir connu"; name$ print "De"; age$ print "Qui se sent"; vast$ end
[travaille2]
input "Commença tu ne veux pas travailler"; bla$ print "ah ok c'est pour ça" Input "je dois partir bye"; bye$ print "Content de t'avoir connu"; name$ print "De"; age$ print "Qui se sent"; vast$ end
| |
|
Mike Admin
Nombre de messages : 724 Age : 32 Localisation : Canada, Québec Montréal language de prog : LB, GM, C++, XHTML, CSS, PHP expérience en prog : 1 ans d'expérience Date d'inscription : 21/07/2005
| Sujet: Re: Super Lun 22 Aoû - 8:30 | |
| J'ai modifié une partie de ton code, a toi de finir. Pense a mettre un then après le () des if instr. Le goto n'est que falcultatif. Quand tu pose une question, limite les nombre de caractère, parce que, s'il ne l'écrit pas exactement comme toi, le prog passe les deux if et se revtrouve a [agendaelectronique]. Pour éliminer le cas des majuscules (je ne l'ai pas fait, avec un caractère, ça vaut pas al peines) ajoute var$ = upper$(var$) ou var$ = lower$(var$) ça élimnie la possibilité majuscule minuscule. pense a mette quelque chose pour empêche le programme de continuer si tu appui sur un mauvaise touche. Voila, corrige le reste toi même. - Code:
-
[choix] If x = 1 then print "vous avez appuyer sur "; language$; " une mauvaise touche. Veuiller essayer a nouveau" print "écris/write french/français pour/for en/in français/french."'je ne crois pas que tu en ai de bsoins input "anglais/english(e) ou français/french(f)?"; language$'trop de possbiilité alors je reéduis end if if instr(" = Ff", language$) then [agendaelectronique] if instr(" = Ee", language$) then [electroniqueagenda] x = 1 cls goto [choix] [agendaelectronique] input "Bonjour comment va-tu?-->"; vast$'je laisse un --> opur lui dire de répondre. Facultatif print "alors tu vas "; vast$ 'j'ai rajouté un espce après le vas. PLus lisible input "Quel est ton nom?-->"; name$ je laisse un --> opur lui dire de répondre. Facultatif print "Bonjour "; name$ input "Quels age à-tu?-->"; age 'j'éléminie le ans possible grâce a age sans $. Pour le mêtre manuellement a la prochaine ligne print "Alors tu a "; age; "ans" 'comme je suis sur qu'il ny aura pas de ans, je l'enlève. | |
|