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.
Menu
Calculatrices
Graph 35 à 100
Graph 25+Pro/25+E/25+E II
Graph 35+USB/75(+E)/85/95 SD
Graph 100(+)
Classpad 300/330(+)
fx-CG 10/20 (Prizm)
Classpad 400(+E)
Graph 90+E
fx-92+ SC
Liens
¤ Transférer un programme sur
sa calculatrice

¤ Vous cherchez une fonction ?
Jeux >> Graph 35+USB/75(+E)/85/95 SD >> Action/Sport >> SNKEmini
SNKEmini
Version : v4 Taille : 198 octets Ajouté le : 2019-08-22 04:57 Modifié le : 2023-11-01 03:26
Auteur et posteur :
RedcmdHors ligneMembrePoints: 380 Défis: 7 Message
Planète Casio - Jeu Casio action ou sport - SNKEmini - RedCMD - Calculatrices
Nombre de visites sur cette page : 3206
Score au progrank : 29
Pas encore de note !
Vous devez être connecté(e) pour noter (inscription).
449 téléchargements | Soumettre un test


Description en français :

C'est SNKEmini!
La taille de ce jeu est super petite. 255, 241 198 195 181 180 octets!
Il est suffisamment petit pour tenir en mode RUN•MAT!
Il n'est pas nécessaire de créer un programme en mode PRGM pour le lancer.

Essayez de voir si vous pouvez réduire cette taille (sans supprimer aucune fonctionnalité)

