FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC

Développement d'applications avec le langage Panoramic
 
AccueilAccueil  RechercherRechercher  Dernières imagesDernières images  S'enregistrerS'enregistrer  MembresMembres  Connexion  
Derniers sujets
» PANORAMIC V 1
TCM : calcul mental Emptypar Klaus Aujourd'hui à 9:53

» Je teste PANORAMIC V 1 beta 1
TCM : calcul mental Emptypar Klaus Aujourd'hui à 9:52

» bouton dans autre form que 0
TCM : calcul mental Emptypar leclode Hier à 13:59

» KGF_dll - nouvelles versions
TCM : calcul mental Emptypar Klaus Hier à 11:41

» Gestion d'un système client-serveur.
TCM : calcul mental Emptypar Klaus Hier à 10:23

» Editeur EliP 6 : Le Tiny éditeur avec 25 onglets de travail
TCM : calcul mental Emptypar Froggy One Jeu 2 Mai 2024 - 11:16

» @Jack
TCM : calcul mental Emptypar Jack Mar 30 Avr 2024 - 20:40

» trop de fichiers en cours
TCM : calcul mental Emptypar papydall Lun 29 Avr 2024 - 23:39

» Une calculatrice en une ligne de programme
TCM : calcul mental Emptypar jean_debord Dim 28 Avr 2024 - 8:47

» Form(résolu)
TCM : calcul mental Emptypar leclode Sam 27 Avr 2024 - 17:59

» Bataille navale SM
TCM : calcul mental Emptypar jjn4 Ven 26 Avr 2024 - 17:39

» Les maths du crocodile
TCM : calcul mental Emptypar jean_debord Jeu 25 Avr 2024 - 10:37

» Naissance de Crocodile Basic
TCM : calcul mental Emptypar jean_debord Jeu 25 Avr 2024 - 8:45

» Dessine-moi une galaxie
TCM : calcul mental Emptypar jjn4 Lun 22 Avr 2024 - 13:47

» Erreur END_SUB
TCM : calcul mental Emptypar jjn4 Lun 22 Avr 2024 - 13:43

Navigation
 Portail
 Index
 Membres
 Profil
 FAQ
 Rechercher
Rechercher
 
 

Résultats par :
 
Rechercher Recherche avancée
Mai 2024
LunMarMerJeuVenSamDim
  12345
6789101112
13141516171819
20212223242526
2728293031  
CalendrierCalendrier
Le deal à ne pas rater :
Réassort du coffret Pokémon 151 Électhor-ex : où l’acheter ?
Voir le deal

 

 TCM : calcul mental

Aller en bas 
3 participants
AuteurMessage
mimic

mimic


Nombre de messages : 103
Localisation : france
Date d'inscription : 02/09/2009

TCM : calcul mental Empty
MessageSujet: TCM : calcul mental   TCM : calcul mental EmptyJeu 5 Fév 2015 - 11:41

Bonjour,

Voici un petit programme (vite fait) pour s’entrainer au calcul mental (4 opérations de base sur des entiers).

Pour lancer un test, cliquez  sur « continuer ».

Pour valider la réponse, avant le temps imparti, cliquez sur « valider ».
Code:
caption 0,"TCM v0.1 : Un peu de calcul mental/manuel ?"
memo 1
alpha 4
label nbproc,temps,suite,mulonz,susdnb,monn,adddnb,mulpnb,mulnbdc
label test,div9,divm,divdnb,valid,divdnbr,div9r
dim niv%,res,n,pos%,tps%,bres,d,sw,lg%,id
dim txt$

color 0,84,195,184
height 0,250
width 0,400
left 4,150
top 4,135
progress_bar 2
timer 3
timer_interval 3,1000
min 2,0
max 2,100
left 2,200
edit 5
button 6
caption 6,"Continuer"
top 5,110
top 6,180
left 6,120
spin 7
left 7,200
top 7,40
min 7,1
max 7,12
position 7,1
spin 8
left 8,200
top 8,100
min 8,1
max 8,9
position 8,1
alpha 9
left 9,200
top 9,25
caption 9, "TEST n° : "
alpha 10
left 10,200
top 10,85
button 11
top 11,180
left 11,200
caption 11,"valider"
edit 12
top 12,160
alpha 13
top 13,90
caption 13,"Votre réponse :"
alpha 14
top 14,142
caption 14, "Le reste :"
alpha 15
top 15,155
left 15,150
caption 15, ""
caption 10, "NIVEAU n° : "
input_source_is 5
font_size 1,14
font_size 5,14
font_size 7,14
font_size 8,14
font_size 4,14
font_size 12,14
font_size 15,14
font_color 4,213,20,5
font_color 15,213,20,5
on_click 6,suite
on_click 11,valid
end
suite:
inactive 6
hide 15
if position(7)<11
 hide 14
 hide 12
