Les membres ayant 30 points peuvent parler sur les canaux annonces, projets et hs du chat.
La shoutbox n'est pas chargée par défaut pour des raisons de performances. Cliquez pour charger.

Forum Casio - Autres questions


Index du Forum » Autres questions » Saisi de phrase
Ti.du.du39 Hors ligne Membre de CreativeCalc Points: 1290 Défis: 0 Message

Saisi de phrase

Posté le 30/01/2015 17:59

Bonjour
J'utilise tout le temps la saisie de valeur (nombres)
mais j'aimerais savoir si il est possible de faire un programme ou on peut rentrer une égalité, une formule a développer, factoriser, une phrase, etc... ?
Je sais que sur certain logiciel de programmation , cela est possible (scilab)
Ma prof de maths m'a dit que l'on pouvait rentrer des listes, sa aussi, sa pourrait m’être utile si je savais comment faire

Merci d'avance a tous ceux qui me répondront :)


Lephenixnoir Hors ligne Administrateur Points: 24145 Défis: 170 Message

Citer : Posté le 30/01/2015 18:02 | #


Pour entrer du texte il suffit d'utiliser Str en sortie de l'opérateur '?'
?→Str 1

Par contre toutes les machines n'ont pas les Str.
Mon graphe (24 Mars): (gint#27 ; (Rogue Life || HH2) ; PythonExtra ; serial gint ; Boson X ; ...) || (shoutbox v5 ; v5)
Ti.du.du39 Hors ligne Membre de CreativeCalc Points: 1290 Défis: 0 Message

Citer : Posté le 30/01/2015 18:04 | #


je suis sur graph 35+ USB et pour traiter cette information ?
" L'Homme prouve son intelligence en innovant dans la connerie "
Lephenixnoir Hors ligne Administrateur Points: 24145 Défis: 170 Message

Citer : Posté le 30/01/2015 18:08 | #


Alors tu dois avoir, encore que ça doit dépendre de ta version d'OS. Pour l'utiliser, ensuite... les fonctions Str sont dans le menu PRGM. Mais je crois que sera plus simple pour toi si je te renvoie sur le tutoriel de Totoyo
Mon graphe (24 Mars): (gint#27 ; (Rogue Life || HH2) ; PythonExtra ; serial gint ; Boson X ; ...) || (shoutbox v5 ; v5)
Ti.du.du39 Hors ligne Membre de CreativeCalc Points: 1290 Défis: 0 Message

Citer : Posté le 30/01/2015 18:08 | #


ok merci

Ajouté le 13/02/2015 à 22:02 :
le tutoriel de totoyo est très bien mais il ne dit pas comment "décomposer" une phrase, par exemple, pour le code de CÉSAR, on doit bien isoler chacune des "lettres" pour les traiter, ou il existe une autre possibilités pour réaliser sa ?
" L'Homme prouve son intelligence en innovant dans la connerie "
Alphacreator Hors ligne Membre Points: 1464 Défis: 43 Message

Citer : Posté le 13/02/2015 22:20 | #


SI tu veux isoler un caractère, utilise strMid(
(je ne souviens plus trop de la syntaxe, mais ça devrait être du genre strMid(str, 1, pos) avec pos la position du caractère dans ta chaîne)
Dark storm Hors ligne Labélisateur Points: 11631 Défis: 176 Message

Citer : Posté le 13/02/2015 22:22 | #


Avec StrMid(chaîne, position, longueur) tu peux découper ta chaîne.
Exemple pour récupérer le 4ème caractère d'une chaîne :
StrMid(Str 1, 4, 1)->Str 2

Finir est souvent bien plus difficile que commencer. — Jack Beauregard
Ti.du.du39 Hors ligne Membre de CreativeCalc Points: 1290 Défis: 0 Message

Citer : Posté le 13/02/2015 22:25 | #


ok merci , et pour un code CESAR, c'est une bonne piste les str ?
" L'Homme prouve son intelligence en innovant dans la connerie "
Legolas Hors ligne Ancien rédacteur Points: 3266 Défis: 104 Message

Citer : Posté le 13/02/2015 22:25 | #


C'est un passage obligé.
Mes programmes
Cacher les programmes
Mes défis
Cacher les défis



Ti.du.du39 Hors ligne Membre de CreativeCalc Points: 1290 Défis: 0 Message

Citer : Posté le 13/02/2015 22:27 | #


mais je ne vois pas comment je pourrai les modifier pour faire un code CESAR
" L'Homme prouve son intelligence en innovant dans la connerie "
Dark storm Hors ligne Labélisateur Points: 11631 Défis: 176 Message

Citer : Posté le 13/02/2015 22:43 | #


Je suis sympa, je te met l'algo

Entrer la string à coder
Créer une string vide (celle codée)

Pour chaque caractère de la chaine :
    Le remplacer par un autre
    Ajouter le résultat à la chaine codée

[u]Pour changer un caractère :[/u]
"ABCDEF..." -> Str 20
StrSrc(Str 20, caractere) -> Valeur non codée (VNC)
(VNC + décalage) modulo 26 -> Valeur codée (VC)
StrMid(Str 20, VC, 1) -> Caractère codé


Il te reste à programmer le tout, à optimiser un peu, et à gérer le reste (espaces, ponctuation, etc)
Finir est souvent bien plus difficile que commencer. — Jack Beauregard
Ti.du.du39 Hors ligne Membre de CreativeCalc Points: 1290 Défis: 0 Message

Citer : Posté le 13/02/2015 22:50 | #


Merci , je fais me lancer sauf que, si je comprend ce que tu m'a envoyer, il faut initialiser chaque lettre avec une valeur ( 1→A 2→B 3→C etc... ) ?
" L'Homme prouve son intelligence en innovant dans la connerie "
Dark storm Hors ligne Labélisateur Points: 11631 Défis: 176 Message

Citer : Posté le 13/02/2015 22:55 | #


Non, c'est ce que fait le StrSrc (String Search) : il converti un caractère en nombre (sa position dans la chaine). Sachant que les lettres sont dans l'ordre, t'obtient A->1, B->2, etc.
Finir est souvent bien plus difficile que commencer. — Jack Beauregard
Ti.du.du39 Hors ligne Membre de CreativeCalc Points: 1290 Défis: 0 Message

Citer : Posté le 13/02/2015 23:04 | #


donc il faut d'abord enregistrer une chaine avec l'alphabet ?
" L'Homme prouve son intelligence en innovant dans la connerie "
Dark storm Hors ligne Labélisateur Points: 11631 Défis: 176 Message

Citer : Posté le 13/02/2015 23:05 | #


Ben c'est le rôle de "ABCEDEFGH..." -> Str 20
Je te le met pas en entier, ça devrait aller non ?
Finir est souvent bien plus difficile que commencer. — Jack Beauregard
Ti.du.du39 Hors ligne Membre de CreativeCalc Points: 1290 Défis: 0 Message

Citer : Posté le 13/02/2015 23:06 | #


ah oui, je ne l'avait pas vu merci

Ajouté le 15/02/2015 à 18:25 :
c'est normal que :
If Strmid(Str 1,I,1)=" "
Then...

affiche une erreur syntax ?
" L'Homme prouve son intelligence en innovant dans la connerie "
Dark storm Hors ligne Labélisateur Points: 11631 Défis: 176 Message

Citer : Posté le 15/02/2015 18:28 | #


Oui, la comparaison de chaînes avec = ne marche pas. Faut utiliser StrCmp(). Cf la liste des fonctions Basic pour connaître les valeurs de retour
Finir est souvent bien plus difficile que commencer. — Jack Beauregard
Ti.du.du39 Hors ligne Membre de CreativeCalc Points: 1290 Défis: 0 Message

Citer : Posté le 15/02/2015 18:31 | #


donc sa donne :
If StrCmp(Strmid(Str 1,I,1)," ")=0
Then...

merci
" L'Homme prouve son intelligence en innovant dans la connerie "
Dark storm Hors ligne Labélisateur Points: 11631 Défis: 176 Message

Citer : Posté le 15/02/2015 18:37 | #


En gros c'est ça. Je te fais confiance pour la valeur, je ne la connaît pas par cœur. C'est là où les strings deviennent assez lourdes à utiliser : ça prend plein de ligne. Mais c'est hyper puissant et ça prend pas tant de place que ça en mémoire.
Finir est souvent bien plus difficile que commencer. — Jack Beauregard
Ti.du.du39 Hors ligne Membre de CreativeCalc Points: 1290 Défis: 0 Message

Citer : Posté le 15/02/2015 18:48 | # | Fichier joint


http://www.planet-casio.com/Fr/reference_basic_casio/commande_basic.php?fonc=111
toujours citer les sources

Edit

J'ai réaliser le programme comme tu m'a dit mais cela ne marche pas, si un membre peut corriger mes erreurs, j'en serai ravi merci d'avance (en pièce-jointe)

code
Cliquer pour enrouler
[red]Lbl[/red] U
0ãD
BG-None
[brown]ClrGraph[/brown]
[brown]ViewWindow[/brown] [maroon]1[/maroon],[maroon]127[/maroon],[maroon]0[/maroon],[maroon]1[/maroon],[maroon]63[/maroon],[maroon]0[/maroon]
[b][brown]Text[/brown][/b] [maroon]1[/maroon],[maroon]1[/maroon],[gray]"Coder ã [maroon]1[/maroon]"[/gray]
[b][brown]Text[/brown][/b] [maroon]7[/maroon],[maroon]1[/maroon],[gray]"Decoder ã [maroon]2[/maroon]"[/gray]
[b][brown]Text[/brown][/b] [maroon]13[/maroon],[maroon]1[/maroon],"Changer l[green]'alphabet ã [maroon]3[/maroon][/green]
[red]Lbl[/red] M
[green]'  ALPHABET  [/green]
[b][blue]If[/blue][/b] Getkey=[maroon]52[/maroon]
[b][blue]Then[/blue][/b]
[red]Lbl[/red] S
BG-None
[brown]ClrGraph[/brown]
[brown]ViewWindow[/brown] [maroon]1[/maroon],[maroon]127[/maroon],[maroon]0[/maroon],[maroon]1[/maroon],[maroon]63[/maroon],[maroon]0[/maroon]
[b][brown]Text[/brown][/b] [maroon]1[/maroon],[maroon]1[/maroon],[gray]"Alphabet actuel"[/gray]
[b][brown]Text[/brown][/b] [maroon]7[/maroon],[maroon]1[/maroon],Str [maroon]20[/maroon]
[b][brown]Text[/brown][/b] [maroon]20[/maroon],[maroon]1[/maroon],[gray]"Changer l[green]'alphabet ã [maroon]1[/maroon]"[/gray][/green]
[b][brown]Text[/brown][/b] [maroon]26[/maroon],[maroon]1[/maroon],[gray]"Initialiser         ã [maroon]2[/maroon]"[/gray]
[red]Lbl[/red] T
[green]' ALPHABET [maroon]1[/maroon][/green]
[b][blue]If[/blue][/b] Getkey=[maroon]72[/maroon]
[b][blue]Then[/blue][/b] [gray]"Nouvel alphabet"[/gray]
[gray]"#E6931       Caractere     [maroon]26[/maroon]#E693"[/gray]
?ãStr [maroon]20[/maroon]
[red]Goto[/red] S
[b][blue]IfEnd[/blue][/b]
[green]' ALPHABET [maroon]2[/maroon][/green]
[b][blue]If[/blue][/b] Getkey=[maroon]62[/maroon]
[b][blue]Then[/blue][/b] [gray]"ABCDEFGHIJKLMNOPQRSTUVWXYZ"[/gray]ãStr [maroon]20[/maroon]
[red]Goto[/red] S
[b][blue]IfEnd[/blue][/b]
[green]' ALPHABET EXIT[/green]
[b][blue]If[/blue][/b] Getkey=[maroon]47[/maroon]
[b][blue]Then[/blue][/b]
[red]Goto[/red] U
[b][blue]IfEnd[/blue][/b]
[red]Goto[/red] T
[b][blue]IfEnd[/blue][/b]
[green]' EXIT[/green]
[b][blue]If[/blue][/b] Getkey=[maroon]47[/maroon]
[b][blue]Then[/blue][/b]
[red]Goto[/red] Z
[b][blue]IfEnd[/blue][/b]
[green]' CODE  [/green]
[b][blue]If[/blue][/b] Getkey=[maroon]72[/maroon]
[b][blue]Then[/blue][/b]
[red]Lbl[/red] X
[b][blue]If[/blue][/b] D=[maroon]1[/maroon]
[b][blue]Then[/blue][/b] [brown]ClrText[/brown]
[gray]"Message code "[/gray]?ãStr [maroon]1[/maroon]
[gray]"Cle "[/gray]?ãä
ºäãä
[red]Goto[/red] Y
[b][blue]IfEnd[/blue][/b]
[brown]ClrText[/brown]
[gray]"Message clair"[/gray]?ãStr [maroon]1[/maroon]
[gray]"Cle "[/gray]?ãä
[red]Lbl[/red] Y
[gray]""[/gray]ãStr [maroon]2[/maroon]
[b][blue]For[/blue][/b] [maroon]1[/maroon]ãI [b][blue]To[/blue][/b] StrLen(Str [maroon]1[/maroon]) [b][blue]Step[/blue][/b] [maroon]1[/maroon]
[b][blue]If[/blue][/b] StrCmp(StrMid(Str [maroon]1[/maroon],I,[maroon]1[/maroon]),[gray]" "[/gray])=[maroon]0[/maroon]
[b][blue]Then[/blue][/b] Str [maroon]2[/maroon]+[gray]" "[/gray]ãStr [maroon]2[/maroon]
[red]Goto[/red] A
[b][blue]IfEnd[/blue][/b]
[b][blue]If[/blue][/b] StrCmp(StrMid(Str [maroon]1[/maroon],I,[maroon]1[/maroon]),[gray]"."[/gray])=[maroon]0[/maroon]
[b][blue]Then[/blue][/b] Str [maroon]2[/maroon]+[gray]"."[/gray]ãStr [maroon]2[/maroon]
[red]Goto[/red] A
[b][blue]IfEnd[/blue][/b]
[b][blue]If[/blue][/b] StrCmp(StrMid(Str [maroon]1[/maroon],I,[maroon]1[/maroon]),[gray]"("[/gray])=[maroon]0[/maroon]
[b][blue]Then[/blue][/b] Str [maroon]2[/maroon]+[gray]"("[/gray]ãStr [maroon]2[/maroon]
[red]Goto[/red] A
[b][blue]IfEnd[/blue][/b]
[b][blue]If[/blue][/b] StrCmp(StrMid(Str [maroon]1[/maroon],I,[maroon]1[/maroon]),[gray]")"[/gray])=[maroon]0[/maroon]
[b][blue]Then[/blue][/b] Str [maroon]2[/maroon]+[gray]")"[/gray]ãStr [maroon]2[/maroon]
[red]Goto[/red] A
[b][blue]IfEnd[/blue][/b]
[b][blue]If[/blue][/b] StrCmp(StrMid(Str [maroon]1[/maroon],I,[maroon]1[/maroon]),[gray]","[/gray])=[maroon]0[/maroon]
[b][blue]Then[/blue][/b] Str [maroon]2[/maroon]+[gray]","[/gray]ãStr [maroon]2[/maroon]
[red]Goto[/red] A
[b][blue]IfEnd[/blue][/b]
[b][blue]If[/blue][/b] StrCmp(StrMid(Str [maroon]1[/maroon],I,[maroon]1[/maroon]),[gray]"0"[/gray])=[maroon]0[/maroon]
[b][blue]Then[/blue][/b] Str [maroon]2[/maroon]+[gray]"0"[/gray]ãStr [maroon]2[/maroon]
[red]Goto[/red] A
[b][blue]IfEnd[/blue][/b]
[b][blue]If[/blue][/b] StrCmp(StrMid(Str [maroon]1[/maroon],I,[maroon]1[/maroon]),[gray]"1"[/gray])=[maroon]0[/maroon]
[b][blue]Then[/blue][/b] Str [maroon]2[/maroon]+[gray]"1"[/gray]ãStr [maroon]2[/maroon]
[red]Goto[/red] A
[b][blue]IfEnd[/blue][/b]
[b][blue]If[/blue][/b] StrCmp(StrMid(Str [maroon]1[/maroon],I,[maroon]1[/maroon]),[gray]"2"[/gray])=[maroon]0[/maroon]
[b][blue]Then[/blue][/b] Str [maroon]2[/maroon]+[gray]"2"[/gray]ãStr [maroon]2[/maroon]
[red]Goto[/red] A
[b][blue]IfEnd[/blue][/b]
[b][blue]If[/blue][/b] StrCmp(StrMid(Str [maroon]1[/maroon],I,[maroon]1[/maroon]),[gray]"3"[/gray])=[maroon]0[/maroon]
[b][blue]Then[/blue][/b] Str [maroon]2[/maroon]+[gray]"3"[/gray]ãStr [maroon]2[/maroon]
[red]Goto[/red] A
[b][blue]IfEnd[/blue][/b]
[b][blue]If[/blue][/b] StrCmp(StrMid(Str [maroon]1[/maroon],I,[maroon]1[/maroon]),[gray]"4"[/gray])=[maroon]0[/maroon]
[b][blue]Then[/blue][/b] Str [maroon]2[/maroon]+[gray]"4"[/gray]ãStr [maroon]2[/maroon]
[red]Goto[/red] A
[b][blue]IfEnd[/blue][/b]
[b][blue]If[/blue][/b] StrCmp(StrMid(Str [maroon]1[/maroon],I,[maroon]1[/maroon]),[gray]"5"[/gray])=[maroon]0[/maroon]
[b][blue]Then[/blue][/b] Str [maroon]2[/maroon]+[gray]"5"[/gray]ãStr [maroon]2[/maroon]
[red]Goto[/red] A
[b][blue]IfEnd[/blue][/b]
[b][blue]If[/blue][/b] StrCmp(StrMid(Str [maroon]1[/maroon],I,[maroon]1[/maroon]),[gray]"6"[/gray])=[maroon]0[/maroon]
[b][blue]Then[/blue][/b] Str [maroon]2[/maroon]+[gray]"6"[/gray]ãStr [maroon]2[/maroon]
[red]Goto[/red] A
[b][blue]IfEnd[/blue][/b]
[b][blue]If[/blue][/b] StrCmp(StrMid(Str [maroon]1[/maroon],I,[maroon]1[/maroon]),[gray]"7"[/gray])=[maroon]0[/maroon]
[b][blue]Then[/blue][/b] Str [maroon]2[/maroon]+[gray]"7"[/gray]ãStr [maroon]2[/maroon]
[red]Goto[/red] A
[b][blue]IfEnd[/blue][/b]
[b][blue]If[/blue][/b] StrCmp(StrMid(Str [maroon]1[/maroon],I,[maroon]1[/maroon]),[gray]"8"[/gray])=[maroon]0[/maroon]
[b][blue]Then[/blue][/b] Str [maroon]2[/maroon]+[gray]"8"[/gray]ãStr [maroon]2[/maroon]
[red]Goto[/red] A
[b][blue]IfEnd[/blue][/b]
[b][blue]If[/blue][/b] StrCmp(StrMid(Str [maroon]1[/maroon],I,[maroon]1[/maroon]),[gray]"9"[/gray])=[maroon]0[/maroon]
[b][blue]Then[/blue][/b] Str [maroon]2[/maroon]+[gray]"9"[/gray]ãStr [maroon]2[/maroon]
[red]Goto[/red] A
[b][blue]IfEnd[/blue][/b]
StrSrc(Str [maroon]20[/maroon],StrMid(Str [maroon]1[/maroon],I,[maroon]1[/maroon]))ãA
(A+ä)ãA
[b][blue]While[/blue][/b] [maroon]0[/maroon]>A
A+26ãA
[b][blue]WhileEnd[/blue][/b]
[b][blue]While[/blue][/b] AÊ26
A-26ãA
[b][blue]WhileEnd[/blue][/b]
StrMid(Str [maroon]20[/maroon],A,[maroon]1[/maroon])ãStr [maroon]3[/maroon]
Str [maroon]2[/maroon]+Str [maroon]3[/maroon]ãStr [maroon]2[/maroon]
[red]Lbl[/red] A
[b][blue]Next[/blue][/b]
BG-None
[brown]ClrGraph[/brown]
[brown]ViewWindow[/brown] [maroon]1[/maroon],[maroon]127[/maroon],[maroon]0[/maroon],[maroon]1[/maroon],[maroon]63[/maroon],[maroon]0[/maroon]
[b][blue]If[/blue][/b] D=[maroon]1[/maroon]
[b][blue]Then[/blue][/b] [red]Goto[/red] W
[b][blue]IfEnd[/blue][/b]
[b][brown]Text[/brown][/b] [maroon]1[/maroon],[maroon]1[/maroon],[gray]"Message clair ="[/gray]
[b][brown]Text[/brown][/b] [maroon]7[/maroon],[maroon]1[/maroon],Str [maroon]1[/maroon]
[b][brown]Text[/brown][/b] [maroon]15[/maroon],[maroon]1[/maroon],[gray]"Cle de"[/gray]
[b][brown]Text[/brown][/b] [maroon]15[/maroon],[maroon]30[/maroon],ä
[b][brown]Text[/brown][/b] [maroon]23[/maroon],[maroon]1[/maroon],[gray]"Message code ="[/gray]
[b][brown]Text[/brown][/b] [maroon]29[/maroon],[maroon]1[/maroon],Str [maroon]2[/maroon]Ø
[red]Goto[/red] U
[b][blue]IfEnd[/blue][/b]
[green]' DECODE[/green]
[b][blue]If[/blue][/b] Getkey=[maroon]62[/maroon]
[b][blue]Then[/blue][/b] [maroon]1[/maroon]ãD
[gray]""[/gray]ãStr [maroon]2[/maroon]
[red]Goto[/red] X
[red]Lbl[/red] W
ºäãä
[b][brown]Text[/brown][/b] [maroon]1[/maroon],[maroon]1[/maroon],[gray]"Message code ="[/gray]
[b][brown]Text[/brown][/b] [maroon]7[/maroon],[maroon]1[/maroon],Str [maroon]1[/maroon]
[b][brown]Text[/brown][/b] [maroon]15[/maroon],[maroon]1[/maroon],[gray]"Cle de"[/gray]
[b][brown]Text[/brown][/b] [maroon]15[/maroon],[maroon]30[/maroon],ä
[b][brown]Text[/brown][/b] [maroon]23[/maroon],[maroon]1[/maroon],[gray]"Message clair ="[/gray]
[b][brown]Text[/brown][/b] [maroon]29[/maroon],[maroon]1[/maroon],Str [maroon]2[/maroon]Ø
[red]Goto[/red] U
[b][blue]IfEnd[/blue][/b]
[red]Goto[/red] N

" L'Homme prouve son intelligence en innovant dans la connerie "

LienAjouter une imageAjouter une vidéoAjouter un lien vers un profilAjouter du codeCiterAjouter un spoiler(texte affichable/masquable par un clic)Ajouter une barre de progressionItaliqueGrasSoulignéAfficher du texte barréCentréJustifiéPlus petitPlus grandPlus de smileys !
Cliquez pour épingler Cliquez pour détacher Cliquez pour fermer
Alignement de l'image: Redimensionnement de l'image (en pixel):
Afficher la liste des membres
:bow: :cool: :good: :love: ^^
:omg: :fusil: :aie: :argh: :mdr:
:boulet2: :thx: :champ: :whistle: :bounce:
valider
 :)  ;)  :D  :p
 :lol:  8)  :(  :@
 0_0  :oops:  :grr:  :E
 :O  :sry:  :mmm:  :waza:
 :'(  :here:  ^^  >:)

Σ π θ ± α β γ δ Δ σ λ
Veuillez donner la réponse en chiffre
Vous devez activer le Javascript dans votre navigateur pour pouvoir valider ce formulaire.

Si vous n'avez pas volontairement désactivé cette fonctionnalité de votre navigateur, il s'agit probablement d'un bug : contactez l'équipe de Planète Casio.

Planète Casio v4.3 © créé par Neuronix et Muelsaco 2004 - 2024 | Il y a 126 connectés | Nous contacter | Qui sommes-nous ? | Licences et remerciements

Planète Casio est un site communautaire non affilié à Casio. Toute reproduction de Planète Casio, même partielle, est interdite.
Les programmes et autres publications présentes sur Planète Casio restent la propriété de leurs auteurs et peuvent être soumis à des licences ou copyrights.
CASIO est une marque déposée par CASIO Computer Co., Ltd