Skip to main content
GameDev.net gamedev.net
🔒 Locked

lots-o-weapons

Started by Sir Mud Dec 9, 2000 at 1:37 PM 3 replies 400+ views
Original Post
Sir Mud
Sir Mud
ok, so i have 3 text files, 1 with prefixs, 1 with main/bodys, and 1 with suffixs, ok what i want a little program to do is randomly take 1 prefix, 1 main/body, and 1 suffix and put them together and save it in a weapons file, untill it has no more possible complete names, any help would be appreciated.
"head hurt from write"
Mezz
Mezz
what you have is a massive link set, and you want to account all possible links.

What you need is to take a prefix, then go through the main parts one by one for that single prefix, but for each main part go through the suffixes once aswell.

Shoddy diagram:

pre1---->main1---->suf1
---->suf2
---->suf3
etc...
main2---->suf1
---->suf2
etc...

then carry on through all that.


-Mezz
Sir Mud
Sir Mud
thanks for your reply, there are a few things i forgot to add,
1. im using c++
2. i''ve been able to get it to read the first line of each file.
thanks again
"head hurt from write"
djsteffey
djsteffey
  
for (int i = 0; i < numPrefixes; i++)
{
for (int j = 0; j < numMain; j++)
{
for (int k = 0; k < numSuffixes; k++)
{
outFile << prefix<i> << main[j] << suffix[k] << endl;
}
}
}



"Now go away or I shall taunt you a second time"
- Monty Python and the Holy Grail
We are creating a Multi-player space strategy/shoot-em-up/RPG game.
Development is well under way and we do have a playable demo.
Always looking for help.
Digital Euphoria Soft

Sir Mud
Sir Mud
thank you too, this helps
"head hurt from write"

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.