Psych0 P3ngu1n

Members
  • Content count

    28
  • Joined

  • Last visited

Community Reputation

100 Neutral

About Psych0 P3ngu1n

  • Rank
    Member
  1. Some questions about C++

    1.C++ classes can contain references to other classes. 2 C++ classes can contain a maximum of one reference to another class. 3.A Class Constructors cannot call another Class Constructor inside of itself. 4.A C++ Class can "grab" the address of another Class. These are all true false questions, I don't know the answer please help me out. Thank you for your time.
  2. Python.

    alright thanks, but my last question was just to get an idea of what most people like to use or people think is the best version. But thanks for the answer and other links
  3. Python.

    Download Python The current production versions are Python 2.6.5 and Python 3.1.2. Start with one of these versions for learning Python or if you want the most stability; they're both considered stable production releases. If you don't know which version to use, start with Python 2.6.5; more existing third party software is compatible with Python 2 than Python 3 right now. For the MD5 checksums and OpenPGP signatures, look at the detailed Python 2.6.5 page: •Python 2.6.5 Windows installer (Windows binary -- does not include source) •Python 2.6.5 Windows X86-64 installer (Windows AMD64 / Intel 64 / X86-64 binary [1] -- does not include source) •Python 2.6.5 Mac OS X Installer Disk Image (for Mac OS X 10.3 through 10.6) •Python 2.6.5 compressed source tarball (for Linux, Unix or OS X) •Python 2.6.5 bzipped source tarball (for Linux, Unix or OS X, more compressed) Also look at the detailed Python 3.1.2 page: •Python 3.1.2 Windows x86 MSI Installer (Windows binary -- does not include source) •Python 3.1.2 Windows X86-64 MSI Installer (Windows AMD64 / Intel 64 / X86-64 binary [1] -- does not include source) •Python 3.1.2 Mac OS X Installer Disk Image (for Mac OS X 10.3 through 10.6) •Python 3.1.2 compressed source tarball (for Linux, Unix or OS X) •Python 3.1.2 bzipped source tarball (for Linux, Unix or OS X, more compressed) There is also a preview release of Python 2.7 available. A comprehensive list of all released versions is available if you need source code for an older version of Python. Other parties have re-packaged Python. These re-packagings often include more libraries or are specialized for a particular application: •ActiveState ActivePython (not open source) •Enthought Python Distribution (a commercial distribution for scientific computing) •Portable Python (Python and add-on packages configured to run off a portable device) •PyIMSL Studio (a commercial distribution for numerical analysis – free for non-commercial use) which is best version to get? i dont know. Help please?
  4. Question on my code, Please look

    Thank you everyone for your help. I appreciate it.
  5. Question on my code, Please look

    I know this sounds bad, but I'm getting ahead of what I've learned, or I'm doing stuff he wont teachm haven't figured out which one yet. But do I pass it as a parameter?
  6. Question on my code, Please look

    Ok Black Knight you just answered my question, sorta. Is there a way to make Rick the same Ogre Rick in the functions. Spell Summon() is for a lab for school on Association. Its makes Ogre use the spell (or something like that) is what my teacher says. Summon() is supposed to initiate and make Ogre Rick summon a troll.
  7. Question on my code, Please look

    Well i have it at 60 because when ogre is created it has 50 health, so it does return true. But I want to be able to write health<50 in Summon() because Ogre was previously attacked when ran on Visual Studio in C++
  8. Question on my code, Please look

    #include<iostream> #include<string> using namespace std; class Spell { protected: int Mana; public: bool SpellHit(int,int); bool Summon(); }; class Warrior { protected: int mana; public: int health; Warrior(); void SpellUse(Spell &SpellObj); }*WarriorPtr; Warrior::Warrior() { mana = 10; health = 100; } class Ogre { protected: int mana; public: int health; Ogre(); void SummonTroll(Spell &SpellSummon); }*OgrePtr; Ogre::Ogre() { health = 50; mana = 15; } class Troll : public Ogre { protected: int mana; public: int health; Troll(); }*TrollPtr; Troll::Troll() { health = 150; mana = 50; } int main() { Warrior Rob; Ogre Rick; Spell Fire; Spell CreateTroll; Rob.SpellUse(Fire); Rick.SummonTroll(CreateTroll); return 0; } bool Spell::SpellHit(int locX, int locY) { int enemyLocX, enemyLocY; enemyLocX = 300; enemyLocY = 50; if((locX == enemyLocX)&&(locY ==enemyLocY)) return true; else return false; } bool Spell::Summon() { Ogre Rick; if(Rick.health < 60) return true; else return false; } void Warrior::SpellUse(Spell &SpellObj) { Ogre Rick; bool hit; hit = SpellObj.SpellHit(300,50); if( hit ) cout<<"Warrior cast a fire spell on the Ogre."<<endl<<endl; Rick.health -= 32; cout<<"Ogre's health reduced to "<<Rick.health<<"."<<endl<<endl; mana -= 10; cout<<"Mana by 10 reduced to "<<mana<<"."<<endl<<endl; } void Ogre::SummonTroll(Spell &SpellSummon) { bool hit; hit = SpellSummon.Summon(); if( hit ) cout<<"A new Troll was created to help Ogre attack Warrior."<<endl<<endl; mana -= 15; cout<<"Mana reduced by 15 to "<<mana<<"."<<endl<<endl; } Ok, so first off this code works. My question comes in where I wrote bool Spell:Summon { Ogre Rick; if(Rick.health < 60) return true; else return false; } how would I make it so it can say (Rick.health < 50) because he was attacked and his health is already lower than max health. That way I don't have to write 60, because Ogre's health is maxed out at 50.
  9. Python.

    ya, my school computer doesn't allow a lot of web sites. So I wasn't able to find it, so I thought I'd ask.
  10. Question on code

    thank you stone, your way was a little bit easier to do. but both worked for me.
  11. Python.

    Is there a free version of Python available for download? If so, where can I find it?
  12. Question on code

    alright thanks for help.
  13. Question on code

    int main() { Ogre bill; Ogre ted; Spell fireball; Spell thunderbolt; Spell freezeray; Spell spells[] = { fireball, thunderbolt, freezeray }; Spell &spell = spells[rand() % 3]; bill.SpellUse(spell); ted.SpellUse(spell); } here is code that Rip-Off gave me a few days ago to help with a lab for class, for my own knowledge however, i wanted to know if there was a way to show what spell was being used when the application was ran. If so, can you please show me the code for it. Thanks for taking time to read my thread. (and reply if you do.)
  14. Please Help

    Rip-Off.....THANK YOU! that worked and I understood it. You don't know how relieved I just got know that i see it working. Alatar and kaktusas2598 thank you for all the help you gave me. You helped out a lot. Thank you once again for making me get rid of my problems with my code.
  15. Please Help

    Ya lol, I'm glad I found this site. But at the same time I feel like a ginormous idiot for asking stupid questions. Specially looking at some of the other threads in the beginner forums. Also whats sad is I take notes, I read the books he has had us look at. And I'm two terms into programming. Five terms into my school. Ugh I hate this teacher.