Help Creating Elf / Warlock Language Decoder

Hello,

I am trying to figure out the best way to create a Language Decoder for Elves and Warlocks. User selects species (Either Elf or Wolf) from a pull down menu and enters a code.

Code is decrypted accoring to what species they are:

Example: User goes to the site and selects his species. He enters the code “A29” and the site would decode and spit out appropriate text.


Assuming

Elves:
First Character: A = first born, B = Second Born
Second Character 1 = Jan, 2= feb, 3= march etc
Third Character: 1 = 2001, 2= 2002, 3 = 2003 etc

For elves, A29 would spit out: first born feb 2009

Assuming
Warlocks
First character: A = killed one elf, B = killed two elves
Second Character 1 = first warrior, 2 = second warrior etc
Third Character 1 = 1st rank, 2 = second rank etc

For wolves, A29 would spit out: killed one, first warrior, second rank

I was thinking of creating multiple tables for each species that would have the required coding and then using the substrings () command to break up the inputted code so that each character is decoded appropriately.

I don’t want to have to create three boxes and have the user input one character in each box

What would be the best approach?

For the Warlock, it should be :A29 = first kill, second warrior, ninth rank

the best way to go about it I think would be to store all the text in different language files and server the right file as needed, have a look at

http://www.daveismyname.co.uk/tp-how-to-create-a-language-changer-with-php

you might be able to adapt that to suit your needs.

Hi Dave,

Thanks for the response. I’ve thought about that but the “Code” that needs to be translated can be anything the user inputs. He could be inputting B29 or Q39…it can be any sort of combination.

To use the text file, maybe quite tedious to do.

Would it be possible to separate the strings B29 and have PHP individually translate B, 2, and 9?

Sponsor our Newsletter | Privacy Policy | Terms of Service