Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
22 May, 2013, 22:42:46 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1]   Go Down
  Print  
Author Topic: réutiliser GDB ? -  (Read 1183 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
trotithuthur
LV1 Newcomer (Next: 20)
*
Offline Offline

Gender: Male
Last Login: 19 May, 2012, 09:47:01
Date Registered: 17 September, 2011, 20:54:21
Location: France, Chambéry
Posts: 17

Topic starter
Total Post Ratings: +3

View Profile
« on: 18 September, 2011, 11:33:10 »
0

Bonjour à tous, un nouveau problème vient à moi... Est-il possible de supprimer (ou changer...) un pointeur statique? Par exemple (le problème):


1
2
3
4
5
6
:If A=1
:[...]->GDB1
:End
:If A=2
:[......]->GDB1
:End

(Les [...] représente des codes hexa corrects)
Le problème est que lors de la compilation, j'obtiens une erreur Dupplicate sur le 2eme GDB...
Comment parer cela? A part stocker le 2eme code dans GDB2 etc...
« Last Edit: 18 September, 2011, 11:36:50 by trotithuthur » Logged

Hayleia
Programming Absol
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Last Login: Today at 20:50:49
Date Registered: 01 June, 2011, 20:12:47
Location: ud-ud ?
Posts: 2053


Total Post Ratings: +256

View Profile
« Reply #1 on: 18 September, 2011, 13:46:56 »
0

Est-il possible de supprimer (ou changer...) un pointeur statique?
Mots-clés dans la question: pointeur statique.
C'est un pointeur statique, pas une variable. Donc, non, ton code est inconcevable.

Pourrais tu développer un peu plus ce que tu veux, pour trouver une solution plus adaptée ?
Genre donner l'hex code présent dans chaque [] et dire ce que tu veux en faire, par exemple (sprite,...).
« Last Edit: 18 September, 2011, 13:48:26 by Hayleia » Logged





Spoiler for what I am according to...:
me: useless
Pokemon Test: an Absol
turiqwalrus: an eggplant
p2: A HUMAN BEING !
Blackpilar and p2: iplantonlyplantwantplanttoplantknowplantifplantyouplantareplantaplantboyplantorplantaplantgirlplant
click here to know where you got your last +1s
trotithuthur
LV1 Newcomer (Next: 20)
*
Offline Offline

Gender: Male
Last Login: 19 May, 2012, 09:47:01
Date Registered: 17 September, 2011, 20:54:21
Location: France, Chambéry
Posts: 17

Topic starter
Total Post Ratings: +3

View Profile
« Reply #2 on: 18 September, 2011, 14:12:04 »
0

Désolé, en fait, il s'agit de code pour des map, et donc par exemple A est le numéro du niveau,et chaque niveau une map différente, mais je crois avoir parer le problème, en utilisantdes fonctions, je réécris l'affichage de la map un GDB= 1 niveau, et j'appelle la fonction dans la partie déplacement du personnage par exemple.
Je ne sais pas si j'ai été assez clair... Undecided
En gros (très gros...):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
:Repeat getkey(15)
:code déplacement
:If A=1
:sub(N1)
:End
:If A=2
:sub(N2)
:End
:End
:Lbl N1
:[...]->GDB1
:sub(AFF)
:Return
:Lbl N2
:[...]->GDB2
:sub(AFF)
:Return
:Lbl AFF
:code affichage map
:Return
Logged

Hayleia
Programming Absol
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Last Login: Today at 20:50:49
Date Registered: 01 June, 2011, 20:12:47
Location: ud-ud ?
Posts: 2053


Total Post Ratings: +256

View Profile
« Reply #3 on: 18 September, 2011, 14:16:56 »
0

Problème: la routine AFF, comment elle sait avec quel pointeur elle doit afficher ?
Est-ce que tous les hex codes que tu mets dans tes GDB font la même taille ? Si oui, quelle taille ?
« Last Edit: 18 September, 2011, 14:18:43 by Hayleia » Logged





Spoiler for what I am according to...:
me: useless
Pokemon Test: an Absol
turiqwalrus: an eggplant
p2: A HUMAN BEING !
Blackpilar and p2: iplantonlyplantwantplanttoplantknowplantifplantyouplantareplantaplantboyplantorplantaplantgirlplant
click here to know where you got your last +1s
trotithuthur
LV1 Newcomer (Next: 20)
*
Offline Offline

Gender: Male
Last Login: 19 May, 2012, 09:47:01
Date Registered: 17 September, 2011, 20:54:21
Location: France, Chambéry
Posts: 17

Topic starter
Total Post Ratings: +3

View Profile
« Reply #4 on: 18 September, 2011, 14:33:39 »
0

Oui il font tous la meme taille, exemple:


1
2
3
4
5
6
7
8
[000000000000]->GDBX
[011011000110]
[011010111100]
[011100011100]
[011011111110]
[011111111110]
[011111111110]
[000000000000]
Mais je pense en effet au probleme de la fonction aff... je pense que je vais mettre ce code dans les fonctions N1... Parce que le pointeur à besoin d'être connu... donc bon, sinon on peut blinder la fonction AFF de conditions, mais ça revient au même, une fonction d'affichage différente pour chaque GDB...
Logged

Hayleia
Programming Absol
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Last Login: Today at 20:50:49
Date Registered: 01 June, 2011, 20:12:47
Location: ud-ud ?
Posts: 2053


Total Post Ratings: +256

View Profile
« Reply #5 on: 18 September, 2011, 15:57:45 »
+1

Oui il font tous la meme taille
w00t
Solution simple:

mets ceci au debut de ton code (en remplaçant les corneries que j'ai mises par les vraies données de tes niveaux).

.level1
[000000000000]->GDB1
[011011000110]
[011010111100]
[011100011100]
[011011111110]
[011111111110]
[011111111110]
[000000000000]
.level2
[000000000000]
[011011000110]
[011010111100]
[011100011100]
[011011111110]
[011111111110]
[011111111110]
[000000000000]
.etc


Puis affecte le numero du niveau à une variable, par exemple N.
Au début, N=0 et tu es au niveau 1.
Puis tu passes au niveau suivant avec N++. Donc N=1 et tu es au niveau 2.
En fait, N=niveau-1.

Pour la routine AFF, fait en fonction du pointeur N*48+GDB1.
Si je sais compter, cela devrait marcher.
« Last Edit: 18 September, 2011, 15:58:11 by Hayleia » Logged





Spoiler for what I am according to...:
me: useless
Pokemon Test: an Absol
turiqwalrus: an eggplant
p2: A HUMAN BEING !
Blackpilar and p2: iplantonlyplantwantplanttoplantknowplantifplantyouplantareplantaplantboyplantorplantaplantgirlplant
click here to know where you got your last +1s
trotithuthur
LV1 Newcomer (Next: 20)
*
Offline Offline

Gender: Male
Last Login: 19 May, 2012, 09:47:01
Date Registered: 17 September, 2011, 20:54:21
Location: France, Chambéry
Posts: 17

Topic starter
Total Post Ratings: +3

View Profile
« Reply #6 on: 18 September, 2011, 16:09:07 »
0

Merci! Effectivement j'avais penser à un truc comme ça, pour le choix de la 'partie' du GDB, je mettais GDB1+8, etc... x)
Tu es sur du 48? Je mettrai plutôt 96...?
EDIT:j'ai du me gourer ailleurs, mais j'obtiens la bonne map avec 48, et 96...  Roll Eyes
RE-EDIT: tu as raison,c'est bien 48, au temps pour moi, donc merci, ça marche parfaitement Smiley
« Last Edit: 18 September, 2011, 16:15:57 by trotithuthur » Logged

Hayleia
Programming Absol
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Last Login: Today at 20:50:49
Date Registered: 01 June, 2011, 20:12:47
Location: ud-ud ?
Posts: 2053


Total Post Ratings: +256

View Profile
« Reply #7 on: 18 September, 2011, 16:17:42 »
0

Tu es sur du 48? Je mettrai plutôt 96...?
RE-EDIT: tu as raison,c'est bien 48, au temps pour moi, donc merci, ça marche parfaitement Smiley
C'est 48 et pas 96 car pour faire un nombre en hexa, il faut 2 chiffres. Donc tu as compté 96 chiffres mais il y a 48 nombres Wink
Logged





Spoiler for what I am according to...:
me: useless
Pokemon Test: an Absol
turiqwalrus: an eggplant
p2: A HUMAN BEING !
Blackpilar and p2: iplantonlyplantwantplanttoplantknowplantifplantyouplantareplantaplantboyplantorplantaplantgirlplant
click here to know where you got your last +1s
trotithuthur
LV1 Newcomer (Next: 20)
*
Offline Offline

Gender: Male
Last Login: 19 May, 2012, 09:47:01
Date Registered: 17 September, 2011, 20:54:21
Location: France, Chambéry
Posts: 17

Topic starter
Total Post Ratings: +3

View Profile
« Reply #8 on: 18 September, 2011, 16:23:18 »
0

Oui voilà 8*16, divisé par 2 Smiley
Encore merci Wink
Logged

Hayleia
Programming Absol
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Last Login: Today at 20:50:49
Date Registered: 01 June, 2011, 20:12:47
Location: ud-ud ?
Posts: 2053


Total Post Ratings: +256

View Profile
« Reply #9 on: 18 September, 2011, 16:29:07 »
0

De rien Smiley moi aussi j' ai dû poser des questions un jour, donc j'aime bien rendre la pareille.
Logged





Spoiler for what I am according to...:
me: useless
Pokemon Test: an Absol
turiqwalrus: an eggplant
p2: A HUMAN BEING !
Blackpilar and p2: iplantonlyplantwantplanttoplantknowplantifplantyouplantareplantaplantboyplantorplantaplantgirlplant
click here to know where you got your last +1s
Wellen
LV4 Regular (Next: 200)
****
Offline Offline

Gender: Male
Last Login: 02 May, 2012, 11:56:34
Date Registered: 08 August, 2011, 11:00:09
Location: France
Posts: 118


Total Post Ratings: +5

View Profile
« Reply #10 on: 19 September, 2011, 20:45:47 »
0

*bump*

Et si les codes hexa ne sont pas tous de la même taille ?
Logged

-/...././/--./.-/--/.
I'm french, so please feel free to correct my bad english, it'd help me a lot Wink
Spoiler for Feat. Loulou54:
Spoiler for Projects:
Spoiler for Axe:
Ti-Lock : Lock your calc before turning it off               [XXXXXXXX--] 80%
Spoiler for Ti-Basic:
Spoiler for Soko-Ti, a sokoban game in Ti-Basic:

Spoiler for Memory:

Downloads here.
Hayleia
Programming Absol
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Last Login: Today at 20:50:49
Date Registered: 01 June, 2011, 20:12:47
Location: ud-ud ?
Posts: 2053


Total Post Ratings: +256

View Profile
« Reply #11 on: 20 September, 2011, 16:43:21 »
0

Dans ce cas, tu es dans la m peux faire ceci

[code hex 1]→GDB1
[code hex 2]→GDB2
[code hex 3]→GDB3
.etc
{GDB1,GDB2,GDB3,etc}→Str1


et le pointeur au debut du niveau se trouve à {Str1+N}, c'est-à-dire que pour accéder au premier octet du niveau actuel, tu fais {{Str1+N}}, et pour accéder au second octet du niveau actuel, {{Str1+N}+1}.
Cela devrait fonctionner théoriquement.
Crédits: Ceci m'a été inspiré par Aichi, pas tout à fait dans ces circonstances mais quand même.

En fait, tu stockes tous les pointeurs GDB à partir de Str1
« Last Edit: 20 September, 2011, 16:44:17 by Hayleia » Logged





Spoiler for what I am according to...:
me: useless
Pokemon Test: an Absol
turiqwalrus: an eggplant
p2: A HUMAN BEING !
Blackpilar and p2: iplantonlyplantwantplanttoplantknowplantifplantyouplantareplantaplantboyplantorplantaplantgirlplant
click here to know where you got your last +1s
Wellen
LV4 Regular (Next: 200)
****
Offline Offline

Gender: Male
Last Login: 02 May, 2012, 11:56:34
Date Registered: 08 August, 2011, 11:00:09
Location: France
Posts: 118


Total Post Ratings: +5

View Profile
« Reply #12 on: 20 September, 2011, 18:21:18 »
0

Dans ce cas, tu es dans la m
w00t

Merci, je teste dès que j'en arrive à la partie-là de mon programme, je donnerai des nouvelles.
Logged

-/...././/--./.-/--/.
I'm french, so please feel free to correct my bad english, it'd help me a lot Wink
Spoiler for Feat. Loulou54:
Spoiler for Projects:
Spoiler for Axe:
Ti-Lock : Lock your calc before turning it off               [XXXXXXXX--] 80%
Spoiler for Ti-Basic:
Spoiler for Soko-Ti, a sokoban game in Ti-Basic:

Spoiler for Memory:

Downloads here.
noelthebest
LV5 Advanced (Next: 300)
*****
Offline Offline

Gender: Male
Last Login: Today at 19:46:53
Date Registered: 20 March, 2011, 14:12:09
Location: France
Posts: 248

Total Post Ratings: +15

View Profile WWW
« Reply #13 on: 08 October, 2011, 13:49:19 »
0

Ça sent le zContest ! :rire mechant:
Logged

http://www.ti-concours.com
TI-Concours 2013 - starting on the 4th of March
Languages : TI-Basic z80, Axe, Asm z80, TI-Basic 68k, Lua Nspire.
Don't forget to subscribe ! Grin
Wellen
LV4 Regular (Next: 200)
****
Offline Offline

Gender: Male
Last Login: 02 May, 2012, 11:56:34
Date Registered: 08 August, 2011, 11:00:09
Location: France
Posts: 118


Total Post Ratings: +5

View Profile
« Reply #14 on: 08 October, 2011, 15:07:58 »
0

Ça sent surtout le nécropost shocked

Oui, c'est pour stocker les niveaux de Lost Smiley
Logged

-/...././/--./.-/--/.
I'm french, so please feel free to correct my bad english, it'd help me a lot Wink
Spoiler for Feat. Loulou54:
Spoiler for Projects:
Spoiler for Axe:
Ti-Lock : Lock your calc before turning it off               [XXXXXXXX--] 80%
Spoiler for Ti-Basic:
Spoiler for Soko-Ti, a sokoban game in Ti-Basic:

Spoiler for Memory:

Downloads here.
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.297 seconds with 31 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.