Cliquez pour afficher le code
Cliquer pour enrouler
ClrText
4 -> Q~Y
{7, 21 -> Dim Mat A
Mat A -> Mat B
Do
    If X = Q(Y = R :Then
        Do
            RanInt#(1, 7 -> R
            RanInt#(1, 21 -> Q
        LpWhile Mat A[R, Q
        Locate Q, R, "●"
    Else
        Mat A[W, V
        0 -> Mat A[W, V
        Locate V, W, " "
        Mat B[W, V -> W
        Ans -> V
    IfEnd
    U
    GetKey => 6 - 2MOD(GetKey, 4
    U > 3 Xor Ans > 3 => Ans -> U
    X
    Y -> T
    U > 3 => 1 + MOD(Y - U + 4, 7 -> Y
    U < 3 => 1 + MOD(X - U, 21 -> X
    Locate X, Y, "O
    X -> Mat A[T, Ans
    Y -> Mat B[T, Ans
LpWhile 0 = Mat A[Y, X

Cette version est plus grande car elle a plus de fonctionnalités
La taille est de 241 octets
Enveloppe d'écran
La 'pomme' ne se pose jamais sur le serpent
Les O sont utilisés pour le corps et la pomme est un ●
Vous ne pouvez pas vous tuer en reculant

Essayez de le rendre le plus petit possible, tout en le rendant jouable!
Cliquez pour afficher le code 181 bytes
Cliquer pour enrouler 181 bytes
ClrText
6 → Q~Y
{21, 7 → Dim Mat A
Do
    If X = Q(Y = R :Then
        RanInt#(1, 7 → R
        RanInt#(1, 21 → Q
    Else
        Mat A[V, W
        0 -> Mat A[V, W
        Locate V, W, " "
        ReP Ans → V
        ImP Ans → W
    IfEnd
    Locate Q, R, 8
    GetKey ⇒ 4GetKey Rmdr 8 → U
    X : Y → T
    U > 3 ⇒ X + U - 5 → X
    U < 3 ⇒ Y + U - 1 → Y
    Locate X, Y, 0
    X + Yi → Mat A[Ans, T
LpWhile Not Mat A[X, Y

Cliquez pour afficher le code 195 bytes
Cliquer pour enrouler 195 bytes
ClrText
6 -> Q~Y
{14, 21 -> Dim Mat A
Do
    If X = Q(Y = R :Then
        RanInt#(1, 7 -> R
        RanInt#(1, 21 -> Q
    Else
        Mat A[W, V
        0 -> Mat A[W, V
        Locate V, W, " "
        Mat A[W+7, V -> W
        Ans -> V
    IfEnd
    Locate Q, R, 8
    GetKey => 2MOD(GetKey, 4 -> U
    X
    Y -> T
    U < 3 => Y + U - 1 -> Y
    U > 3 => X + U - 5 -> X
    Locate X, Y, 0
    X -> Mat A[T, Ans
    Y -> Mat A[T+7, Ans
LpWhile Not Mat A[Y, X

Cette version a été faite pour être aussi petite que possible (tout en restant jouable)
La taille est 198 195 181 octets (180 octets si vous utilisez l'opérateur binaire Not de C.Basic ou Base Mode)
Frapper le bord de l'écran va vous tuer
Revenir sur vous-même vous tuera
Courir en toi va te tuer
Le corps est composé de 0's et la pomme est un 8

English description:

This is SNKEmini!
The size of this game is super small. 255, 214 198 195 180 Bytes!
It's small enough to fit inside RUN•MAT mode!
You don't have to make a program in PRGM mode to trun it

Try see if you can this smaller (without removing any features)

Click to show code 241bytes
Click to hide code 241bytes
ClrText
4 -> Q~Y
{7, 21 -> Dim Mat A
Mat A -> Mat B
Do
    If X = Q(Y = R :Then
        Do
            RanInt#(1, 7 -> R
            RanInt#(1, 21 -> Q
        LpWhile Mat A[R, Q
        Locate Q, R, "●"
    Else
        Mat A[W, V
        0 -> Mat A[W, V
        Locate V, W, " "
        Mat B[W, V -> W
        Ans -> V
    IfEnd
    U
    GetKey => 6 - 2MOD(GetKey, 4
    U > 3 Xor Ans > 3 => Ans -> U
    X
    Y -> T
    U > 3 => 1 + MOD(Y - U + 4, 7 -> Y
    U < 3 => 1 + MOD(X - U, 21 -> X
    Locate X, Y, "O
    X -> Mat A[T, Ans
    Y -> Mat B[T, Ans
LpWhile 0 = Mat A[Y, X

This version is bigger because it has more features
Size is 241 bytes
Screen Wrap
The 'apple' never gets placed on the Snake
O's are used for the body and the apple is a ●
You can't insta kill yourself by going backwards


Try making this as small as possible, while still keeping it playable!
Click to show code 181 bytes
Click to hide code 181 bytes
ClrText
6 → Q~Y
{21, 7 → Dim Mat A
Do
    If X = Q(Y = R :Then
        RanInt#(1, 7 → R
        RanInt#(1, 21 → Q
    Else
        Mat A[V, W
        0 -> Mat A[V, W
        Locate V, W, " "
        ReP Ans → V
        ImP Ans → W
    IfEnd
    Locate Q, R, 8
    GetKey ⇒ 4GetKey Rmdr 8 → U
    X : Y → T
    U > 3 ⇒ X + U - 5 → X
    U < 3 ⇒ Y + U - 1 → Y
    Locate X, Y, 0
    X + Yi → Mat A[Ans, T
LpWhile Not Mat A[X, Y

Click to show code 195 bytes
Click to hide code 195 bytes
ClrText
6 -> Q~Y
{14, 21 -> Dim Mat A
Do
    If X = Q(Y = R :Then
        RanInt#(1, 7 -> R
        RanInt#(1, 21 -> Q
    Else
        Mat A[W, V
        0 -> Mat A[W, V
        Locate V, W, " "
        Mat A[W+7, V -> W
        Ans -> V
    IfEnd
    Locate Q, R, 8
    GetKey => 2MOD(GetKey, 4 -> U
    X
    Y -> T
    U < 3 => Y + U - 1 -> Y
    U > 3 => X + U - 5 -> X
    Locate X, Y, 0
    X -> Mat A[T, Ans
    Y -> Mat A[T+7, Ans
LpWhile Not Mat A[Y, X

This version was made to be as small as possible (while still being playable)
Size is 198 195 181 bytes (180 bytes if you use the binary operator Not from C.Basic or Base Mode)
Hitting the edge of the screen will kill you
Going backwards on yourself will kill you
Running into yourself will kill you
The body is made of 0's and the apple is an 8


Commentaires :

Pages: Précédente | 1, 2

MilangHors ligneMembrePoints: 488 Défis: 2 Message
Posté le 22-08-2019 à 14:33 | #
ahaah !
Do
Getkey
LpWhile Ans!=27
{21,7->Dim Mat A
{21,7->Dim Mat B
1->A~Z
0->P~Q
Do
Getkey
Ans=>Ans->K
X->T
Y->U
K=38=>Dsz X
K=27=>Isz X
K=28=>Dsz Y
K=37=>Isz Y
X->Mat A[T,U
Y->Mat B[T,U
Locate X,Y,0
If X=P And Y=Q Or Not PQ
Then RanInt#(1,21->P
RanInt#(1,7->Q
Else Mat A[L,M->N
0->Mat A[L,M
Locate L,M," "
Mat B[L,M->M
N->L
IfEnd
Locate P,Q,1
LpWhile Not Mat A[X,Y

264 octets avec le titre du programme, soit 232 octets de code !
MassenaHors ligneAncien rédacteurPoints: 2219 Défis: 11 Message
Posté le 22-08-2019 à 14:57 | #
Gagnant officieux de la 1ko basic casio jam.
KikoodxHors ligneAncien labélisateurPoints: 3011 Défis: 11 Message
Posté le 22-08-2019 à 15:31 | #
Le code n'est pas parfait, et le jeu en lui-même n'est pas très original donc bon...
MassenaHors ligneAncien rédacteurPoints: 2219 Défis: 11 Message
Posté le 22-08-2019 à 17:37 | #
Si t'es pas content t'a qu'à faire un test..
RedcmdHors ligneMembrePoints: 380 Défis: 7 Message
Posté le 22-08-2019 à 22:38 | #
Lephenixnoir a écrit :
MOD(Ans,4
U ≠ MOD(Ans+2,4 ⇒ Ans→U


Only problem with that is
If GetKey outputs 0 it automatically changes direction

That and IDK how to convert the direction U to movement (changing the X & Y cords)

Kikoodx I had done that already, but because I had 3 bytes (octets) left
I used them on making it look a bit better :P
RedcmdHors ligneMembrePoints: 380 Défis: 7 Message
Posté le 24-08-2019 à 10:28 | #
I changed
Locate X, Y, "●"
Locate X, Y, "O
to
Locate X, Y, 8
Locate X, Y, 0
Suggestion from Kikoodx

I got Lephenixnoir's GetKey to direction converter to work
U
GetKey => 6 - 2MOD(GetKey, 4
U > 3 Xor Ans > 3 => Ans -> U


I also used the double matrix system from Milang
One matrix for X cords and the other for Y cords

With all that
I got SNKEmini.g1m down to 241 bytes
and SNK3m1n1.g1m to 198 bytes!
LephenixnoirEn ligneAdministrateurPoints: 24145 Défis: 170 Message
Posté le 24-08-2019 à 12:08 | #
Only problem with that is
If GetKey outputs 0 it automatically changes direction

I felt real stupid when you said that right. Good job fixing it. xD

I also used the double matrix system from Milang
One matrix for X cords and the other for Y cords

Good catch as well!

I must admit I like the turn this is taking.
RedcmdHors ligneMembrePoints: 380 Défis: 7 Message
Posté le 24-10-2023 à 00:14 | #
I was able to shave off 3 bytes
198 to 195 bytes
by removing the initialization of Mat A → Mat B (-8 bytes)
and instead just making {7, 21 -> Dim Mat A twice the size. changing 7 to 14 (+1 byte)
then just indexing +7 into Mat A
Mat B[W, V -> W to Mat A[W+7, V -> W (+2 bytes)
Y -> Mat B[T, Ans to Y -> Mat A[T+7, Ans (+2 bytes)

-8 +1 +2 +2 = 3bytes
RedcmdHors ligneMembrePoints: 380 Défis: 7 Message
Posté le 01-11-2023 à 03:51 | #
was able to shave off another 15 bytes by using complex numbers Rmdr and the binary operator Not

instead of saving X and Y separately to the matrix
X -> Mat A[T, Ans
Y -> Mat A[T+7, Ans
why not just combine them and perform one save
X + Yi → Mat A[Ans, T
+ Yi is +4 bytes
but the savings from removing the 2nd line is -12 bytes

also reading from the matrix becomes smaller
Mat A[W, V
Mat A[W+7, V -> W
Ans -> V
Rep and ImP sadly are both 2 bytes. +4bytes
but not needing to read the matrix twice gives us -9bytes
Mat A[V, W
ReP Ans → V
ImP Ans → W


A Rmdr B for postive numbers performs exactly the same as Mod(A,B)
except we don't need the comma , or ending bracket )
Rmdr and Mod are both 2 bytes each
2MOD(GetKey, 4 to 2GetKey Rmdr 8 -1 byte

yesterday I found out about the binary operator Not
not to be confused with the logical operator Not
you can obtain it via C.Basic or using an external program and extracting it from a Base Mode program (press [F2] (BASE) while creating a new basic program)
it is only 1byte compared to 2bytes. -1 byte
sadly it is noticeably much slower than the normal Not operator

+4 -12 +4 -9 -1 -1 = -15bytes saved

Pages: Précédente | 1, 2

Planète Casio v4.3 © créé par Neuronix et Muelsaco 2004 - 2024 | Il y a 129 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