So basically im creating this python adventure text game. And so far its good. But i have this problem with class instances(Is that the right term?) Say for example i have this class, class monster(object): def __init__(self,health,attack): self.damage = damage self.health = health So then I create a class object(again, is that the right term?) goblin = monster(5,30) skeleton = monster(10,20) so now, i have this piece of code for the fighting mechanic between the player and the monster. (I just copy past this so the indentation might be messed up) if char.location.war == True: while death == False: #check …

Member Avatar
Member Avatar
+0 forum 2

Good morning Guys, I've got this code currently running: private void button1_Click(object sender, EventArgs e) { SqlDataSourceEnumerator sdse = SqlDataSourceEnumerator.Instance; DataTable table = sdse.GetDataSources(); foreach (DataRow row in table.Rows) { instanceCombobox.Items.Add(row["ServerName"].ToString() + "\\" + row["InstanceName"].ToString()); } Which gives me the Instance and Name of the SQL Server over the Network. I'm now looking to Cycle through available databases on the 'Selected' Instance. Ideally the Databases for the 'Selected' Instance in the 'Top Combo Box' would be in a seperate 'ComboBox. I checked the Databale through debug but the information is not held there so cannot call it. Any help would …

Member Avatar
Member Avatar
+0 forum 2

Is there any method to deal with distributed deadlock when multiple instances are available for each resource type? I think method of wait-for graph and chase algorithm can be used only when single instance of each resource type is available.

Member Avatar
Member Avatar
+0 forum 1

I am trying to create a walker that goes through directories. Here are the inputs and outputs which I have partly working. I am using a test directory but I would like this to be done on any directory which is leading to some problems. [CODE][IN]: print testdir #name of the directory [OUT]: ['j','k','l'] #directories under testdir [IN]: print testdir.j [OUT]: ['m','n'] # Files under testdir.j[/CODE] Here is the code so far: [CODE]class directory_lister: """Lists directories under root""" def __init__(self,path): self.path = path self.ex = [] for item in os.listdir(path): self.ex.append(item) def __repr__(self): return repr(self.ex)[/CODE] This returns the directories and …

Member Avatar
Member Avatar
+0 forum 8

Hi all, How to find the base address of a structure ,just by knowing the name of the structure and a address of one of its members. Thanks in advance

Member Avatar
Member Avatar
+0 forum 27

I have three classes. I have a main app, a Draggable class, and a creator class. I want it so that when i click on one rectangle it produces the same exact dimensions as the shape i pressed. However, the problem is that when I use mousePressed, it seems that I can't differentiate between the two rectangles. Click on one or the other produces the same result, but I want them to be different. I'm not sure on how to go about doing this. [B]MyApp.java[/B] [CODE] import wheels.users.*; import java.awt.Color; public class MyApp extends Frame { private Creator _brick1, _brick2; …

Member Avatar
Member Avatar
+0 forum 6

Hi all, Wonder if someone could please lend a hand, I have a courses.txt file which is read into a Course String array I also have a program.txt (A list of 8 courses required to pass the program) There's a menu option to change the Program, however a condition of that is that the new program must contain only courses from the courses.txt (aka the courses array) I can't seem to do that, any assistance would greatly be appreciated Here is the code where courses are entered [CODE]try { courses[0] = new course(); for (int j = 0; j < …

Member Avatar
Member Avatar
+0 forum 9

Hi! I want to run multiple threads at the same time, and each thread has foreach loop accessing a listbox, so each thread checks every item in listbox, instead that each thread checks only one item, or skip an item if it has already been checked by other thread. Now, i would like to syncronize them so each thread checks only one item, which has not been checked by any other thread previously Thanks for any help in advance!

Member Avatar
Member Avatar
+0 forum 2

The End.