Forum Liberty Basic France
• Index
Dans la série on ne sait pas quoi faire:
Code VB :
Code VB :
NOMAINWIN WindowWidth = 800: WindowHeight = 500 UpperLeftX = 100: UpperLeftY = 20 TEXTBOX #w.entr, 20 , 40, 150, 25 BUTTON #w.go, "Go !", [go], UL, 180, 40, 40, 20 TEXTBOX #w.cyc, 290 , 40, 50, 25 GRAPHICBOX #w.m 5, 5, 785, 440 MENU #w, "Help", "Expliccazziones", [explic] OPEN "Suite de Syracuse" FOR window_nf AS #w #w, "TRAPCLOSE [close]" #w.m , "down" #w.m , "fill blue; color yellow; backcolor blue" #w.entr, "!font arial 12 bold" #w.entr, "1000000": #w.cyc, "4" #w.m , "PLACE 10 20": #w.m, "\ Nombre Origine" #w.m , "PLACE 240 20": #w.m, "\ Nombre Cycles triviaux" #w.m , "flush" wait [go] #w.m , "fill blue" sto=0: x=20: y=80: conter=0 #w.entr, "!contents? var$": nombr=val(var$): dx=len(var$)*20 #w.cyc, "!contents? var$": cyc=val(var$) ' cont=nombr*2 for xx=1 to nombr*2 If nombr mod 2=0 then nombr=nombr/2 #w.m , "PLACE ";x;" ";y: #w.m, "\ ";str$(nombr): #w.m , "flush" y=y+20 if y>420 then y=80: x=x+dx: dx=(len(str$(nombr))*20) end if end if if nombr=1 then conter=conter+1 if conter=cyc then wait If nombr mod 2<>0 then nombr=nombr*3 +1 #w.m , "PLACE ";x;" ";y: #w.m, "\";str$(nombr): #w.m , "flush" y=y+20 if y>420 then y=80: x=x+dx: dx=(len(str$(nombr))*20) end if end if if nombr=1 then conter=conter+1 if conter=cyc then wait next xx wait [explic] WindowWidth = 800: WindowHeight = 243 UpperLeftX = 10: UpperLeftY = 140 GRAPHICBOX #h.m 5, 5, 785, 200 OPEN "Expliccazziones" FOR window_nf AS #h #h, "TRAPCLOSE [closeHelp]" help=1 #h.m , "down" #h.m , "fill darkblue" #h.m , "color yellow; backcolor darkblue" #h.m , "PLACE 10, 20": #h.m, "\- Soit un nombre quelconque > 1" #h.m , "PLACE 10, 40": #h.m, "\- Si il est pair on le divise par 2" #h.m , "PLACE 10, 60": #h.m, "\- Si il est impair on le multiplie par 3 et on ajoute 1" #h.m , "PLACE 10, 80": #h.m, "\- On applique le même traitement au nombre obtenu" #h.m , "PLACE 10, 100": #h.m, "\- Quel que soit le nombre d'origine on abouti " #h.m , "PLACE 10, 120": #h.m, "\- Au cycle trivial: 2 1 4 " #h.m , "PLACE 10, 140": #h.m, "\- Ceci ne pouvant être prouvé, c'est une conjecture" #h.m , "PLACE 10, 180": #h.m, "\- La fameuse CONJECTURE DE SYRACUSE" #h.m , "flush" wait [closeHelp] help=0: close #h wait [close] if help=1 then help=0: close #h CLOSE #w END
____________________
Roro
Roro
• Index
1 Utilisateur en ligne : 0 Administrateur, 0 Modérateur, 0 Membre et 1 Visiteur
Utilisateur en ligne : Aucun membre connecté
Utilisateur en ligne : Aucun membre connecté
Répondre
Vous n'êtes pas autorisé à écrire dans cette catégorie