|
-
May 5th, 2009, 10:32 PM
#1
String Manipulation
Okay, so I have set myself a project that might be a little in over my head for my first program, but I've gotten too far to quit now.
I'm stuck trying to figure out the best (read: easiest) way to manipulate certain strings. The input is being read from a file line-by-line, and it's a capture from a text-based game. For example,
Trios cuts adult red dragon for 73 damage!
The adult red dragon breathes dragonfire on you for 174 damage!
Now, I already have a file with a list of all the possible combinations of these messages, and for the ones above it looks like this:
{source} cuts {target} for {dmg} damage!
{source} breathes {misc} on {target} for {dmg} damage!
So when I read in this file, I want to read a line, compare it to my preset messages, to determine A) what kind of message it is, B) who the {source} and {target} is, if any; and C) how much damage was done, if any.
A little help would be appreciated. Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|