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 » édition code source black-jack originellement compatible à partir de la 35-35 +
Sniperking Hors ligne Membre Points: 412 Défis: 0 Message

édition code source black-jack originellement compatible à partir de la 35-35 +

Posté le 10/09/2021 18:32

j'ai transféré sur ma 25 première du nom (avec le câble sériel-pc) le jeu black-jack originellement compatible à partir de la 35-35 + avant de le transférer vers la 25 + E II avec le câble calculatrice-calculatrice et J'aimerais 2 choses : 1) que je ne quitte le programme qu'en appuyant sur F4 et pas indifféremment en appuyant sur F1 ou F4 et 2) que ça me propose de continuer ou quitter en appuyant sur l'une ou l'autre des touches de fonctions de ma 25 + E II. (F1 à F6) (F1 pour continuer et F4 pour quitter, par exemple.) Une idée de comment je peux coder cela ?

Bien à vous,

David


Précédente 1, 2, 3, 4, 5, 6, 7, 8, 9 Suivante
Lephenixnoir Hors ligne Administrateur Points: 24145 Défis: 170 Message

Citer : Posté le 22/09/2021 21:05 | #


(saut la doc de gint qui est totalement foireuse, je dois lire dans le code des headers)

(Les headers sont la doc, avec leurs défauts (c'est du code, et c'est en anglais), après y'a aussi les tutos )
Mon graphe (24 Mars): (gint#27 ; (Rogue Life || HH2) ; PythonExtra ; serial gint ; Boson X ; ...) || (shoutbox v5 ; v5)
Cakeisalie5 En ligne Ancien administrateur Points: 1896 Défis: 11 Message

Citer : Posté le 22/09/2021 21:20 | #


sont la doc la référence

Référence et documentation ne sont pas la même chose, la référence n'est qu'une partie de la documentation è_é source.

my 2 cents

Promotion ordinaire sur les inscriptions sur Planète Casio : en ce moment, c'est gratuit !

Mon blogBesoin d'utilitaires de transfert vers et depuis la calculatrice sous GNU/Linux ?
Inikiwi Hors ligne Membre Points: 550 Défis: 8 Message

Citer : Posté le 22/09/2021 21:23 | #


(Les headers sont la doc, avec leurs défauts (c'est du code, et c'est en anglais), après y'a aussi les tutos )


beau -> https://discordpy.readthedocs.io/en/stable/api.html

pas beau
//---
//    gint:display - Drawing functions
//
//    This module covers the drawing functions that are common to fx9860g and
//    fxcg50. Platform-specific definitions are found in <gint/display-fx.h>
//    and <gint/display-cg.h>.
//---

#ifndef GINT_DISPLAY
#define GINT_DISPLAY

#ifdef __cplusplus
extern "C" {
#endif

#include <gint/defs/types.h>
#include <gint/defs/call.h>

/* Platform-specific functions include VRAM management and the definition of
   the color_t type. */

#ifdef FX9860G
#include <gint/display-fx.h>
#endif

#ifdef FXCG50
#include <gint/display-cg.h>
#endif

/* TODO: dinfo() or similar */

//---
//    Video RAM management
//---

/* dupdate(): Push the video RAM to the display driver

   This function makes the contents of the VRAM visible on the screen. It is
   the equivalent of Bdisp_PutDisp_DD() in most situations.

   On fx-9860G, this function also manages the gray engine settings. When the
   gray engine is stopped, it pushes the contents of the VRAM to screen, and
   when it is on, it swaps buffer and lets the engine's timer push the VRAMs to
   screen when suitable. To make the transition between the two modes smooth,
   dgray() does not enable the gray engine immediately; instead the first call
   to update() after dgray() switches the gray engine on and off.

   On fx-CG 50, because rendering is slow and sending data to screen is also
   slow, a special mechanism known as triple buffering is implemented. Two
   VRAMs are allocated, and frames are alternately rendered on each VRAM. When
   dupdate() is called to push one of the VRAMs to screen, it starts the DMA
   (which performs the push in the background) and immediately returns after
   switching to the other VRAM so that the user can draw during the push.

   The transfer from the DMA to the screen lasts about 10 ms if memory is
   available every cycle. Each access to the memory delays the transfer by a
   bit, so to fully use the available time, try to run AIs, physics or other
   calculation-intensive code rather than using the VRAM.

   Typical running time without overclock:
   fx-9860G: 1 ms (gray engine off)
   fx-9860G: ~30% of CPU time (gray engine on)
   fx-CG 50: 11 ms */
void dupdate(void);

/* dupdate_set_hook(): Define a function to be called after each dupdate()

   This functions configures the update hook, which is called after each
   dupdate() has sent VRAM to the display (but before VRAMs are switched when
   triple-buffering is used on fx-CG 50).

   The hook is mostly useful to send a copy of the frame to another medium,
   typically through a USB connection to a projector-style application. See
   usb_fxlink_videocapture() in <gint/usb-ff-bulk.h> for an example.

   The function is an indirect call; create one with the GINT_CALL() macro from
   <gint/defs/call.h>. Pass GINT_CALL_NULL to disable the feature.

   @function  Indirect call to perform after each dupdate(). */
void dupdate_set_hook(gint_call_t function);

/* dupdate_get_hook(): Get a copy of the dupdate() hook */
gint_call_t dupdate_get_hook(void);

//---
//    Area rendering functions
//---

/* dclear(): Fill the screen with a single color

   This function clears the screen by painting all the pixels in a single
   color. It is optimized for opaque colors; on fx-CG 50, it uses dma_memset()
   to fill in the VRAM.

   Typical running time without overclock:
   fx-9860G SH3:  70 µs
   fx-9860G SH4:  15 µs
   fx-CG 50:      2.5 ms (full-screen drect() is about 6 ms)

   On fx9860g, use drect() if you need operators that modify existing pixels
   instead of replacing them such as invert.

   @color  fx-9860G: white light* dark* black
           fx-CG 50: Any R5G6B5 color

   *: When the gray engine is on, see dgray(). */
void dclear(color_t color);

/* drect(): Fill a rectangle of the screen
   This functions applies a color or an operator to a rectangle defined by two
   points (x1 y1) and (x2 y2). Both are included in the rectangle.

   @x1 @y1  Top-left rectangle corner (included)
   @x2 @y2  Bottom-right rectangle corner (included)
   @color  fx-9860G: white light* dark* black none invert lighten* darken*
           fx-CG 50: Any R5G6B5 color, C_NONE or C_INVERT

   *: When the gray engine is on, see dgray(). */
void drect(int x1, int y1, int x2, int y2, int color);

/* drect_border(): Rectangle with border
   This function draws a rectangle with an inner border. The border width must
   be smaller than half the width and half the height.

   @x1 @y1 @x2 @y2  Top-left and bottom-right rectangle corners (included)
   @fill_color      Center color (same values as drect() are allowed)
   @border_width    Amount of pixels reserved for the border on each side
   @border_color    Border color (same values as drect() are allowed) */
void drect_border(int x1, int y1, int x2, int y2,
    int fill_color, int border_width, int border_color);

//---
//    Point drawing functions
//---

/* dpixel(): Change a pixel's color

   Paints the selected pixel with an opaque color or applies an operator to a
   pixel. Setting pixels individually is a slow method for rendering. Other
   functions that draw lines, rectangles, images or text will take advantage of
   possible optimizations to make the rendering faster, so prefer using them
   when they apply.

   On fx-9860G, if an operator such as invert is used, the result will depend
   on the current color of the pixel.

   @x @y   Coordinates of the pixel to repaint
   @color  fx-9860G: white light* dark* black none invert lighten* darken*
           fx-CG 50: Any R5G6B5 color, C_NONE or C_INVERT

   *: When the gray engine is on, see dgray(). */
void dpixel(int x, int y, int color);

/* dline(): Render a straight line

   This function draws a line using a Bresenham-style algorithm. Please note
   that dline() may not render lines exactly like Bdisp_DrawLineVRAM().

   dline() has optimizations for horizontal and vertical lines. The speedup for
   horizontal lines is about x2 on fx-CG 50 and probably about x30 on fx-9860G.
   Vertical lines have a smaller speedup.

   dline() is currently not able to clip arbitrary lines without calculating
   all the pixels, so drawing a line from (-1e6,0) to (1e6,395) will work but
   will be very slow.

   @x1 @y1 @x2 @y2  Endpoints of the line (both included).
   @color           Line color (same values as dpixel() are allowed) */
void dline(int x1, int y1, int x2, int y2, int color);

/* dhline(): Full-width horizontal line
   This function draws a horizontal line from the left end of the screen to the
   right end, much like the Basic command "Horizontal".

   @y      Line number
   @color  Line color (same values as dline() are allowed) */
void dhline(int y, int color);

/* dvline(): Full-height vertical line
   This function draws a vertical line from the top end of the screen to the
   bottom end, much like the Basic command "Vertical".

   @x      Column number
   @color  Line color (same values as dline() are allowed) */
void dvline(int x, int color);

//---
//    Text rendering (topti)
//---

/* font_t: Font data encoded for topti */
typedef struct
{
    /* Font name (NUL-terminated), NULL if no title */
    char const *name;

    /* Font shape flags */
    uint bold    :1;
    uint italic  :1;
    uint serif   :1;
    uint mono    :1;
    uint         :3;
    /* Whether data is variable-length (proportional font) */
    uint prop    :1;

    /* Line height */
    uint8_t line_height;
    /* Storage height */
    uint8_t data_height;

    /* Number of Unicode blocks */
    uint8_t block_count;
    /* Number of total glyphs */
    uint32_t glyph_count;

    /* Character spacing (usually 1) */
    uint8_t char_spacing;

    uint :24;

    struct {
        /* Unicode point of first character in block */
        uint start   :20;
        /* Length of block */
        uint length  :12;
    } *blocks;

    /* Raw glyph data */
    uint32_t *data;

    union {
        /* For monospaced fonts */
        struct {
            /* Width of glyphs */
            uint16_t width;
            /* Storage size, in longwords, of each glyph */
            uint16_t storage_size;
        };
        /* For proportional fonts */
        struct {
            /* Storage index to find glyphs quickly */
            uint16_t *glyph_index;
            /* Width of each individual glyph */
            uint8_t *glyph_width;
        };
    };

} GPACKED(4) font_t;

/* dfont(): Set the default font for text rendering

   This function changes the default font for text rendering; this affects
   dtext_opt(), dtext() and the related functions. If the specified font is
   NULL, gint's default font is used instead.

   This function returns the previously configured font. Normally you want to
   restore it after you're done so as to not affect ambiant calls to text
   rendering functions. It would look like this:

     font_t const *old_font = dfont(new_font);
     // Do the text rendering...
     dfont(old_font);

   @font  Font to use for subsequent text rendering calls
   Returns the previously configured font. */
font_t const *dfont(font_t const *font);

/* dfont_default(): Get gint's default font

   On fx-9860G, the default font is a 5x7 font very close to the system's.
   On fx-CG 50, the default font is an original, proportional 8x9 font. */
font_t const *dfont_default(void);

/* dsize(): Get the width and height of rendered text

   This function computes the size that the given string would take up if
   rendered with a certain font. If you specify a NULL font, the currently
   configured font will be used; this is different from dfont(), which uses
   gint's default font when NULL is passed.

   Note that the height of each glyph is not stored in the font, only the
   maximum. Usually this is what you want because vertically-centered strings
   must have the same baseline regardless of their contents. So the height
   set by dsize() is the same for all strings and only depends on the font.

   The height is computed in constant time, and the width in linear time. If
   the third argument is NULL, this function returns in constant time.

   @str   String whose size must be evaluated
   @font  Font to use; if NULL, defaults to the current font
   @w @h  Set to the width and height of the rendered text, may be NULL */
void dsize(char const *str, font_t const *font, int *w, int *h);

/* dnsize(): Get the width and height of rendered text, with character limit

   This function is similar to dsize(), but stops after (size) bytes If
   (size < 0), there is no limit and this function is identical to dsize().

   @str   String whose size must be evaluated
   @size  Maximum number of bytes to read from (str)
   @font  Font to use; if NULL, defaults to the current font
   @w @h  Set to the width and height of the rendered text, may be NULL */
void dnsize(char const *str, int size, font_t const *font, int *w, int *h);

/* drsize(): Get width of rendered text with reverse size limit

   This function is the opposite of dnsize(). It determines how many characters
   of (str) can fit into the specified (width), and returns a pointer to the
   first character after that section. If (w) is non-NULL, it it set to the
   width of the section, which is typically a couple of pixels smaller than
   the provided limit.

   @str    String to read characters from
   @font   Font to use; if NULL, defaults to the current font
   @width  Maximum width
   @w      Set to the width of the rendered text, may be NULL
   Returns a pointer to first character that doesn't fit, or end-of-str */
char const *drsize(char const *str, font_t const *font, int width, int *w);

/* Alignment settings for dtext_opt() and dprint_opt(). Combining a vertical
   and a horizontal alignment option specifies where a given point (x,y) should
   be relative to the rendered string. */
enum {
    /* Horizontal settings: default in dtext() is DTEXT_LEFT */
    DTEXT_LEFT   = 0,
    DTEXT_CENTER = 1,
    DTEXT_RIGHT  = 2,
    /* Vertical settings: default in dtext() is DTEXT_TOP */
    DTEXT_TOP    = 0,
    DTEXT_MIDDLE = 1,
    DTEXT_BOTTOM = 2,
};

/* dtext_opt(): Display a string of text

   Draws some text in the video RAM using the font set with dfont() (or gint's
   default if no such font was set). This function has a lot of parameters,
   see dtext() for a simpler version.

   The alignment options specify where (x y) should be relative to the rendered
   string. The default is halign=DTEXT_LEFT and valign=DTEXT_TOP, which means
   that (x y) is the top-left corder of the rendered string. The different
   combinations of settings provide 9 positions of (x y) to choose from.

   On fx-9860G, due to the particular design of topti, this function performs
   drastic rendering optimizations using the line structure of the VRAM and
   renders 5 or 6 characters simultaneously.

   This is not a printf()-family function so str cannot contain formats like
   "%d" and you cannot pass additional arguments. See dprint_opt() and dprint()
   for that.

   @x @y    Coordinates of the anchor of the rendered string
   @fg @bg  Text color and background color
            fx-9860G: white light* dark* black none invert lighten* darken*
            fx-CG 50: Any R5G6B6 color, or C_NONE
   @halign  Where x should be relative to the rendered string
   @valign  Where y should be relative to the rendered string
   @str     String to display
   @size    Maximum number of bytes to display (negative for no limit) */
void dtext_opt(int x, int y, int fg, int bg, int halign, int valign,
    char const *str, int size);

/* The last parameter @size was added in gint 2.4; this macro will add it
   automatically with a value of -1 if the call is made with only 7 parameters.
   This is for backwards compatibility. */
#define dtext_opt8(x,y,fg,bg,h,v,str,sz,...) dtext_opt(x,y,fg,bg,h,v,str,sz)
#define dtext_opt(...) dtext_opt8(__VA_ARGS__, -1)

/* dtext(): Simple version of dtext_opt() with defaults
   Calls dtext_opt() with bg=C_NONE, halign=DTEXT_LEFT and valign=DTEXT_TOP. */
void dtext(int x, int y, int fg, char const *str);

/* dprint_opt(): Display a formatted string

   This function is exactly like dtext_opt(), but accepts printf-like formats
   with arguments. See <gint/std/stdio.h> for a detailed view of what this
   format supports. For example:

     dprint_opt(x, y, fg, bg, halign, valign, "A=%d B=%d", A, B); */
void dprint_opt(int x, int y, int fg, int bg, int halign, int valign,
    char const *format, ...);

/* dprint(): Simple version of dprint_op() with defaults
   Calls dprint_opt() with bg=C_NONE, halign=DTEXT_LEFT and valign=DTEXT_TOP */
void dprint(int x, int y, int fg, char const *format, ...);

//---
//    Image rendering (bopti)
//---

/* The bopti_image_t structure is platform-dependent, see <gint/display-fx.h>
   and <gint/display-cg.h> if you're curious. */

/* dimage(): Render a full image
   This function blits an image on the VRAM using gint's special format. It is
   a special case of dsubimage() where the full image is drawn with clipping.

   @x @y   Coordinates of the top-left corner of the image
   @image  Pointer to image encoded with fxconv for bopti */
void dimage(int x, int y, bopti_image_t const *image);

/* Option values for dsubimage() */
enum {
    /* No option */
    DIMAGE_NONE = 0x00,
    /* Disable clipping, ie. adjustments to the specified subrectangle and
       screen location such that any part that overflows from the image or
       the screen is ignored. Slightly faster. */
    DIMAGE_NOCLIP = 0x01,
};

/* dsubimage(): Render a section of an image
   This function blits a subrectangle [left, top, width, height] of an image on
   the VRAM. It is more general than dimage() and also provides a few options.

   @x @y           Coordinates on screen of the rendered subrectangle
   @image          Pointer to image encoded with fxconv for bopti
   @left @top      Top-left coordinates of the subrectangle within the image
   @width @height  Subrectangle dimensions
   @flags          OR-combination of DIMAGE_* flags */
void dsubimage(int x, int y, bopti_image_t const *image, int left, int top,
    int width, int height, int flags);

#ifdef __cplusplus
}
#endif

#endif /* GINT_DISPLAY */

Breizh_craft Hors ligne Modérateur Points: 1157 Défis: 7 Message

Citer : Posté le 22/09/2021 21:25 | #


Tout ce qui n’a pas une page de man complète n’a pas de doc digne de ce nom de toute façon.

La doc web c’est du bonus.

Les headers c’est le minimum syndical (qu’on me comprenne bien, c’est déjà énorme vu le temps que passe Lephé sur Gint, franchement, surtout que ses sources (enfin l’organisation, pas le code, ça je saurais pas juger) et ses headers sont très propres, y’a vraiment rien à envier à tout un tas de projets avec une plus grosse équipe et/ou audience…).
Breizh.pm – Un adminsys qui aime les galettes.
Potter360 Hors ligne Rédacteur Points: 1219 Défis: 2 Message

Citer : Posté le 22/09/2021 21:26 | #


Mais… au départ ce topic parlait de Black Jack pour dériver jusqu’à la prog d’un + ou - puis sur les headers de Gint x)
Globalement, coder. Mal, mais coder.
Inikiwi Hors ligne Membre Points: 550 Défis: 8 Message

Citer : Posté le 22/09/2021 21:29 | #


de base, ce topic c'est n'importe quoi, ça fait des jours qui la shout est spammé de message (souvent inutiles) de ce topic
mais désolé d'en rajouter un peu sur ci topic
Lephenixnoir Hors ligne Administrateur Points: 24145 Défis: 170 Message

Citer : Posté le 22/09/2021 21:30 | #


Inikiwi a écrit :
beau -> https://discordpy.readthedocs.io/en/stable/api.html

pas beau

Les heures à passer pour maintenir une pseudo-doc qui n'est que les commentaires du code avec des paillettes HTML n'en valent pas la peine

Une doc à la façon de Cake, une vraie, peut-être, mais c'est pas l'option que j'ai choisie
Mon graphe (24 Mars): (gint#27 ; (Rogue Life || HH2) ; PythonExtra ; serial gint ; Boson X ; ...) || (shoutbox v5 ; v5)
Ne0tux Hors ligne Membre d'honneur Points: 3524 Défis: 265 Message

Citer : Posté le 22/09/2021 22:35 | #


On a plus qu'à discuter du Label et des moyens de contourner le mode examen et on aura épuisé les sujets clivants sur un unique topic !

Mais le jeu (du plus ou moins) en vaut probablement la chandelle.
Mes principaux jeux : Ice Slider - CloneLab - Arkenstone

La Planète Casio est accueillante : n'hésite pas à t'inscrire pour laisser un message ou partager tes créations !
Hackcell Hors ligne Maître du Puzzle Points: 1524 Défis: 11 Message

Citer : Posté le 22/09/2021 23:14 | #


@Inikiwi c'est marrant. la doc de discordpy et celle de gint on le même type de contenue sauf que yen a une qui charge instantanément dans mon éditeur de texte préferé alors que l'autre prend de nombreuse secondes et du javascript pour péniblement s'affiché dans le plus grand gouffre à RAM de ma machine

Sur une note plus sérieuse, la doc que tu donne en exemple est trés probablement identique à celle de gint à la base et à été exporté sous ce jolie format automatiquement (fait un import discordpy suivi d'un help discordpypour voir)

Si les paillettes sont vraiment ce qui te manque les headers de lephé sont assez standardisé pour envisagé de faire de un programme qui le fait automatiquement

---Barrière anti c'est celui qui propose qui fait---
Sniperking Hors ligne Membre Points: 412 Défis: 0 Message

Citer : Posté le 23/09/2021 15:06 | #


Entre le jeu du + ou -, le morpion et le jeu du pendu, qu'est-ce qui est le plus simple à programmer ? Sois-dit en passant, j'envisage d'arrêter la programmation du + ou -... qu'en pensez-vous ?
Appelez-moi... God Usopp...
Shadow15510 Hors ligne Administrateur Points: 5498 Défis: 18 Message

Citer : Posté le 23/09/2021 16:52 | #


Que si un + ou - te décourage, tu peux arrêter la programmation tout court

Plus sérieusement, le + ou - est un incontournable. Le pendu et le morpion sont des exercices d'un niveau plus élevé que celui-ci… C'est un goût personnel mais j'ai tendance à dire que le pendu est plus dur que le morpion… m'enfin le niveau reste plus élevé qu'un + ou - dans tous les cas.
"Ce n'est pas parce que les chose sont dures que nous ne les faisons pas, c'est parce que nous ne les faisons pas qu'elles sont dures." Sénèque

Inikiwi Hors ligne Membre Points: 550 Défis: 8 Message

Citer : Posté le 23/09/2021 17:09 | #


Shadow15510 a écrit :
Que si un + ou - te décourage, tu peux arrêter la programmation tout court

Plus sérieusement, le + ou - est un incontournable. Le pendu et le morpion sont des exercices d'un niveau plus élevé que celui-ci… C'est un goût personnel mais j'ai tendance à dire que le pendu est plus dur que le morpion… m'enfin le niveau reste plus élevé qu'un + ou - dans tous les cas.

ces jeux sont super facile a coder. mais le pire avec ces jeux c'est qu'on s'en lasse après 2-10 parties: 10-15min a coder 6min de fun c'est comme Jetpack Joyride pas au nuveau du code, juste le fun de jouer
Sniperking Hors ligne Membre Points: 412 Défis: 0 Message

Citer : Posté le 23/09/2021 17:10 | #


Quel jeu, parmi les trois que je vais vous citer, avez-vous en + petit nombre ? + ou -, morpion ou pendu ?
Appelez-moi... God Usopp...
Inikiwi Hors ligne Membre Points: 550 Défis: 8 Message

Citer : Posté le 23/09/2021 17:14 | #


je propose que:
1. tu installe linux
2. tu installe un cross-compiler
3. tu installe fxsdk et gint
4. tu code un add-in
5. touche jamais au sdk de casio qui est une grosse m****

Ajouté le 23/09/2021 à 17:18 :
oh! mince j'ai oublié que ta calculatrice ne supportait pas les add-ins! par contre j'ai trouvé ca:
https://www.planet-casio.com/Fr/programmes/programme2304-1-jeu-du-ou-eltoredo-jeux-reflexion.html
Sniperking Hors ligne Membre Points: 412 Défis: 0 Message

Citer : Posté le 23/09/2021 17:25 | #


Combien de temps pour le téléchargement, l'extraction éventuelle des programmes et l'installation des programmes que tu m'as suggérés ?
Appelez-moi... God Usopp...
Inikiwi Hors ligne Membre Points: 550 Défis: 8 Message

Citer : Posté le 23/09/2021 17:27 | #


au moins 2 jours (~3-4h/jour)

mais après tu aura le meilleur pc de tout les temps
Sniperking Hors ligne Membre Points: 412 Défis: 0 Message

Citer : Posté le 23/09/2021 17:41 | #


J'installerai tout ça quand je serai chez mes parents. […]

Et sinon, pour le lien que tu m'as donné, le programme est au format .g1m donc même en le convertissant au format .g1r, je ne pourrais pas le mettre sur ma 25 + E II à cause d'un problème pendant le transfert du pc vers la 25 + E II avec le câble que j'ai depuis que j'ai la 25 première du nom, ce qui implique, pour Eltoredo, de joindre au site soit un .fxi, soit un .cat.

Modéré : évite de donner autant de détails sur ta vie privée, ce n’est pas utile et ce n’est pas prudent.
Appelez-moi... God Usopp...
Lephenixnoir Hors ligne Administrateur Points: 24145 Défis: 170 Message

Citer : Posté le 23/09/2021 17:47 | #


Inikiwi a écrit :
je propose que:
1. tu installe linux
2. tu installe un cross-compiler
3. tu installe fxsdk et gint
4. tu code un add-in
5. touche jamais au sdk de casio qui est une grosse m****

Ce n'est pas une bonne idée. Sans faire jugement de valeur (vraiment !), vus les échanges qu'il y a eu sur ce topic et l'affinité encore imparfaite de Sniperking avec les questions de programmation, ça va juste être une expérience très désagréable et franchement pas productive. Il ne m'apparaît pas réaliste que Sniperking soit familier avec Linux, ait la possibilité de réinstaller l'OS sur un des ordinateurs qu'il utilise, ou arrive à jongler efficacement en C avec les concepts qui ne sont déjà pas faciles en Basic Casio.

Personnellement je te conseille de persévérer en Basic Casio parce que tu ne t'en sors pas si mal (on voit un certain progrès dans les extraits que tu as postés, et selon les moments même dans tes questions). Aller coder des add-ins sous Linux semble vraiment trop compliqué et trop frustrant pour te le recommander.
Mon graphe (24 Mars): (gint#27 ; (Rogue Life || HH2) ; PythonExtra ; serial gint ; Boson X ; ...) || (shoutbox v5 ; v5)
Sniperking Hors ligne Membre Points: 412 Défis: 0 Message

Citer : Posté le 23/09/2021 17:50 | #


Heureusement que tu est la, Lephé !!!

Ajouté le 24/09/2021 à 15:46 :
J'ai besoin d'aide pour optimiser le code, faire en sorte que ça ne détecte que le niveau de difficulté choisi exemple : que facile, que moyen ou que difficile et pas les trois que j'envisage de programmer l'un à la suite de l'autre et programmer le mode 2 joueurs, s.v.p., merci d'avance

Ajouté le 24/09/2021 à 16:01 :
Voici ce que j'ai fait jusqu'à présent :

#Program name: &ascii_+;OU&ascii_-;
#Password: <no password>
"Choix du nombre de joueurs"
"(1=1 Joueur, 2=2 Joueurs)"? -> A
"Choix du niveau de difficulté"
"(1=Facile, 2=Moyen, 3=Difficile)"? -> B
If A = 1 And B = 1 :Then
    RanInt#(1, 50)
    0 -> C
    Do
        "Trouvez le    nombre mystère comprisentre1 et 50"
        "Votre proposition"? -> B
        If B != A :Then
            If B < A :Then
                "Plus grand"◢
            Else
                "Plus petit"◢
            IfEnd
        IfEnd
        C + 1 -> C
    LpWhile A != B
    ClrText
    "Bravo vous avez trouvéle nombre mystère en    coups"
Locate 3, 3, C


En espérant que cela puisse vous orienter dans vos conseils sur les points énoncés plus haut, O.K. ?
Appelez-moi... God Usopp...
Tituya Hors ligne Administrateur Points: 2138 Défis: 26 Message

Citer : Posté le 24/09/2021 16:23 | #


Ton code actuel n'est pas fonctionnel.
En effet tu places dans la variable A le nombre de joueur et plus tard tu vérifies si B (l'input) est égal à A (nombre de joueur).

Il te faut une variable stockant le résultat de RanInt#(1,50) pour ensuite comparer avec cette valeur.
Afin de gérer ta difficulté tu peux simplement effectuer une condition sur ton mode de jeu (B) de cette manière :

B=1⇒RanInt#(1,50)->C
B=2⇒RanInt#(1,100)->C
B=3⇒RanInt#(1,200)->C

où C est la variable contenant le nombre mystère.
Bretagne > Reste du globe
(Et de toute façon, vous pouvez pas dire le contraire)
Projet en cours : Adoranda

Mes programmes
Hésite pas à faire un test !


Zezombye Hors ligne Rédacteur Points: 1756 Défis: 13 Message

Citer : Posté le 24/09/2021 16:35 | #


Aussi bien choisir tes lettres, genre J = nb joueurs, N = nombre à deviner, I = input...
Divers jeux : Puissance 4 - Chariot Wars - Sokoban
Ecrivez vos programmes basic sur PC avec BIDE
Précédente 1, 2, 3, 4, 5, 6, 7, 8, 9 Suivante

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 85 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