end_if
niv%=position(8)
caption 4,""
position 2,0
if niv%<1 then niv%=1
if niv%>9 then niv%=9
text 1,str$(niv%)
txt$="0"
pos%=0
tps%=8000
gosub test
on_timer 3,temps
timer_on 3
end

test:
id=position(7)
select id
 case 6:gosub monn
 case 7:gosub nbproc
 case 3:gosub mulonz
 case 2:gosub susdnb
 case 5:gosub div9
 case 1:gosub adddnb
 case 4:gosub mulpnb
 case 8:gosub mulnbdc
 case 9:gosub divm
 case 10:gosub divdnb
 case 11:gosub div9r
 case 12:gosub divdnbr
end_select
return


nbproc:
rem multiplication nombre proche
n=power(10,niv%)+int(power(10,niv%-1)*rnd(1))
sw=int(8*rnd(1))+1
n=n*sw
d=power(10,niv%)+int(power(10,niv%-1)*rnd(1))
d=d*sw
bres=d*n
text 1,str$(n)+" * "+str$(d)+"=?"
 txt$=text$(1)
 lg%=len(txt$)
 tps%=1000*lg%*10
return

mulonz:
 rem multiplication par onze
 n=power(10,niv%)+int(power(10,niv%)*rnd(1))
 bres=11*n
 text 1,str$(n)+" * 11 =?"
 txt$=text$(1)
 lg%=len(txt$)
 tps%=1000*lg%*6
return

susdnb:
rem soustraire 2 nombres
n=int(power(10,niv%+1)*rnd(1))
d=int(power(10,niv%+1)*rnd(1))
if n<d
sw=n
n=d
d=sw
end_if
bres=n-d
text 1,str$(n)+" - "+str$(d)+"=?"
 txt$=text$(1)
 lg%=len(txt$)
 tps%=1000*lg%*5
return

monn:
rem rendu monnaie
n=int(9*rnd(1))+1
d=power(10,niv%)
n=n*d
d=int(power(10,niv%+1)*rnd(1))
d=d/10
bres=n-d
text 1,str$(n)+" - "+str$(d)+"=?"
 txt$=text$(1)
 lg%=len(txt$)
 tps%=1000*lg%*5
return

adddnb:
rem addition 2 nombres
n=int(power(10,niv%+1)*rnd(1))
d=int(power(10,niv%+1)*rnd(1))
if n<d
sw=n
n=d
d=sw
end_if
bres=n+d
text 1,str$(n)+" + "+str$(d)+"=?"
 txt$=text$(1)
 lg%=len(txt$)
 tps%=1000*lg%*5
return

mulpnb:
 rem multiplication par chiffres
 n=power(10,niv%)+int(power(10,niv%)*rnd(1))
 d=int(11*rnd(1))+2
 bres=d*n
 text 1,str$(n)+" * "+str$(d)+"=?"
 txt$=text$(1)
 lg%=len(txt$)
 tps%=1000*lg%*7
return

mulnbdc:
rem multiplier nombre deux chiffres
n=power(10,niv%)+int(power(10,niv%)*rnd(1))
d=int(100*rnd(1))+2
 bres=d*n
 text 1,str$(n)+" * "+str$(d)+"=?"
 txt$=text$(1)
 lg%=len(txt$)
 tps%=1000*lg%*8
return

div9:
rem diviser par 9
 n=power(10,niv%)+int(power(10,niv%+1)*rnd(1))
 bres=int(n/9)
 n=9*bres
 text 1,str$(n)+" / 9 =?"
 txt$=text$(1)
 lg%=len(txt$)
 tps%=1000*lg%*9
return

divm:
rem division entiere
 n=power(10,niv%)+int(power(10,niv%-1)*rnd(1))
 d=int(11*rnd(1))+2
 bres=int(n/d)
 n=bres*d
 text 1,str$(n)+" / "+str$(d)+" =?"
 txt$=text$(1)
 lg%=len(txt$)
 tps%=1000*lg%*10
