Once you remove the flux-capacitor and restore the dos-command to idle(3)-, the whatchamacallit won't yield any surge results. Rookie mistake, really.
The Big Programming Thread - Page 424
| Forum Index > General Forum |
Thread Rules 1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution. 2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20) 3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible. 4. Use [code] tags to format code blocks. | ||
|
SixStrings
Germany2046 Posts
Once you remove the flux-capacitor and restore the dos-command to idle(3)-, the whatchamacallit won't yield any surge results. Rookie mistake, really. | ||
|
enigmaticcam
United States280 Posts
Suppose I have a website with a basic header, sidebar, and content layout. I've found that I really like asynchronous calls so I can display content easily without having to refresh the entire page. Would there be any significant problems if all the links in the sidebar and header performed an ajax update on the content section? | ||
|
tofucake
Hyrule19167 Posts
| ||
|
enigmaticcam
United States280 Posts
On January 10 2014 04:54 tofucake wrote: if the user disables javascript your entire website stops working Well it would be an internal website within the network at the workplace. But you're right - I hadn't even thought of that. I suppose there's no way to have a regular link that works without javascript, but can be overridden by javascript when it's enabled? | ||
|
Tobberoth
Sweden6375 Posts
On January 10 2014 05:03 enigmaticcam wrote: Well it would be an internal website within the network at the workplace. But you're right - I hadn't even thought of that. I suppose there's no way to have a regular link that works without javascript, but can be overridden by javascript when it's enabled? Sure there is. There's no problem having an anchor element with an onclick event handler, then preventing the default event with javascript. That way, the link will work as a standard link when not using javascript, and will have the javascript event fire instead if it's enabled. Question is how this makes sense in MVC, since you'll probably have the header and sidebar in _Layout.cshtml and content in views... using ajax to load views into the content seems like it would add a ton of complexity. | ||
|
Tobberoth
Sweden6375 Posts
| ||
|
WolfintheSheep
Canada14127 Posts
On January 10 2014 16:21 Tobberoth wrote: Sure there is. There's no problem having an anchor element with an onclick event handler, then preventing the default event with javascript. That way, the link will work as a standard link when not using javascript, and will have the javascript event fire instead if it's enabled. Question is how this makes sense in MVC, since you'll probably have the header and sidebar in _Layout.cshtml and content in views... using ajax to load views into the content seems like it would add a ton of complexity. Worth noting that this is good advice for every website you make. Make it functional without Javascript, no CSS (mostly for accessibility), no Flash, etc. first, and then use all that extra stuff to make it pretty. Most of the time that just means organizing your Divs top to bottom in a sensible manner, and having some kind of default HTML functionality for Javascript links. It won't be important in the majority of situations you run into, but it doesn't really take effort, and you'll be happy when you do/would've hit those problem scenarios. | ||
|
FFGenerations
7088 Posts
in c# i have an Ability class I have a Monster class I have a Game class each Monster can have one of two AbilityLists which each contain 4 Abilities in Game I have: public Ability[] abilityList1 = new Ability[4]; public Ability[] abilityList2 = new Ability[4]; which makes an array of 4 Abilities called abilityList1 then i have in Game's constructor: abilityList1[0] = new Ability("smash", 1); abilityList1[1] = new Ability("crush", 2); abilityList1[2] = new Ability("mash", 3); abilityList1[3] = new Ability("desolate", 4); in Monster i have: private Ability[] abilityList = new Ability[4]; then in Monster's constructor i have: public Monster(string monsterNameIn, int monsterPowerIn, int monsterHealthIn, Ability abilityListIn, bool isChosenIn, string isDeadIn) { monsterName = monsterNameIn; monsterHealth = monsterHealthIn; abilityList = abilityListIn; it says here though that Cannot implicity convert Game1.Ability to Game1.Ability[] going to hit post and try to understand this | ||
|
bangsholt
Denmark138 Posts
You're trying to assign an array of Ability to a single Ability. Change your Monster class to hold an array of Ability. Done. | ||
|
artynko
Slovakia86 Posts
| ||
|
FFGenerations
7088 Posts
Ability abilityListIn in the monsters constructor class to Ability[] abilityListIn and then changed, in Game constructor, abilitiyList1 back from abilityList[] or whatever i had it as new Monster("The Grue", 10, 10, abilityList1, false, "alive"); | ||
|
FFGenerations
7088 Posts
![]() thanks | ||
|
bangsholt
Denmark138 Posts
| ||
|
FFGenerations
7088 Posts
i finished my assignment (fast and messy) and it runs as expected on my laptop. but i just tried it on my PC (downloaded the same file from where i uploaded it to the college) and it stops working when it gets to the end part the part in question is when SelectMonster form tries to see that all activePlayer's monsters have health < 0 . on my working laptop version, when this is the case (all of his monsters have been killed), endGame is called and endGameScreen form opens however on my PC, when activePlayer's monsters are all dead it doesn't notice and just shows the SelectMonster form with unfilled buttons + Show Spoiler + on my PC ![]() on my laptop ![]() ill post the file its really tatty code with 50 forms stuck on the screen and you have to press space bar 100 times to get near the end (dont miss the end by accident) so you are warned i just want to know why its not working on my PC which has visual express 2013 installed whereas it works on my laptop http://www.mirrorcreator.com/files/0FDHPLXA/FFGOOP.zip_links ps you will probably find this amusingly bad | ||
|
CecilSunkure
United States2829 Posts
Just make sure it will run properly on whatever machine it will be graded on. | ||
|
FFGenerations
7088 Posts
i just googled VS runtime , clicked first google link (Microsoft Visual C++ 2010 Redistributable Package (x86)), and tried to install/upgrade on both machines but it said both are on more modern versions already its weird coz its just some simple function that it breaks on i think. i thought maybe i was using wrong operator so tried & instead of && , and tried moving an if statement up a bit and putting an else below it, but exactly same issue | ||
|
WolfintheSheep
Canada14127 Posts
And if you can replace "&" with "&&" at any place in your code without seeing a problem, I'd say you have some serious issues that go far beyond what you're seeing. | ||
|
tofucake
Hyrule19167 Posts
On January 11 2014 13:46 FFGenerations wrote: mm i just zipped everything and also copied the .exe from the subfolder and put it at the top folder so more easily accessible for tutor. but also when i ran the program from within visual studio on my PC it broke there aswell. also downloading my uploaded file to laptop to doublecheck it yields the same differing results between machines i just googled VS runtime , clicked first google link (Microsoft Visual C++ 2010 Redistributable Package (x86)), and tried to install/upgrade on both machines but it said both are on more modern versions already its weird coz its just some simple function that it breaks on i think. i thought maybe i was using wrong operator so tried & instead of && , and tried moving an if statement up a bit and putting an else below it, but exactly same issue & is an operator && is a comparator | ||
|
Ben...
Canada3485 Posts
On January 11 2014 13:46 FFGenerations wrote:its weird coz its just some simple function that it breaks on i think. i thought maybe i was using wrong operator so tried & instead of && , and tried moving an if statement up a bit and putting an else below it, but exactly same issue If you were doing C and that didn't completely explode upon attempted compilation, my head would have itself blown up. && is a boolean value that examines two sets (or variables or whatever you want to call them if you will) and sees if they match or not, returning true if they do, false if they don't. & looks at two binary values and copies the 1's or 0's found in both (Sometimes called bitand. It is one of the bitwise operations).Say you have two binary values, a = 1011 and b = 1110. & looks at each value in the binary numbers, and if they are the same, it "writes" it down into the resultant binary value. For the above two values, the result of doing a & b would be 1010. If you are familiar with the concept of truth tables in propositional or predicate logic, you can kind of think of & like filling out one of those tables, since technically you could simply read the 1s and 0s as true and false in that context. At least that is how I thought of it when we had to do operations with binary numbers by hand. Like the other dude said, something must be breaking before this, because there is no way you should get the same errors using those two vastly different things if it is reaching that point in the program when attempting to compile. | ||
|
WolfintheSheep
Canada14127 Posts
On January 11 2014 14:38 Ben... wrote: If you were doing C and that didn't completely explode, my head would have itself blown up. && is a boolean value, & looks at two binary values and copies the 1's or 0's found in both. Say you have two binary values, a = 1011 and b = 1110. & looks at each value in the binary numbers, and if they are the same, it "writes" it down into the resultant binary value. For the above two values, the result of doing a & b would be 1010. Eh, just want to say this is a fairly bad explanation of a Bitwise AND operation, not to mention incorrect. Bitwise AND compares every bit position in two binary values, and for each position if both are 1 it returns 1 for the corresponding position, otherwise it returns 0. So yes, 1011 AND 1110 = 1010. However, 0000 AND 0000 = 0000, even though the corresponding bits in each position are the "same". The logical operation that does what you describe is a biconditional (XNOR), or "if and only if" | ||
| ||

![[image loading]](http://i.imgur.com/jiPqaaH.jpg)
![[image loading]](http://i.imgur.com/AEZRk6k.jpg)