Search results for query: *

  1. R

    Answered Using path.GetFullPath to return local directory?

    Ok. I’ll try that. Thanks for the link.
  2. R

    Answered Using path.GetFullPath to return local directory?

    I’ve received a lot of great help previously on this site. I have another question. I have a program that loads images from a path on my computer dynamically. Obviously if I copy this program to another computer the path will be different. I need to find the root directory of the program...
  3. R

    Resolved Most efficient way to choose random item from reducing list?

    First of all I was posting on my phone so it really got screwed up. Secondly, how much money do you think you should have earned for all this coding you did for me?
  4. R

    Resolved Most efficient way to choose random item from reducing list?

    Okay, I understand everything you've suggested, but what if I want this queue to happen on Form2? To explain, I've used all your code (from the other thread) to generate 2-5 random monsters. My program then opens a new Form and I need to cycle through those 2-5 random monsters each time a push a...
  5. R

    Answered Dynamically add/remove items from List<string> based on user input?

    I just wanted to share how I got it to work. I filtered monsters into groups, then added them to a list if the appropriate box was checked. Converted that to an array and chose a random monster from that array. Thanks again. private void Button3_Click(object sender, EventArgs e) {...
  6. R

    Answered Dynamically add/remove items from List<string> based on user input?

    I finally got everything to work. Monsters have two types. Can I do this? Monster lavabeetle = new Monster("Lava Beetle", MonsterType.Hot|MonsterType.Cave); Or do I need to define that each Monster has more than one type like this? public Monster(string monsterName, MonsterType type...
  7. R

    Answered Dynamically add/remove items from List<string> based on user input?

    Haha. Okay. I changed this to answered, but I actually have another question now. public enum MonsterType { Building, Cave, Civilized, Cold, Cursed, Dark, Hot, Mountain, Water, Wilderness } public class Monster { public MonsterType Type { get...
  8. R

    Answered Dynamically add/remove items from List<string> based on user input?

    One more thing before I mark this as answered. It sounded like you might be a little frustrated at the end there. Sorry about all my questions. I just wanted to understand everything instead of just having you write the code for me. I mean, don't get me wrong, it was awesome that you did write...
  9. R

    Resolved Most efficient way to choose random item from reducing list?

    I was able to solve my problem based on your suggestions and a bunch of reading on MSDN. It probably isn't the most elegant solution, and it isn't complete, but it is doing what I want it to do. I just created a simple Windows Form to test it, so this isn't really my final solution. I also kept...
  10. R

    Answered Dynamically add/remove items from List<string> based on user input?

    Thanks for the detailed explanation. I thought I was getting close to understanding the code without your explanation and I did understand some of it, but other stuff I was way off. I appreciate your time.
  11. R

    Answered Dynamically add/remove items from List<string> based on user input?

    Okay. Sorry, but I feel like I might be close to understanding this. If you don’t mind a few more clarifying responses. Ok. For this part it goes through and returns a true if both the aerial checkbox is checked AND the monster.type is aerial. Two questions: the || operator is an OR statement...
  12. R

    Answered Dynamically add/remove items from List<string> based on user input?

    Okay. That helps a lot. Now I see how the code can be used to check both lists before returning a value. Just need to figure out how to create both lists in a way that the code can understand.
  13. R

    Answered Dynamically add/remove items from List<string> based on user input?

    Sort of. I can follow the logic of the code, I think. The variable filteredmonsters will be filled with all the results from checking all the checkboxes for the different types of monsters. I don’t know what || is. If that is just formatting in the post or something I need. I also understand...
  14. R

    Answered Dynamically add/remove items from List<string> based on user input?

    Yes. Thank you. I will read some tutorials on enums. I grasp the idea of what he is saying to do and I can follow the code he has written, but I really have no idea what he is talking about. I understand enum and what a class is, but then I don't know the syntax to, for example, continue his...
  15. R

    Answered Dynamically add/remove items from List<string> based on user input?

    BTW, here is how I did it originally. public partial class UserControl3 : UserControl { List<string> cavemonsters = new List<string>(); ; added items to the list. private List<string> addcave() { cavemonsters.Add("Goblin Archer")...
  16. R

    Answered Dynamically add/remove items from List<string> based on user input?

    No offense taken and 100% you are correct. My code and my way of learning to code have been extremely inefficient. For me this is just a fun little project I’m doing in my spare time. My degree is in pharmacology so computer language isn’t my strength. I appreciate the input you and John have...
  17. R

    Answered Dynamically add/remove items from List<string> based on user input?

    If you read my other response it will make more sense but I cleared the list for 2 reasons. 1. I want it to generate a random monster each time regardless of previous results so I had it rebuild the list each time I pressed the button. 2. That is the only way I could figure to do it, was to...
  18. R

    Answered Dynamically add/remove items from List<string> based on user input?

    First, you guys are great. 2nd sorry for posting poorly worded questions. 3rd you basically nailed it. I have 10 types of monsters similar to what you listed i.e. cave, cold, hot. There are about 5-10 monsters per group. Cave has goblins, spiders, etc. Hot has imps, hellhounds, etc. When you...
  19. R

    Answered Dynamically add/remove items from List<string> based on user input?

    Haha. Sorry about that. I actually don’t know how you answer any questions because people like me are just writing vague descriptions of stuff that is in their head. I’ll try to follow the rules.
  20. R

    Answered Dynamically add/remove items from List<string> based on user input?

    I posted here the other day and got a good answer. I’ve been working on the code and I have a new challenge. I created a simple program that chooses a random item from a list. I figured out how to make it dynamic using checkboxes. I have 10 groups of data that I created using list<string>. If...
Back
Top Bottom