return

divdnb:
rem division 2 nombres
 n=power(10,niv%)+int(power(10,niv%-1)*rnd(1))
 d=int(power(10,niv%-1)*rnd(1))+2
 bres=int(n/d)
 n=bres*d
 text 1,str$(n)+" / "+str$(d)+" =?"
 txt$=text$(1)
 lg%=len(txt$)
 tps%=1000*lg%*11
 return

divdnbr:
rem division 2 nombres avec reste
 n=power(10,niv%)+int(power(10,niv%)*rnd(1))
 d=int(power(10,niv%-1)*rnd(1))+2
 bres=int(n/d)
 res=n-d*bres
 text 1,str$(n)+" / "+str$(d)+" =?"
 txt$=text$(1)
 lg%=len(txt$)
 txt$=text$(1)
 txt$=txt$+chr$(13)+" indiquez le quotient et le reste"
 text 1,txt$
 tps%=1000*lg%*12
 return

div9r:
rem diviser par 9
 n=power(10,niv%)+int(power(10,niv%+1)*rnd(1))
 bres=int(n/9)
 res=n-9*bres
 text 1,str$(n)+" / 9 =?"
 txt$=text$(1)
 lg%=len(txt$)
 txt$=txt$+chr$(13)+" indiquez le quotient et le reste"
 text 1,txt$
 tps%=1000*lg%*10
return

valid:
pos%=tps%
active 6
show 12
active 12
return

temps:
pos%=pos%+1000
position 2,int(100*pos%/tps%)
if pos%>=tps%
timer_off 3
if id<11
res=0
txt$=text$(5)+str$(res)
else
txt$=text$(5)+text$(12)
end_if
if txt$=str$(bres)+str$(res)
 caption 4,"BRAVO !!!"
 niv%=niv%+1
else
 caption 4,"Non ! "+ str$(bres)
 if id>=11
  caption 15,"Reste : "+str$(res)
  show 15
 end_if
 niv%=niv%-1
end_if
text 5,""
text 12,""
position 8,niv%
active 6
show 12
show 14
active 12
end_if

Revenir en haut Aller en bas
Jicehel

Jicehel


Nombre de messages : 5947
Age : 51
Localisation : 77500
Date d'inscription : 18/04/2011

TCM : calcul mental Empty
MessageSujet: Re: TCM : calcul mental   TCM : calcul mental EmptyJeu 5 Fév 2015 - 14:06

Sympatique ton programme. Je n'ai pas la dernière version de Panoramic d'installée sur cette machine, alors j'avais des messages d'ereurs.

Je te mets ci dessous ma version qui change les type d'objets pour qu'ils correspondent aux captions et edits.

Code:
label nbproc,temps,suite,mulonz,susdnb,monn,adddnb,mulpnb,mulnbdc
label test,div9,divm,divdnb,valid,divdnbr,div9r

dim niv%,res,n,pos%,tps%,bres,d,sw,lg%,id, txt$

color 0,84,195,184: height 0,250 : width 0,400
caption 0,"TCM v0.1 : Un peu de calcul mental/manuel ?"
alpha 1 : font_size 1,14
alpha 4:  left 4,150: top 4,135 : font_size 4,14 : font_color 4,213,20,5
progress_bar 2 : min 2,0 : max 2,100 : left 2,200
timer 3 : timer_interval 3,1000
edit 5 : top 5,110 : font_size 5,14
button 6 : caption 6,"Continuer" : top 6,180 : left 6,140
spin 7 : left 7,200 : top 7,40  : min 7,1 : max 7,12 : position 7,1 : font_size 7,14
spin 8 : left 8,200 : top 8,100 : min 8,1 : max 8,9  : position 8,1 : font_size 8,14
alpha 9 : left 9,200 : top 9,25 : caption 9, "TEST n° : "
alpha 10 : left 10,200 : top 10,85 : caption 10, "NIVEAU n° : "
button 11 : top 11,180 : left 11,220 : caption 11,"valider"
edit 12 : top 12,160 : font_size 12,14
alpha 13 : top 13,90 : caption 13,"Votre réponse :"
alpha 14 : top 14,142 : caption 14, "Le reste :"
alpha 15 : top 15,155 : left 15,150 : caption 15, "" : font_size 15,14
font_color 15,213,20,5
input_source_is 5
on_click 6,suite
on_click 11,valid
end

