Hey everyone, if you've read my previous post you'd know I'm working on a Pokemon game for ti 84 plus CE.

I have it so when the user catches a pokemon it puts it's number in a list (ex. 25 →ʟPKMN) but how can I actually assign that number to a pokemon so I can reference it's stats later?

Thanks for all the help I've been getting btw, the projects gone a long way since I started it.
Are you talking about all the pokemon in the inventory of a player or just a plain list of all the pokemon that exist in the game? Also I'm curious to see your code so far.

Also for future notice, please try to keep related posts in the same thread. No need to have three different threads for the same pokemon game.
I'm going to assume you mean that LPKMN is referring to the user's inventory. A quick solution could be to store Pokemon names and stats in a string or two, using sub( and expr(. Here's an example snippet; the string contains four Pokemon and stats. The program will derive stats and name from a simple number.

Code:

"Charizard100040002Pikachu  200050004Squirtle 150020001Zekrom EX500065010"->Str1
Input "Pokemon ID",P     //input Pokemon number (can be replaced with list input in your program)
sub(Str1,P18-18,18->Str2       //derive individual name and stats
expr(sub(Str2,10,3->A        //Stat 1
expr(sub(Str2,13,3->B        //Stat 2
expr(sub(Str2,16,3->C        //Stat 3
sub(Str2,1,9->Str2         //derive Pokemon name

The program will store a Pokemon name in Str1, and a stat in each of A, B, and C. Each Pokeman name+stat is 18 chars long. (Name-13; Stats-each 3)

Also, could you post the code for this game so far?
While it may get extremely hard to manage, you could assign each Pokemon an ID number, and store the name of said pokemon to sub(Str1,13(dim(L1)),13). 1st stat could be stored to LSTAT1 2nd to LSTAT2 so on and so forth. to store the new stat, use S->LSTAT1(dim(LSTAT+1)). for inventory, you could then store the pokemon the player has just by its ID, using sub(Str1,13(ID),13), where ID is the Pokemon's ID to recall the Pokemon's Stats.

In the end, it would look something like this:


Code:

/to save pokemon

:repeat length(/*pokemon name*/)=13
:/*Pokemon Name*/+" "->/*Pokemon name*/
:End
:Str1 + /*Pokemon name*/ -> Str1

/to save stats
length(Str1)/13-L
/stat/ -> LSTAT(L)

/to recall stats
LSTAT(ID)->/stat/
sub(STR1,13(ID),13)->/*pokemon name*/
Hey everyone I haven't had much time to work on Pokemon since I made this topic but I'll be posting the code soon and I'm hoping to finish this project this summer. Thanks for the help, feel free to comment tips and whatnot.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement