Posté le 22/01/2026 17:50
Planète Casio v4.3 © créé par Neuronix et Muelsaco 2004 - 2026 | Il y a 137 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
Citer : Posté le 24/01/2026 11:13 | #
ah mon avis (mais n'ayant jamais fait de basic) c'est juste que 'List 1' ne veut rien dire c'est 'List1' (sans espace).
Les deux existent. Y'a des opcodes List1 à List6 (d'un seul bloc), datant de vieux modèles, et y'a l'opcode List (avec une espace) qu'on peut suivre d'un nombre pour désigner les listes 1 à 26 (sur les nouveaux modèles).
Le problème c'est surtout que la liste est trop courte, on ne peut pas étendre la longueur de la liste par une affectation. Faudrait remplacer {1}→List 1 au début par 3→Dim List 1.
Citer : Posté le 24/01/2026 17:49 | #
Le problème c'est surtout que la liste est trop courte, on ne peut pas étendre la longueur de la liste par une affectation. Faudrait remplacer {1}→List 1 au début par 3→Dim List 1.
Huh, that’s odd, the program seems to work perfectly fine for me as is. Maybe it’s an issue of models? I’m using the fx-9860GII/Graph 75, so maybe the version of Basic is older than what Slg4 is using.
I would try what Lephe’ suggests first. If that doesn’t work, try using the Catalog on your calculator to search for and input List1 if it appears. (Interestingly, I see no way to input “List” on its own on my calculator , which makes me further suspect a difference of versions.)
Edit: I can confirm that what Lephe’ suggested works perfectly on my calculator as well. I actually had no idea this technique existed. Please forgive me for my lack of programming skill.
Citer : Posté le 25/01/2026 12:56 | #
a et je cherhce aussi ca :
If J=Ans
Then "mon action"
mais avec aurte chose genre une toche precise sa marche mais pas avec ans
moi même
Citer : Posté le 25/01/2026 14:09 | #
J'ai peut être mal compris ce que tu demandais, mais "Ans" ne correspond pas à une touche, c'est une variable temporaire. Ici on ne peut pas savoir ce que va contenir Ans. Pour détecter une touche, il va falloir que tu fasses un petit programme de test pour récupérer le codes de chaque touches.
Tu peux écrire quelque chose comme :
Locate 1,1,Getkey
WhileEnd
Et ensuite tester pour récupérer le code de la touche que tu veux utiliser (attention la syntaxe n'est sûrement pas bonne, j'ai pas ma Casio sous la main et ça fait longemps que j'ai pas fait de Basic, hésitez pas à corriger si j'ai dit n'importe quoi
Et ensuite dans ta condition tu vas remplacer J=Ans par J=[le code].
Citer : Posté le 25/01/2026 14:18 | #
oui ton code marche mais moi je veux que si on appuit sur une toucher random sa continu dans la boucle If.
enfaite apres le Then je veux afficher le code de la touche avec locate 1.1."ma variable".
moi même
Citer : Posté le 25/01/2026 19:09 | #
Are you saying that you want it so that:
- The user assigns keys to actions as normal
- After assignment and when checking for key presses, if the key press matches one of actions, print text indicating the action taking
- Otherwise, print the key code of the pressed key that didn't match anything?
If this is the case, if you are building off of my code, you could probably use another variable to assist with this (I'll use "Q" to refer to this other variable). In the loop where you go through and check to see if the key press matches, you can put the line "0→Q" immediately before or after the line "GetKey→D". Then, inside each if statement (where if an action was successfully found, it prints the name of the action, like "Confirm" or "Cancel"), you can add the line "1→Q". Then, in the section after checking every action but before the loop ends and starts over, you can add these lines to check if no key was found and print the keycode if so.
Then Locate 1,1,D
IfEnd
I'll have to test this myself just to double-check, but that should be the general idea if I'm understanding what you want correctly.
Citer : Posté le 25/01/2026 19:24 | # |
Fichier joint
By the way, regarding your shoutbox message about what transfer software to use, Casio's official FA-124 software that you can download from their website should work, you just need to make sure to click Tool > Model Type > [Whatever your model is].
Here's my modified code, this works on my fx-9860GII / Graph 75. I highlighted changes from the original in bold. (Or at least I tried, the tags show up anyways. It should make it easier to see the changes anyway though.)
[b]3→Dim List1[/b]
0→B
1→D
[b]0→Q[/b]
ClrText
ClrGraph
While D≠0
GetKey→D
WhileEnd
Locate 1,1,"WHAT KEY FOR CONFIRM"
While D=0
GetKey→D
WhileEnd
D→List1[1]
ClrText
ClrGraph
While D≠0
GetKey→D
WhileEnd
Locate 1,1,"WHAT KEY FOR CANCEL"
While D=0
GetKey→D
WhileEnd
D→List1[2]
ClrText
ClrGraph
While D≠0
GetKey→D
WhileEnd
Locate 1,1,"WHAT KEY FOR JUMP"
While D=0
GetKey→D
WhileEnd
D→List1[3]
ClrText
ClrGraph
While 1
[b]0→Q[/b]
GetKey→D
If D=List1[1]
Then Locate 1,1," "
Locate 1,1,"CONFIRM"
[b]1→Q[/b]
IfEnd
If D=List1[2]
Then Locate 1,1," "
Locate 1,1,"CANCEL"
[b]1→Q[/b]
IfEnd
If D=List1[3]
Then Locate 1,1," "
Locate 1,1,"JUMP"
[b]1→Q[/b]
IfEnd
[b]If Q=0 And D≠0
Then Locate 1,1," "
Locate 1,1,D
IfEnd[/b]
WhileEnd
List1
Citer : Posté le 28/01/2026 13:18 | #
Ok rebonjour j'ai aussi besoin de savoir sa : je fais un jeu et a je cherche un moyen de faire un système de sauvegarde pour sauvegarder ma partie. si vous vous demandez les truc qui sont inclus dans une partie sont, le nombre d'objet par exemple l'objet numéro 1 sera la banane (exemple) au total il y aura 5 objet (pour le moment) et aussi les niveaux ( pas des niveaux style "mario monde 1 niveau 1 mais style, tu a gagner de l'exp , tu passe au niveau supérieur) voila c'est tout
moi même
Citer : Posté le 28/01/2026 17:01 | #
As far as I know, there’s no safe or easy way to do this in Casio Basic, this is the kind of thing is best handled by Add-ins made in one of the SDKs. However, I know of a few things you could try:
- Storing all of the variable data into set positions in a list, and reading from that list when the game is loaded. (You could also store data in a regular variable or several variables, but that’s more risky.)
- Converting game data, then clearing the screen and using PixelOn commands to write binary data to the screen, then saving the screen as a Picture; when the game is loaded, the Picture will be loaded and the data will be decoded by reading pixels from the screen.
- Using some sort of password save feature like some retro games did, where the player has to enter in a long series of characters or numbers.
Honestly, these all have their problems, so you should use caution. I’ll explain these issues in the same order I made suggestions in:
- This is by far the easiest, but it relies on using a List variable that no other program uses, which can be potentially harder since there are only 6 List variables. Still, it’s not a terrible option.
- This one is quite a bit more difficult since you need to convert all of the game data into binary, then convert it into an image (which, Pixel commands tend to be extremely and annoyingly slow). Plus, you have to make the conversion work the other way, and there’s still a risk of the image being overwritten or deleted by the user to save space.
- A password reset system is by far probably the most reliable method, since it’s up to the player to keep game data safe and to input it to their game. Of course, this poses a slight inconvenience to the user every time they need to save. (The following probably isn’t much of a concern for most games, but players could share password saves with each other, or could use an older password save to return to an earlier part of the game.)
These are the methods that I can think of immediately, but maybe there are some more creative methods you could employ. (Maybe using a less common variable type to more securely store data and reduce chances of being overwritten?)
(Also, do note that these methods could potentially be hacked and cheated by players; but let’s be honest, someone could probably just modify the program file to cheat
Citer : Posté le 28/01/2026 17:04 | #
La solution la plus commune est de mettre les données de sauvegarde dans une liste. Il faut "juste" que personne d'autre ne l'écrase... tu as 26 listes dans chaque File, donc changer de File est un choix efficace.
Tu peux aussi une matrice, une Picture comme suggéré par Prgmprotogen, ou toute autre donnée dont il est pas trop probable qu'elle se fasse écraser par accident.
Citer : Posté le 28/01/2026 17:09 | #
Pour choisir une liste sans se prendre la tête, le plus simple est d’en initialiser une avec un nom :
Ça initialisera une liste vide aux dimensions voulues, en lui attribuant un nom.
Ensuite tu peux l’utiliser comme une liste normale, via son nom et pas son id.
Cf https://www.planet-casio.com/Fr/forums/topic15260-1-tdm-n02-manipulez-les-listes-avec-adresse.html
Citer : Posté le 28/01/2026 17:18 | #
If you wanted to use the easiest method (using a List), then here’s an idea of how you could store this data.
Let’s say variables A through E represent whether you have collected each special object, with the variable being 0 for uncollected and 1 for collected.
F represents player level, and G represents player experience (you can leave G out if you don’t want experience to persist).
To store this data, you could simply do something like:
(The number in the first spot will come in handy. If you stored collected objects in a list, then you simply reference the list and positions within the list instead of variables.)
Then, when loading the game, check for a couple of things. First, check that If Dim List4 = 8 (7 if you don’t include EXP), Then If List4[1] = 1337, start loading the rest of the game data into the appropriate variables and set up the game to load the player into the appropriate situation (maybe where you start when loading a save is dependent on how many objects have been collected, or which ones).
You can change 1337 as long as it’s consistent between saving and loading; it’s just meant to act as a passcode of sorts to make sure you program is reading save data it made, and not some garbage from another program using the same List variable.
Citer : Posté le 28/01/2026 17:20 | #
This will fail if the list doesn't exist on a fresh start. The tutorial linked above by Dark Storm has tricks for naming the list (which gives it a default value) that helps detect whether the list exists or not.
Citer : Posté le 28/01/2026 17:23 | #
Oops, I should’ve refreshed before posting
@Lephe', I actually never knew about using File, that sounds a lot safer for protecting save data!
@Dark Storm, that sounds extremely useful, it’ll be practically impossible for another program to accidentally overwrite it if an adequately unique name is chosen
This will fail if the list doesn't exist on a fresh start. The tutorial linked above by Dark Storm has tricks for naming the list (which gives it a default value) that helps detect whether the list exists or not.
Oh, good point!
Citer : Posté le 07/02/2026 11:18 | #
A et aussi je veux savoir comment faire une liste qui sauvegarde des truc mais en début de programme j'ai le dim list 2 qui remet les valeurs a zero et moi je veux pas remettre à zero
moi même
Citer : Posté le 07/02/2026 11:25 | #
Tu peux demander au joueur "nouvelle partie" ou "continuer", et dans "continuer" tu lis la liste 2 sans réaffecter par Dim List 2.
Citer : Posté le 07/02/2026 11:26 | #
Oui mais quand je relance le programme je veux dire
moi même
Citer : Posté le 07/02/2026 11:28 | #
Oui les listes ne reviennent pas automatiquement à 0. Tant que ton programme ne remet pas lui-même la liste à 0 les valeurs restent, même d'une exécution à l'autre.
Citer : Posté le 07/02/2026 11:29 | #
Mais le dim remet tout a zero
moi même
Citer : Posté le 07/02/2026 11:30 | #
A mais Attends je suis pas sûr de comprendre mais je dois initialiser juste une seule fois et apres je fais en sorte de pas réinitialiser
moi même
Citer : Posté le 07/02/2026 17:03 | #
Yeah, you need to initialize the list once before you can use it for storing save data, but after that you shouldn’t modify it so you don’t overwrite save data. I think what Lephe' suggested would be best, where you have separate options for New Game and Continue. When using this system, it’s important that you don’t try to define the dimensions or contents of the list right at the start; instead, you need wait until the user has chosen one of the options. If New Game gets selected, then the list is immediately set to the standard length your save data uses (hopefully after a confirmation that the user really wants to start a new game). If Continue is selected, then the program will check to ensure the list dimensions are the appropriate size before trying to load the save data.
The only problem with this is that the program will crash if there’s no save data to load… You might be able to prevent this by naming your List with a string, as Dark Storm shows.