kiteflora
❔ Help with homework coding 'project' due this Thursday
You might have a point...
In that case, I don't have to make the program select which quests to present to McGuyver each and every time, in the interest of not over-complicating things, I can just have raw materials and the tools/devices as the variables
29 replies
❔ Help with homework coding 'project' due this Thursday
...so for how to implement the whole thing, I envision the program/console selecting 3-5 random of the quests for every instance, and let's say, 5 random tools also (both printed to the console).
Then the program has to use the tools to find the optimal way of completing the most amount of quests let's say I.e. if the quests have difficulty 5-5-10and the tools selected have usefulness scores of 10,5,8(no particular order), the optimal ORDER in which to use the tools would be 5,8,10 (we assume that the usefulness is 'used' up regardless if it exceeds the difficulty of the quest it was used for)
29 replies
❔ Help with homework coding 'project' due this Thursday
Hey, sorry for the late reply
For a littlebackground, my class hierarchy (point 1) has seven classes, each containing several generic items I.e.
class Household : IGenericItem{} (mother class)
class Hairdryer: Household {}
class: Fork: Household {}... and so forth
-please note that I create the IGenericItem interface to be able to use it as a type to store items in ARRAYS to the various tools constructors
(Other mother classes are Garage, HardwareStore, Kitchen, Bathroom, OfficeSupply & Garden, all with their respective item hierarchy and inherenting from the 'IGenericItem' interface)
As asked for in the task, I have made a linked list of the Quests, using a class called QUESTS, for the quest instances themselves, & QUESTLIST to store instances of QUESTS in the LL. Please remember that the QUESTS constructor take a name in string form (e.g. "Kidnapping", "Hijacking", "Haunting"...) AND an integer value that describes the difficulty level(will be used in conjunction with the devices usefulness score)
for the BST, I have a class called Device Description, it's constructor is as follows:
(string name, int usefulness, IGenericItem[] components)
and another called DeviceBST, the actual BST that stores the 'DeviceDescriptions". Because I was asked to use the number of unique items used for each device as the key for the elements, I decides to assign each device a different number of items (1,2,3,4,5,6,7,8,9,10,13). This was done by:
1. Instantiating EACH AND EVERY item with the default constructor;
2.creating the item arrays (IGenericItem[]) using the instantiated items
3.Calling the DeviceDescription constructor to create all the devices (there are 11)
4.Creating the BST (DeviceBST<int, DeviceDescription> McGuyverDevices = new Devices<int, DeviceDescription>();)
...I hope that describes my situation well 🙂
29 replies
❔ Help with homework coding 'project' due this Thursday
Hi, I've completed most of the trivial part of the code(BSTs & linked list) just need help developing the algorithm...In my head I'd approach it as an optimisation algorithm where for every instance of the console being opened a selected list of the quests is given and the program has to find the optimal use of them...That's it
29 replies