suite:
inactive 6
hide 15
if position(7)<11
 hide 14
 hide 12
end_if
niv%=position(8)
caption 4,""
position 2,0
if niv%<1 then niv%=1
if niv%>9 then niv%=9
caption 1,str$(niv%)
txt$="0"
pos%=0
tps%=8000
gosub test
on_timer 3,temps
timer_on 3
end

test:
id=position(7)
select id
 case 6:gosub monn
 case 7:gosub nbproc
 case 3:gosub mulonz
 case 2:gosub susdnb
 case 5:gosub div9
 case 1:gosub adddnb
 case 4:gosub mulpnb
 case 8:gosub mulnbdc
 case 9:gosub divm
 case 10:gosub divdnb
 case 11:gosub div9r
 case 12:gosub divdnbr
end_select
return


nbproc:
rem multiplication nombre proche
n=power(10,niv%)+int(power(10,niv%-1)*rnd(1))
sw=int(8*rnd(1))+1
n=n*sw
d=power(10,niv%)+int(power(10,niv%-1)*rnd(1))
d=d*sw
bres=d*n
caption 1,str$(n)+" * "+str$(d)+"=?"
 txt$=caption$(1)
 lg%=len(txt$)
 tps%=1000*lg%*10
return

mulonz:
 rem multiplication par onze
 n=power(10,niv%)+int(power(10,niv%)*rnd(1))
 bres=11*n
 caption 1,str$(n)+" * 11 =?"
 txt$=caption$(1)
 lg%=len(txt$)
 tps%=1000*lg%*6
return

susdnb:
rem soustraire 2 nombres
n=int(power(10,niv%+1)*rnd(1))
d=int(power(10,niv%+1)*rnd(1))
if n<d
sw=n
n=d
d=sw
end_if
bres=n-d
caption 1,str$(n)+" - "+str$(d)+"=?"
 txt$=caption$(1)
 lg%=len(txt$)
 tps%=1000*lg%*5
return

monn:
rem rendu monnaie
n=int(9*rnd(1))+1
d=power(10,niv%)
n=n*d
d=int(power(10,niv%+1)*rnd(1))
d=d/10
bres=n-d
caption 1,str$(n)+" - "+str$(d)+"=?"
 txt$=caption$(1)
 lg%=len(txt$)
 tps%=1000*lg%*5
return

adddnb:
rem addition 2 nombres
n=int(power(10,niv%+1)*rnd(1))
d=int(power(10,niv%+1)*rnd(1))
if n<d
sw=n
n=d
d=sw
end_if
bres=n+d
caption 1,str$(n)+" + "+str$(d)+"=?"
 txt$=caption$(1)
 lg%=len(txt$)
 tps%=1000*lg%*5
return

mulpnb:
 rem multiplication par chiffres
 n=power(10,niv%)+int(power(10,niv%)*rnd(1))
 d=int(11*rnd(1))+2
 bres=d*n
 caption 1,str$(n)+" * "+str$(d)+"=?"
 txt$=caption$(1)
 lg%=len(txt$)
 tps%=1000*lg%*7
return

mulnbdc:
rem multiplier nombre deux chiffres
n=power(10,niv%)+int(power(10,niv%)*rnd(1))
d=int(100*rnd(1))+2
 bres=d*n
 caption 1,str$(n)+" * "+str$(d)+"=?"
 txt$=caption$(1)
 lg%=len(txt$)
 tps%=1000*lg%*8
return

div9:
rem diviser par 9
 n=power(10,niv%)+int(power(10,niv%+1)*rnd(1))
 bres=int(n/9)
 n=9*bres
 caption 1,str$(n)+" / 9 =?"
 txt$=caption$(1)
 lg%=len(txt$)
 tps%=1000*lg%*9
return

divm:
rem division entiere
 n=power(10,niv%)+int(power(10,niv%-1)*rnd(1))
 d=int(11*rnd(1))+2
 bres=int(n/d)
 n=bres*d
 caption 1,str$(n)+" / "+str$(d)+" =?"
 txt$=caption$(1)
 lg%=len(txt$)
 tps%=1000*lg%*10
return

