Search Results

Search found 9122 results on 365 pages for 'sound card'.

Page 35/365 | < Previous Page | 31 32 33 34 35 36 37 38 39 40 41 42  | Next Page >

  • Game: Age of Empires sound good but video "out of range"

    - by Ezekiel
    I'm new to the Ubuntu realm. Currently i'm using Linux Mint 12 with Wine 1.4 and PLAYONLINUX as game loading/playing programs. Video card is MSI GeForce FX5200 (NVIDIA) and is 3d enabled. I can play "Call of Duty 5 demo just fine. My real love is the Age of Empires series games. I loaded the WINE version of AOE 1 demo. No sound and no picture. Black screen with "Out of Range" window in red. I loaded my CD version of AOE 1 through PLAYONLINUX. I get the sound just fine but again the black screen with "Out of Range" window in red. I have used all the monitor settings in both the "settings" and in winecfg. None of the eight monitor options worked in any combination. I have checked all the questions and blogs on this error and tried all I found and no one seems to come up with a real fix. I guess I need to know exactly what the "Out of Range" means. Any help? Anywhere? Thanks

    Read the article

  • How to read raw bytes from an SD card?

    - by geschema
    On a Windows PC, is there a way to read the raw bytes from an SD card attached trough a USB card reader? The SD card gets written from an embedded system using no file system at all, so I can't use standard file access routines. This is similar to what the unix dd utility does, but I need to integrate this into a .NET application.

    Read the article

  • Play sound on menu items on hover [migrated]

    - by Mahalia Samuels
    How can I go about making a sound clip play when an element is hovered over? I'm using the latest Wordpress, and the parent theme I am using gives me an option to paste scripts which it will embed to the <head> section. Is there a script which I can just add to my <head> that will play the sound when the cursor moves over my menu item class .menu li? I spent several hours trying to figure this out the other day with no avail. I've done this before in a simple HTML website: <head> <script language="javascript" type="text/javascript"> function playSound(soundfile) { document.getElementById("dummy").innerHTML= "<embed src=\""+soundfile+"\" hidden=\"true\" autostart=\"true\" loop=\"false\" />"; } </script> </head> <li><a href="index.html" onmouseover="playSound('lib/hover.mp3');" onclick="playSound('lib/click.mp3');"><span>Home</span></a></li> Not sure how to deploy this on Wordpress though.

    Read the article

  • Mplayer no sound when playing some movies

    - by Ivan Peevski
    Ok, that's a bit of a strange problem, that somehow crept into my system. It used to work fine. Here is the problem as far as I can identify it. When I try to play certain video files with mplayer, there is no sound. As far as I can tell, it is only an issue with ac3 and dts sound tracks (using the ffmpeg decoder). Mplayer says: ========================================================================== Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders AUDIO: 48000 Hz, 6 ch, s16le, 1536.0 kbit/33.33% (ratio: 192000->576000) Selected audio codec: [ffdca] afm: ffmpeg (FFmpeg DTS) ========================================================================== [AO_ALSA] Playback open error: Device or resource busy Failed to initialize audio driver 'alsa' Could not open/initialize audio device -> no sound. Audio: no sound (similar with ac3 sound, but using the ffac3 audio codec). Trying different audio output (-ao oss/pcm/sdl) doesn't fix the problem. The strange thing is that if I play these files directly with ffplay, they work fine. mplayer sound with mp3/ogg is fine My alsa configuration is standard (no /etc/asound.conf or ~/.asound*) OS: Linux Gentoo Mplayer: 1.0_rc4_p20100213 (SVN-r30554-4.3.4) FFMpeg: 0.5_p20601-r1 (SVN-r20601) Any other information I can provide?

    Read the article

  • Windows 8 Communication Sound Setting not working

    - by blackmastiff
    I've been having a problem on my new laptop recently which is familiar but baffling the usual fixes. I'm running Windows 8 with an onboard Realtek soundcard. It's similar to the one on my older computer running Windows 7. The problem is, when I'm in Skype or Mumble, Windows changes the sound output to lower everything else automatically. I've disabled the communications sound change option on the communications tab within sound devices and checked all the applications settings to insure that they are not responsible. They aren't, and I noticed something else. When I'm in the sound properties dialog, and I switch to the microphone tab, the same audio output reduction occurs. This seems to say to me that the microphone must be responsible in some way, but seeing as I uninstalled all the drivers and installed windows drivers instead, I'm confused as to why this would be occurring. Any thoughts? EDIT: I just tried disabling the built in microphone and the sound no longer get changed. More confused now? As soon as I turn it back on, the sound gets dropped again. Incidentally, the fix for this on windows 7 was this question: Windows 7 lowers applications' volume automatically I've got my computer set that way and it doesn't work.

    Read the article

  • Graphics card recommendation for dual-HD output?

    - by Graham
    I'm going for a dual-HD monitor setup (HDMI or DVI output), running Ubuntu 11.10 64-bit with Unity 3D. What graphics card / video card should I get? Requirements: Dual-monitor output for DVI (mixed-resolution: 1920x1080 and 1920x1200) Or dual-HDMI output, if it works with Ubuntu Smooth desktop compositing and (Chrome) browser and IDE window rendering At least 60fps on fullscreen glxgears (1920x1200 resolution) Supported and non-buggy behaviour in Unity 3D/Compiz Not looking to play games Smooth fullscreen video playback (just because)

    Read the article

  • Where is /dev/dsp or /dev/audio?

    - by YumYumYum
    I have to apply sudo chmod a+r /dev/dsp or /dev/audio but in my Ubuntu 12.10 i do not have such. Where is then the PCM sound file for ssh? chmod: cannot access `/dev/dsp': No such file or directory chmod: cannot access `/dev/audio': No such file or directory Follow up: http://superuser.com/questions/244173/missing-dev-dsp-under-ubuntu I want to stream the sound output and input. So that i can capture any audio in/out to a file for recording.

    Read the article

  • How can I reinstall pulseaudio? (12.04 64bit)

    - by Luca Cerone
    I accidentally removed pulseaudio from my Ubuntu 12.04 64bit. I have tried reinstalling it using sudo apt-get install pulseaudio but my sound card doesn't appear in the list of the devices (in System Settings -- Sound). For the moment I managed to get sounds by using ALSA, but I would like to reinstall pulseaudio and have it working as before my accidental removal. How can I reinstall it and have the devices configured correctly?

    Read the article

  • Volume range is narrow in 12.04

    - by Alejandro
    I have upgraded to Ubuntu 12.04 and I have a problem with the volume. The problem is that the volume is 0 when the volume bar is between 0% and 66% more or less, so the actual volume range is only between 66% and 100%. If I open the sound configuration menu, the position in the volume bar that makes the sound begin sounding (66% more or less) is placed where it says "no amplification". Can anyone help me? Thank you.

    Read the article

  • How to activate subwoofer in Inspiron 17r?

    - by alfC
    I have a Dell Inspiron 17r, after a fresh install of 12.10, the subwoofer seems to be not utilized. No sound comes from it and in the Sound Control Panel the settings appear grayed out (see screenshot). How can I activate the subwoofer? I tried adding the line options snd-hda-intel model=dell in the file /etc/modprobe.d/alsa-base.conf and enable-lfe-remixing = yes default-sample-channels = 3 in the file /etc/pulse/daemon.conf, but still doesn't work.

    Read the article

  • graphics card not found?

    - by Rens
    I just installed Ubuntu 12.04 and absolutely love it , but when i go to system details it says graphics unknown, is this a problem ? i have a acer aspire 5750, and a Intel 3000 HD graphics card.There also no additional drivers to be installed, but on another computer i needed to install additional drivers and it showed the grapics card. is there a problem with intel graphics in combination with ubuntu ?

    Read the article

  • Support TrendNet TEW-643PI Wireless N network card

    - by Matthew Rigdon
    Hello, Has anyone been able to get a TrendNet TEW-643PI Wireless N card working under UBUNTU, if so what drivers did you use and where did you find them. I have this card and would really like to be able to use it in my computer. I found drivers that may work but dont know how to get ubuntu to pick up the drivers. I have tried the Additional Drivers option but cannot seem to get ubuntu to pick up the drivers. Thanks.

    Read the article

  • HP Pavilion dv5 boots with low brightness and graphics card not recognized

    - by cesar
    My problem is with Ubuntu 11.10 in my notebook hp pavilion dv5 with a graphic Intel(R) hd graphics. When I start Ubuntu my screen is without brightness, I can increase it with my control buttons, but when I restart I don't have brightness again. also Ubuntu doesn't recognize my graphic card (Intel HD (R) graphics), please i need your help because i like Ubuntu and i would like have it in my laptop (HP dv5 2045la) (3GB RAM) (500 GB DISK). PS: I installed the repository MESA and now recognizes my card but my problem with the brightness

    Read the article

  • How to associate hardware volume control to USB speakers?

    - by Wolfger
    My Xubuntu system recognizes my speakers, and I can change the mixer settings to make them the active sound device, but no matter what I do, the hardware dial will only affect the onboard sound device. generic-usb 0003:046D:0A19.0003: input,hidraw1: USB HID v1.00 Device [ Logitech Logitech Z205 ] on usb-0000:00:1d.1-1/input2 updated to reflect the fact that this was Xubuntu desktop (from Kubuntu install originally) where I had this problem. I was able to easily do this from Ubuntu Natty installation.

    Read the article

  • Microphone crackling in Ubuntu 12.04

    - by Tomas
    I am not very experienced in linux and have this problem with microphone which works fine on Windows. Microphone is external one and when listening to recorded sound (both Sound Recorder and Skype Echo Test) you can hear crackling noise. I fixed output crackling by replacing load-module module-hal-detect with load-module module-hal-detect tsched=0 in /etc/pulse/default.pa but I have no idea how to fix input. Hardware info: Card: HDA ATI SB Chip: Realtek ALC272X Thanks for help!

    Read the article

  • Wireless card unseen by lspci

    - by al-Amjad Tawfiq Isstaif
    I installed both Ubuntu 8.04 and 10.04. I tried to install the wireless card. although I succeeded in installing the driver using ndiswrapper, it tells me that the hardware is not present. When I use lspci, it doesn't list it. I have this laptop model and I think it should have the same entry about the wireless card here: http://ubuntuforums.org/showthread.php?t=1810193 Could the problem be other than hardware malfunction?

    Read the article

  • Using Ops Center to Provision Solaris using a Card-Based NIC

    - by Larry Wake
    Scott Dickson writes:  "Here's what I want to do:  I have a Sun Fire T2000 server with a Quad-GbE nxge card installed.  The only network is connected to port 2 on that card rather than the built-in network interfaces.  I want to install Solaris on it across the network, either Solaris 10 or Solaris 11." See what he did, using Oracle Enterprise Manager Ops Center 12c. [Read More]

    Read the article

  • Volume control doesn't work for headphones

    - by Hendekagon
    Fresh install of 11.10 and the gnome panel's volume control doesn't work for headphones but does work for speakers on my laptop. In sound settings I have Internal Audio Analogue Stereo selected for output (Output tab) and Analogue Speakers selected for Connector. When I plug headphones in, the volume control doesn't work and the volume is maximum through the headphones. On a side note, only one of my two headphone sockets produces sound too (whereas both worked in 10.04)

    Read the article

  • ATI card - cannot set refresh rate higher than 60 Hz

    - by KubaV
    I am trying to set refresh rate to 85 Hz or 75 Hz at 1024x768 and 1280x1024. On Windows this works, so my card and monitor have 100% support. xrandr does not work - it gives me configure crtc 1 failed I use FGLRX. Please help Monitor:CRT - HP 92 (manual http://bizsupport2.austin.hp.com/bc/docs/support/SupportManual/lpv09818/lpv09818.pdf) G. card: AMD Radeon HD 6450 Sorry for bad english, I am Czech.

    Read the article

  • Audio not working for Gnome Screencast Ctrl + Alt + Shift + R

    - by Costa
    I can do screencasts by pressing ctrl+alt+shift+r, but I get no sound when I view the videos, I've check my built in mic and headset, they both work on skype and such, I just can't record sound with the gnome built in screencasting. Also, when I open the videos in movieplayer they are in mute by default and there's nothing the the preferences I can find to change that. Any help would be awesome!

    Read the article

  • Did Adobe Photoshop just killed my Graphics Card for good?

    - by user6004
    I was working with Adobe Photoshop, just some regular work, when I came to edit a PSD file and change the text of some layer, when all of a sudden the PC froze. No mouse, screen is frozen, keyboard strokes aren't getting me anything, no Task Manager, nada. So I rebooted my PC, and then something quite terrifying appeared before my eyes. It was not the Checkdisk utility that was launched, that made me terrified (by the way, that reboot damaged the partition table of an external HDD that was connected at the time to my PC, but that's another story). It was the screen itself. Please have a look. So after Checkdisk finished and Windows loaded, I noticed that the resolution was not right. Instead of 1440x900 which I had set, it was 1280x1024. When I went to change it back, I had no option to change back to my old resolution, and has only 3 other general resolution properties, as if my Video Card (GeForce 8800 GTS btw) was not recognized. And what do you know, in the Device Manager it appeared with an exclamation mark. Inside the hardware, it said this: Windows has stopped this device because it has reported problems. (Code 43) Uninstalling the drivers, downloading the newest drivers from NVIDIA and installing them did not work. It always comes back to this. So, do you have any advice before I go out and buy a new graphics card? I thought this was the only option left, but maybe the experts at Super User can help me out. By the way, the dotted screen appears after every reboot, and I see the dots when the ASUS Motherboard screen shows up at boot. Thanks in advance.

    Read the article

  • How to disable Power off/Power on sound on Android phone? [closed]

    - by yvolk
    My Android phone (Android v.2.1) produces loud sound both before Power off and after Power on (boot) is being completed. I don't want to turn the sound off before reboot/powering it off and to turn sound on after reboot every time I'm restarting my phone. I just want to get rid of these sounds forever :-) How can I do this (maybe executing some script, changing some properties... preferably without rooting my phone)? Update: Thank you Christopher Orr! I've also found some information that partially allows to achieve what I'm looking for (on androidforums.com): "if you are going into SettingsSound & displayNotification ringtone that sets your notification tone for app updates, power on (rebooting) etc. If you want to change notification for messages you would have to go into messaging and then hit the menu key for notification option. You can do the same for email accounts as well." So I disabled Power on/off sounds (plus something else... but I didn't notice undesired side effect yet...) with built-in settings.

    Read the article

  • Header Guard Issues - Getting Swallowed Alive

    - by gjnave
    I'm totally at wit's end: I can't figure out how my dependency issues. I've read countless posts and blogs and reworked my code so many times that I can't even remember what almost worked and what didnt. I continually get not only redefinition errors, but class not defined errors. I rework the header guards and remove some errors simply to find others. I somehow got everything down to one error but then even that got broke while trying to fix it. Would you please help me figure out the problem? card.cpp #include <iostream> #include <cctype> #include "card.h" using namespace std; // ====DECL====== Card::Card() { abilities = 0; flavorText = 0; keywords = 0; artifact = 0; classType = new char[strlen("Card") + 1]; classType = "Card"; } Card::~Card (){ delete name; delete abilities; delete flavorText; artifact = NULL; } // ------------ Card::Card(const Card & to_copy) { name = new char[strlen(to_copy.name) +1]; // creating dynamic array strcpy(to_copy.name, name); type = to_copy.type; color = to_copy.color; manaCost = to_copy.manaCost; abilities = new char[strlen(to_copy.abilities) +1]; strcpy(abilities, to_copy.abilities); flavorText = new char[strlen(to_copy.flavorText) +1]; strcpy(flavorText, to_copy.flavorText); keywords = new char[strlen(to_copy.keywords) +1]; strcpy(keywords, to_copy.keywords); inPlay = to_copy.inPlay; tapped = to_copy.tapped; enchanted = to_copy.enchanted; cursed = to_copy.cursed; if (to_copy.type != ARTIFACT) artifact = to_copy.artifact; } // ====DECL===== int Card::equipArtifact(Artifact* to_equip){ artifact = to_equip; } Artifact * Card::unequipArtifact(Card * unequip_from){ Artifact * to_remove = artifact; artifact = NULL; return to_remove; // put card in hand or in graveyard } int Card::enchant( Card * to_enchant){ to_enchant->enchanted = true; cout << "enchanted" << endl; } int Card::disenchant( Card * to_disenchant){ to_disenchant->enchanted = false; cout << "Enchantment Removed" << endl; } // ========DECL===== Spell::Spell() { currPower = basePower; currToughness = baseToughness; classType = new char[strlen("Spell") + 1]; classType = "Spell"; } Spell::~Spell(){} // --------------- Spell::Spell(const Spell & to_copy){ currPower = to_copy.currPower; basePower = to_copy.basePower; currToughness = to_copy.currToughness; baseToughness = to_copy.baseToughness; } // ========= int Spell::attack( Spell *& blocker ){ blocker->currToughness -= currPower; currToughness -= blocker->currToughness; } //========== int Spell::counter (Spell *& to_counter){ cout << to_counter->name << " was countered by " << name << endl; } // ============ int Spell::heal (Spell *& to_heal, int amountOfHealth){ to_heal->currToughness += amountOfHealth; } // ------- Creature::Creature(){ summoningSick = true; } // =====DECL====== Land::Land(){ color = NON; classType = new char[strlen("Land") + 1]; classType = "Land"; } // ------ int Land::generateMana(int mana){ // ... // } card.h #ifndef CARD_H #define CARD_H #include <cctype> #include <iostream> #include "conception.h" class Artifact; class Spell; class Card : public Conception { public: Card(); Card(const Card &); ~Card(); protected: char* name; enum CardType { INSTANT, CREATURE, LAND, ENCHANTMENT, ARTIFACT, PLANESWALKER}; enum CardColor { WHITE, BLUE, BLACK, RED, GREEN, NON }; CardType type; CardColor color; int manaCost; char* abilities; char* flavorText; char* keywords; bool inPlay; bool tapped; bool cursed; bool enchanted; Artifact* artifact; virtual int enchant( Card * ); virtual int disenchant (Card * ); virtual int equipArtifact( Artifact* ); virtual Artifact* unequipArtifact(Card * ); }; // ------------ class Spell: public Card { public: Spell(); ~Spell(); Spell(const Spell &); protected: virtual int heal( Spell *&, int ); virtual int attack( Spell *& ); virtual int counter( Spell*& ); int currToughness; int baseToughness; int currPower; int basePower; }; class Land: public Card { public: Land(); ~Land(); protected: virtual int generateMana(int); }; class Forest: public Land { public: Forest(); ~Forest(); protected: int generateMana(); }; class Creature: public Spell { public: Creature(); ~Creature(); protected: bool summoningSick; }; class Sorcery: public Spell { public: Sorcery(); ~Sorcery(); protected: }; #endif conception.h -- this is an "uber class" from which everything derives class Conception{ public: Conception(); ~Conception(); protected: char* classType; }; conception.cpp Conception::Conception{ Conception(){ classType = new char[11]; char = "Conception"; } game.cpp -- this is an incomplete class as of this code #include <iostream> #include <cctype> #include "game.h" #include "player.h" Battlefield::Battlefield(){ card = 0; } Battlefield::~Battlefield(){ delete card; } Battlefield::Battlefield(const Battlefield & to_copy){ } // =========== /* class Game(){ public: Game(); ~Game(); protected: Player** player; // for multiple players Battlefield* root; // for battlefield getPlayerMove(); // ask player what to do addToBattlefield(); removeFromBattlefield(); sendAttack(); } */ #endif game.h #ifndef GAME_H #define GAME_H #include "list.h" class CardList(); class Battlefield : CardList{ public: Battlefield(); ~Battlefield(); protected: Card* card; // make an array }; class Game : Conception{ public: Game(); ~Game(); protected: Player** player; // for multiple players Battlefield* root; // for battlefield getPlayerMove(); // ask player what to do addToBattlefield(); removeFromBattlefield(); sendAttack(); Battlefield* field; }; list.cpp #include <iostream> #include <cctype> #include "list.h" // ========== LinkedList::LinkedList(){ root = new Node; classType = new char[strlen("LinkedList") + 1]; classType = "LinkedList"; }; LinkedList::~LinkedList(){ delete root; } LinkedList::LinkedList(const LinkedList & obj) { // code to copy } // --------- // ========= int LinkedList::delete_all(Node* root){ if (root = 0) return 0; delete_all(root->next); root = 0; } int LinkedList::add( Conception*& is){ if (root == 0){ root = new Node; root->next = 0; } else { Node * curr = root; root = new Node; root->next=curr; root->it = is; } } int LinkedList::remove(Node * root, Node * prev, Conception* is){ if (root = 0) return -1; if (root->it == is){ root->next = root->next; return 0; } remove(root->next, root, is); return 0; } Conception* LinkedList::find(Node*& root, const Conception* is, Conception* holder = NULL) { if (root==0) return NULL; if (root->it == is){ return root-> it; } holder = find(root->next, is); return holder; } Node* LinkedList::goForward(Node * root){ if (root==0) return root; if (root->next == 0) return root; else return root->next; } // ============ Node* LinkedList::goBackward(Node * root){ root = root->prev; } list.h #ifndef LIST_H #define LIST_H #include <iostream> #include "conception.h" class Node : public Conception { public: Node() : next(0), prev(0), it(0) { it = 0; classType = new char[strlen("Node") + 1]; classType = "Node"; }; ~Node(){ delete it; delete next; delete prev; } Node* next; Node* prev; Conception* it; // generic object }; // ---------------------- class LinkedList : public Conception { public: LinkedList(); ~LinkedList(); LinkedList(const LinkedList&); friend bool operator== (Conception& thing_1, Conception& thing_2 ); protected: virtual int delete_all(Node*); virtual int add( Conception*& ); // virtual Conception* find(Node *&, const Conception*, Conception* ); // virtual int remove( Node *, Node *, Conception* ); // removes question with keyword int display_all(node*& ); virtual Node* goForward(Node *); virtual Node* goBackward(Node *); Node* root; // write copy constrcutor }; // ============= class CircularLinkedList : public LinkedList { public: // CircularLinkedList(); // ~CircularLinkedList(); // CircularLinkedList(const CircularLinkedList &); }; class DoubleLinkedList : public LinkedList { public: // DoubleLinkedList(); // ~DoubleLinkedList(); // DoubleLinkedList(const DoubleLinkedList &); protected: }; // END OF LIST Hierarchy #endif player.cpp #include <iostream> #include "player.h" #include "list.h" using namespace std; Library::Library(){ root = 0; } Library::~Library(){ delete card; } // ====DECL========= Player::~Player(){ delete fname; delete lname; delete deck; } Wizard::~Wizard(){ delete mana; delete rootL; delete rootH; } // =====Player====== void Player::changeName(const char[] first, const char[] last){ char* backup1 = new char[strlen(fname) + 1]; strcpy(backup1, fname); char* backup2 = new char[strlen(lname) + 1]; strcpy(backup1, lname); if (first != NULL){ fname = new char[strlen(first) +1]; strcpy(fname, first); } if (last != NULL){ lname = new char[strlen(last) +1]; strcpy(lname, last); } return 0; } // ========== void Player::seeStats(Stats*& to_put){ to_put->wins = stats->wins; to_put->losses = stats->losses; to_put->winRatio = stats->winRatio; } // ---------- void Player::displayDeck(const LinkedList* deck){ } // ================ void CardList::findCard(Node* root, int id, NodeCard*& is){ if (root == NULL) return; if (root->it.id == id){ copyCard(root->it, is); return; } else findCard(root->next, id, is); } // -------- void CardList::deleteAll(Node* root){ if (root == NULL) return; deleteAll(root->next); root->next = NULL; } // --------- void CardList::removeCard(Node* root, int id){ if (root == NULL) return; if (root->id = id){ root->prev->next = root->next; // the prev link of root, looks back to next of prev node, and sets to where root next is pointing } return; } // --------- void CardList::addCard(Card* to_add){ if (!root){ root = new Node; root->next = NULL; root->prev = NULL; root->it = &to_add; return; } else { Node* original = root; root = new Node; root->next = original; root->prev = NULL; original->prev = root; } } // ----------- void CardList::displayAll(Node*& root){ if (root == NULL) return; cout << "Card Name: " << root->it.cardName; cout << " || Type: " << root->it.type << endl; cout << " --------------- " << endl; if (root->classType == "Spell"){ cout << "Base Power: " << root->it.basePower; cout << " || Current Power: " << root->it.currPower << endl; cout << "Base Toughness: " << root->it.baseToughness; cout << " || Current Toughness: " << root->it.currToughness << endl; } cout << "Card Type: " << root->it.currPower; cout << " || Card Color: " << root->it.color << endl; cout << "Mana Cost" << root->it.manaCost << endl; cout << "Keywords: " << root->it.keywords << endl; cout << "Flavor Text: " << root->it.flavorText << endl; cout << " ----- Class Type: " << root->it.classType << " || ID: " << root->it.id << " ----- " << endl; cout << " ******************************************" << endl; cout << endl; // ------- void CardList::copyCard(const Card& to_get, Card& put_to){ put_to.type = to_get.type; put_to.color = to_get.color; put_to.manaCost = to_get.manaCost; put_to.inPlay = to_get.inPlay; put_to.tapped = to_get.tapped; put_to.class = to_get.class; put_to.id = to_get.id; put_to.enchanted = to_get.enchanted; put_to.artifact = to_get.artifact; put_to.class = to_get.class; put.to.abilities = new char[strlen(to_get.abilities) +1]; strcpy(put_to.abilities, to_get.abilities); put.to.keywords = new char[strlen(to_get.keywords) +1]; strcpy(put_to.keywords, to_get.keywords); put.to.flavorText = new char[strlen(to_get.flavorText) +1]; strcpy(put_to.flavorText, to_get.flavorText); if (to_get.class = "Spell"){ put_to.baseToughness = to_get.baseToughness; put_to.basePower = to_get.basePower; put_to.currToughness = to_get.currToughness; put_to.currPower = to_get.currPower; } } // ---------- player.h #ifndef player.h #define player.h #include "list.h" // ============ class CardList() : public LinkedList(){ public: CardList(); ~CardList(); protected: virtual void findCard(Card&); virtual void addCard(Card* ); virtual void removeCard(Node* root, int id); virtual void deleteAll(); virtual void displayAll(); virtual void copyCard(const Conception*, Node*&); Node* root; } // --------- class Library() : public CardList(){ public: Library(); ~Library(); protected: Card* card; int numCards; findCard(Card&); // get Card and fill empty template } // ----------- class Deck() : public CardList(){ public: Deck(); ~Deck(); protected: enum deckColor { WHITE, BLUE, BLACK, RED, GREEN, MIXED }; char* deckName; } // =============== class Mana(int amount) : public Conception { public: Mana() : displayTotal(0), classType(0) { displayTotal = 0; classType = new char[strlen("Mana") + 1]; classType = "Mana"; }; protected: int accrued; void add(); void remove(); int displayTotal(); } inline Mana::add(){ accrued += 1; } inline Mana::remove(){ accrued -= 1; } inline Mana::displayTotal(){ return accrued; } // ================ class Stats() : public Conception { public: friend class Player; friend class Game; Stats() : wins(0), losses(0), winRatio(0) { wins = 0; losses = 0; if ( (wins + losses != 0) winRatio = wins / (wins + losses); else winRatio = 0; classType = new char[strlen("Stats") + 1]; classType = "Stats"; } protected: int wins; int losses; float winRatio; void int getStats(Stats*& ); } // ================== class Player() : public Conception{ public: Player() : wins(0), losses(0), winRatio(0) { fname = NULL; lname = NULL; stats = NULL; CardList = NULL; classType = new char[strlen("Player") + 1]; classType = "Player"; }; ~Player(); Player(const Player & obj); protected: // member variables char* fname; char* lname; Stats stats; // holds previous game statistics CardList* deck[]; // hold multiple decks that player might use - put ll in this private: // member functions void changeName(const char[], const char[]); void shuffleDeck(int); void seeStats(Stats*& ); void displayDeck(int); chooseDeck(); } // -------------------- class Wizard(Card) : public Player(){ public: Wizard() : { mana = NULL; rootL = NULL; rootH = NULL}; ~Wizard(); protected: playCard(const Card &); removeCard(Card &); attackWithCard(Card &); enchantWithCard(Card &); disenchantWithCard(Card &); healWithCard(Card &); equipWithCard(Card &); Mana* mana[]; Library* rootL; // Library Library* rootH; // Hand } #endif

    Read the article

  • Card Shuffling in C#

    - by Jeff
    I am trying to write a code for a project that lists the contents of a deck of cards, asks how much times the person wants to shuffle the deck, and then shuffles them. It has to use a method to create two random integers using the System.Random class. These are my classes: Program.cs: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication3 { class Program { static void Main(string[] args) { Deck mydeck = new Deck(); foreach (Card c in mydeck.Cards) { Console.WriteLine(c); } Console.WriteLine("How Many Times Do You Want To Shuffle?"); } } } Deck.cs: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication3 { class Deck { Card[] cards = new Card[52]; string[] numbers = new string[] { "2", "3", "4", "5", "6", "7", "8", "9", "J", "Q", "K" }; public Deck() { int i = 0; foreach(string s in numbers) { cards[i] = new Card(Suits.Clubs, s); i++; } foreach (string s in numbers) { cards[i] = new Card(Suits.Spades, s); i++; } foreach (string s in numbers) { cards[i] = new Card(Suits.Hearts, s); i++; } foreach (string s in numbers) { cards[i] = new Card(Suits.Diamonds, s); i++; } } public Card[] Cards { get { return cards; } } } } classes.cs: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication3 { enum Suits { Hearts, Diamonds, Spades, Clubs } } Card.cs: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication3 { class Card { protected Suits suit; protected string cardvalue; public Card() { } public Card(Suits suit2, string cardvalue2) { suit = suit2; cardvalue = cardvalue2; } public override string ToString() { return string.Format("{0} of {1}", cardvalue, suit); } } } Please tell me how to make the cards shuffle as much as the person wants and then list the shuffled cards. Sorry about the formatting im new to this site.

    Read the article

< Previous Page | 31 32 33 34 35 36 37 38 39 40 41 42  | Next Page >