3
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by spixy
0

Just a wild guess, but maybe you could explode on a special character (the enter character, \n)?

That would return an array of which each key would contain a line of text.

0

yes, that's true, use explode to lookup for the units..
but any complete pseudocode for this?

0

first off, this is a classic case for Class / object code. drive around on phpclasses.net site for a while for a feel of classes. Clearly, since you seem to be just starting out on this project, what are you trying to do? duplicate the conditionals that happen in the 'stack game' site you pointed to? if so, you need a much more robust backend and better design from the get go.
I'll be so bold to say that there is poor thought of design right out of the box.
Why are these 2 'textarea' fields? There is better ways to handle the data.
I did read the whole 'stack game' page there was more rules to 'pairing' then just the 'name' of a character class...
Actually after consulting the page again, I would start with a class called 'kingdom' and fill that will all things related to what it takes to play. a 'kingdom' will require two 'players' to join a game. those players then get turns which can be contained in your 'kingdom' object.
create a 'player' object.
I won't even begin to start on all things that would make up a 'player' object, but think about that 'player' containing other objects. one object would be
'casting class' which holds all things near and dear to the casting options that this player has dependent on what type of color they chose. then you need a 'units' class to contain all of the data that makes up what a unit is.
anyway, seem to be rambling a bit today...
So is this for fun, for work, for school? Would you like some help to turn those instructions on that page into a game. I'm not very interested in the game, but love showing others the beauty and elegance of class / object programming.

0

to give you an idea of what am i talking about..
here it is

MatchUp Calculator

but what i wanted is instead of selecting those units on a dropdown menu
we will just paste our stacks on text boxes

now, is it clear?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.