divdnb:
rem division 2 nombres
 n=power(10,niv%)+int(power(10,niv%-1)*rnd(1))
 d=int(power(10,niv%-1)*rnd(1))+2
 bres=int(n/d)
 n=bres*d
 caption 1,str$(n)+" / "+str$(d)+" =?"
 txt$=caption$(1)
 lg%=len(txt$)
 tps%=1000*lg%*11
 return

divdnbr:
rem division 2 nombres avec reste
 n=power(10,niv%)+int(power(10,niv%)*rnd(1))
 d=int(power(10,niv%-1)*rnd(1))+2
 bres=int(n/d)
 res=n-d*bres
 caption 1,str$(n)+" / "+str$(d)+" =?"
 txt$=caption$(1)
 lg%=len(txt$)
 txt$=caption$(1)
 txt$=txt$+chr$(13)+" indiquez le quotient et le reste"
 caption 1,txt$
 tps%=1000*lg%*12
 return

div9r:
rem diviser par 9
 n=power(10,niv%)+int(power(10,niv%+1)*rnd(1))
 bres=int(n/9)
 res=n-9*bres
 caption 1,str$(n)+" / 9 =?"
 txt$=caption$(1)
 lg%=len(txt$)
 txt$=txt$+chr$(13)+" indiquez le quotient et le reste"
 caption 1,txt$
 tps%=1000*lg%*10
return

valid:
pos%=tps%
active 6
show 12
active 12
return

temps:
pos%=pos%+1000
position 2,int(100*pos%/tps%)
if pos%>=tps%
  timer_off 3
  if id<11
    res=0
    txt$=text$(5)+str$(res)
  else
    txt$=text$(5)+text$(12)
  end_if
  if txt$=str$(bres)+str$(res)
    caption 4,"BRAVO !!!"
    niv%=niv%+1
  else
    caption 4,"Non ! "+ str$(bres)
    if id>=11
      caption 15,"Reste : "+str$(res)
      show 15
    end_if
    niv%=niv%-1
  end_if
  text 5,""
  text 12,""
  position 8,niv%
  active 6
  show 12
  show 14
  active 12
end_if
Revenir en haut Aller en bas
mimic

mimic


Nombre de messages : 103
Localisation : france
Date d'inscription : 02/09/2009

TCM : calcul mental Empty
MessageSujet: Re: TCM : calcul mental   TCM : calcul mental EmptyVen 6 Fév 2015 - 12:04

Merci, pour cette petite refonte du code.

Ps : une précision, chaque test correspond grosso modo à une méthode de résolution (tirée d’un livre) ; pour le temps imparti par contre, c’est au pif !
Revenir en haut Aller en bas
Jean Claude

Jean Claude


Nombre de messages : 5948
Age : 69
Localisation : 83 Var
Date d'inscription : 07/05/2009

TCM : calcul mental Empty
MessageSujet: Re: TCM : calcul mental   TCM : calcul mental EmptyVen 6 Fév 2015 - 12:35

Je suis consterné, j'arrive seulement au niveau 4 et pourtant ce se sont que des additions. Embarassed

Pour moi le jeu à fonctionné d'entrée, avec la dernière version de Panoramic.

A+
Revenir en haut Aller en bas
Jicehel

Jicehel


Nombre de messages : 5947
Age : 51
Localisation : 77500
Date d'inscription : 18/04/2011

TCM : calcul mental Empty
MessageSujet: Re: TCM : calcul mental   TCM : calcul mental EmptyVen 6 Fév 2015 - 13:15

A priori, pour simplifier, Jack a dû tolérer text à la place de caption et caption$ à la place de text$ et réciproquement. Ca ne me gène absolument pas. C'est vrai que c'est mieux de simplifier mais bon pour les versions antérieures, ça ne fonctionnait pas sans les modifs.
Revenir en haut Aller en bas
Contenu sponsorisé





TCM : calcul mental Empty
MessageSujet: Re: TCM : calcul mental   TCM : calcul mental Empty

Revenir en haut Aller en bas
 
TCM : calcul mental
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» Calcul du jour de Pâques
» Calcul de l'indice Humidex
» Calcul de la trajectoire d’un projectile
» Calcul du format d'une image
» Calcul CRC pour Modbus RTU

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC :: PANORAMIC :: Vos sources, vos utilitaires à partager-
Sauter vers: