2019 Holiday Exchange!
 
A New and Exciting Beginning
 
The End of an Era
  • posted a message on Need some really quick java help!
    Found my issues. The return type needed to be int and the function was attempting to set JLabels = to an array. Whoops.
    Posted in: Geeks Corner
  • posted a message on Need some really quick java help!
    So for class I have to have a blackjack program. The requirements are:
    1) It deals 5 cards to the player and the dealer.
    2) It has a new game and a deal button.
    3) It shuffles when the deck runs out of cards.
    4) It has a lable displaying the value of your hand.
    5) Aces are either 1 or 11 depending on hand value.
    6) It displays a message in a JOption Pane when you hit 5 cards saying you can't take any more.

    I'm stuck.
    Completely.
    I got it dealing cards, and i created lables to show the value of the cards, and thats it. I can't figure out how to assign values to the card images or anything. Please help. Here's the code.

    //Deck.java
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    
    public class Deck
    {
        private Card[] cardDeck;
        private int topCard;
        private String imagePath;
        
        public Deck()
        {
            cardDeck = new Card[52];
            imagePath = "c:\\Java 1\\images\\";
            makeDeck();
            topCard = 0;
        }
        
        private void makeDeck()
        {
            int i, j, cardCounter;
            String imageFile = "";
            ImageIcon cardImage;
            
            cardCounter = 0;
            for(i = 0; i < 4; i++)
            {
                for(j=2; j < 15; j++)
                {
                    cardDeck[cardCounter] = new Card();
                    cardDeck[cardCounter].setSuit(i);
                    cardDeck[cardCounter].setRank(j);
                    if(j == 14)
                    {
                        switch(i)
                        {
                            case 0: imageFile = "1c.png"; break;
                            case 1: imageFile = "1d.png"; break;
                            case 2: imageFile = "1h.png"; break;
                            case 3: imageFile = "1s.png"; break;
                        }
                    }
                    
                    else
                    {
                        switch(i)
                        {
                            case 0: imageFile = "" + j + "c.png"; break;
                            case 1: imageFile = "" + j + "d.png"; break;
                            case 2: imageFile = "" + j + "h.png"; break;
                            case 3: imageFile = "" + j + "s.png"; break;
                        }
                    }
                    
                    cardImage = new ImageIcon(imagePath + imageFile);
                    cardDeck[cardCounter].setImage(cardImage);
                    cardCounter++;
                }
            }
        }
        
        public Card getTopCard()
        {
            if(topCard < 52)
                return cardDeck[topCard++];
            else
                return null;
        }
        
        public void shuffleDeck()
        {
            int nextNumber = 0;
            boolean[] selected = new boolean[52];
            boolean goodCard;
            Card[] tempDeck = new Card[52];
            for(int i = 0; i < 52; i++)
                selected[i] = false;
            for(int i = 0; i < 52; i++)
            {
                goodCard = false;
                while(!goodCard)
                {
                    nextNumber = (int)(Math.random()*52);
                    if(!selected[nextNumber])
                    {
                        goodCard = true;
                        selected[nextNumber] = true;
                    }
                }
                tempDeck[i] = cardDeck[nextNumber];
            }
            
            for(int i = 0; i < 52; i++)
                cardDeck[i] = tempDeck[i];
            topCard = 0;
        }
        
        public boolean hasNextCard()
        {
            return (topCard < 52);
        }
    }

    //Card.java
    import javax.swing.*;
    import java.awt.*;
    
    class Card
    {
        private int cardSuit;
        private int cardRank;
        private ImageIcon cardImage;
        
        public Card()
        {
            cardSuit = 0;
            cardRank = 2;
            cardImage = null;
        }
        
        public Card(int r, int s)
        {
            cardSuit = s;
            cardRank = r;
        }
        
        public ImageIcon getImage()
        {
            return cardImage;
        }
        
        public void setImage(ImageIcon newImage)
        {
            cardImage = newImage;
        }
        
        public void setRank(int r)
        {
            cardRank = r;
        }
        
        public void setSuit(int s)
        {
            cardSuit = s;
        }
    }

    //CardGame.java
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    
    public class CardGame extends JFrame implements ActionListener
    {
        private JButton dealerDeal, playerDeal, dealerNewGame, playerNewGame;
        private Deck myDeck;
        private JLabel[] dealerCardLabels, playerCardLabels;
        private JLabel lblDealerHand, lblPlayerHand, lblDealerHandValue, lblPlayerHandValue;
        private ImageIcon cardBack;
        private String imagePath;
        private int numPlayerCards, numDealerCards;
        private JPanel playerPanel, dealerPanel;
        
        public CardGame()
        {
            setTitle("Card Game");
            setSize(900,300);
            setBackground(Color.white);
            setLayout(new GridLayout(2,1));
            setLocationRelativeTo(null);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            imagePath = "c:\\Java 1\\images\\";
            cardBack = new ImageIcon(imagePath + "cardback.png");
            
            dealerPanel = new JPanel();
            dealerPanel.setSize(600,150);
            dealerPanel.setLayout(new FlowLayout());
            lblDealerHand = new JLabel("DEALER HAND:");
            lblDealerHandValue = new JLabel("Dealer Hand Value: ");
            //dealerPanel.add(lblDealerHand);
            dealerPanel.add(lblDealerHandValue);
            dealerCardLabels = new JLabel[5];
            for(int i = 0; i < 5; i++)
            {
                dealerCardLabels[i] = new JLabel(cardBack);
                dealerPanel.add(dealerCardLabels[i]);
            }
            
            dealerDeal = new JButton("Deal");
            dealerDeal.setBackground(Color.red);
            dealerDeal.setForeground(Color.white);
            dealerDeal.addActionListener(this);
            dealerPanel.add(dealerDeal);
            add(dealerPanel);
            
            dealerNewGame = new JButton("New Game");
            dealerNewGame.setBackground(Color.red);
            dealerNewGame.setForeground(Color.white);
            dealerNewGame.addActionListener(this);
            dealerPanel.add(dealerNewGame);
            add(dealerPanel);
            
            playerPanel = new JPanel();
            playerPanel.setSize(600,150);
            playerPanel.setLayout(new FlowLayout());
            lblPlayerHand = new JLabel("PLAYER HAND:");
            lblPlayerHandValue = new JLabel("Player Hand Value: ");
            //playerPanel.add(lblPlayerHand);
            playerPanel.add(lblPlayerHandValue);
            playerCardLabels = new JLabel[5];
            for (int i = 0; i < 5; i++)
            {
                playerCardLabels[i] = new JLabel(cardBack);
                playerPanel.add(playerCardLabels[I]);
            }
            
            playerDeal = new JButton("Deal");
            playerDeal.setBackground(Color.blue);
            playerDeal.setForeground(Color.white);
            playerDeal.addActionListener(this);
            playerPanel.add(playerDeal);
            add(playerPanel);
            
            playerNewGame = new JButton("New Game");
            playerNewGame.setBackground(Color.blue);
            playerNewGame.setForeground(Color.white);
            playerNewGame.addActionListener(this);
            playerPanel.add(playerNewGame);
            add(playerPanel);
            
            myDeck = new Deck();
            myDeck.shuffleDeck();
            numPlayerCards = 0;
            numDealerCards = 0;
            setVisible(true);
        }
        
        public void actionPerformed(ActionEvent e)
        {
            if(e.getSource() == dealerDeal)
            {
                Card myCard = myDeck.getTopCard();
                dealerCardLabels[numDealerCards].setIcon(myCard.getImage());
                numDealerCards++;
            }
            if(e.getSource() == playerDeal)
            {
                Card myCard = myDeck.getTopCard();
                playerCardLabels[numPlayerCards].setIcon(myCard.getImage());
                numPlayerCards++;
            }
        }
        
        public static void main(String args[])
        {
            CardGame myCardGame = new CardGame();
        }
    }


    Please help, and thanks to all who try.
    Posted in: Geeks Corner
  • posted a message on Glaze fiend extreme Budget
    Decks like these burn through hands fast. The Esperzoa + Prophetic Prism combo is nice, but it's even better with Etherium Sculptor. Origin Spellbomb is nice as well, but I still don't think it's enough draw. I'd also play Courier's Capsule. Parasitic Strix isn't all that great when you've got Sludge strider in there already. Also, I think the Thopter Foundry is overkill. Oh, and too much Esperzoa. Don't bounce too much.

    I propose:
    -2 Thopter Foundry
    -4 Parasitic Strix
    -1 Rite of Consumption
    -1 Esperzoa
    +2 Courier's Capsule
    +1 Prophetic Prism
    +3 Etherium Sculptor
    +2 Origin Spellbomb

    Just my 2 cents.
    Posted in: Casual & Multiplayer Formats
  • posted a message on Casual Buget B/U Faeries
    I used to be a much-hated faerie player. Problem is, I got out of magic, and i'm looking to get back into it with my friends with a budget faerie deck. It's all casual with them, so they don't have to be legal for any particular format. Unfortunately, I don't know how to make a budget deck, when i'm so used to running dual lands and bitterblossoms....

    Any help would be much appreciated.

    Smile
    Posted in: Casual & Multiplayer Formats
  • posted a message on Hookah
    I'm a frequent smoker of everything tobacco. Pipes, cigarillos, cigarettes, full cigars, hookah....you name it.

    My favourite two brands of hookah are Acid and Tangiers. Acid is a personal thing, it's not necessarily the best. When I first began to dabble in full cigars, Acid Blue Label cigars were the gateway cigar that got me interested. When I found out they had shisha too, I fell in love. I think Gold Label is my favourite shisha flavour from Acid....it has a nice hint of citrus.

    Tangiers, however, is my usual go to. Their shisha includes caffeine, which dilates the capillaries in your lungs, thus allowing you to absorb nicotine at a shockingly faster rate. If you like to relax, this ☺☺☺☺ does it for you. If you're not smoking socially (and thus passing the hose around after a few puffs), you won't even want to stand up after a dozen or so hits. It's fantasmical. No particular flavor of Tangiers is my favourite, although I do like Blueberry because it has song a strong presence.
    Posted in: Talk and Entertainment
  • posted a message on Is this the dumbest song ever?
    Quote from kuvien
    Well, I've heard some terrible music and I have to say, that definitely competes. I still hate this one myself: Banana Song

    Now, given I'm fond of some heavy rock and metal, but this is not only pathetic-simple, but catchy so you cannot get it out of your head!


    That song made me laugh uncontrollably until tears came from my eyes. I'm not entirely sure why, it wasn't particularly funny.

    OP: She's just a kid. I don't count that as a legitimate song. Christ i'm 20 and the poor thing sings better than I do. Sure, compared to legitimate music it's garbage, but that's not it at all. If we're talking real stuff, I think Pacman Fever takes the cake. Heard it on a local radio station playing the worst 10 flops of the 80's. Enjoy.
    Posted in: Talk and Entertainment
  • posted a message on I wanna name my son Jace.
    Honestly, as a legit name, its fine. But you seriously need to make up a story to tell people when they ask where it came from.

    Incidentally, when I was born, my father was deciding between Vladmir and Thor.....the mother talked him out of it. Wink
    Posted in: Talk and Entertainment
  • posted a message on Hangover cures.
    I've never had a hangover, but i've gotten a few first timers drunk on multiple occasions. When i'm taking care of them the next day, White Castle and V8 seems to be their friend.
    Posted in: Talk and Entertainment
  • posted a message on Jacked up sex laws
    Quote from Teia Rabishu
    Anal sex feels great.

    Unannounced anal sex does not.


    Sigged.

    Don't get me wrong, as i'm sure 99% of internet users are, i've got my own host of fetishes and preferences. But what happens *in* the bedroom is entirely irrelevant to *who* is in said bedroom.

    A 14 year old is easily manipulated. Mentally, they are not mature enough to handle the manipulative (or alcoholically aided) advances of a bloody college student! This strikes me as absolutely unreasonable.
    Posted in: Talk and Entertainment
  • posted a message on Jacked up sex laws
    I'm sure there are plenty more sources, but I chose one with a .gov URL.

    http://www.cga.ct.gov/2003/olrdata/jud/rpt/2003-r-0376.htm

    Again, I live in MO.

    If you are under 21, anything 14+ is fair game. If you are 21+, everything 17+ is fair game.


    Ah, I was mistaken as to the deviant sex. You are indeed correct in that those laws were repealed in 2003 by a massive supreme court case.

    The age of consent laws are still valid though. I still believe it's a flawed system where a third year college student is within his rights to sleep with a middle schooler. :/
    Posted in: Talk and Entertainment
  • posted a message on Jacked up sex laws
    Ok, so i'm not sure if this belongs in the debate thread or not, but here goes anyways. I'm 19, quite soon to be 20, and I have recently become interested in a girl who is 17. This spurned me to researching consent laws and sex laws in my state of Missouri.

    What. The. Hell.

    Apparently, If you are 21 or older, the age of consent is 17. However, if you are under the age of 21, the age of consent is only 14! That is absolutely ridiculous. I would also like to note that in this state, and i'm sure many others, gay sex and deviant sex (such as anal) is illegal.

    Apparently, under my state law, I (a third year college student) can't have anal or sleep with another man, but I can legally and within my rights bust the hymen of a middle schooler.

    Am I the only one that sees a problem with this?
    Posted in: Talk and Entertainment
  • posted a message on Just a small rant.
    Ehh, Honda Nighthawks are both cheap and popular; by no means rare. I'd doubt it was a collector.
    Posted in: Talk and Entertainment
  • posted a message on What to spend 1k on?
    Buy me a new car battery. Some of us have financial obligations and it's hard to buy things like new car batteries.

    Good for you for being mister money bags, though...

    I'd get a PS3 and a netflix subsrciption if I had money to burn. Hours of entertainment between streaming video and Call of Duty.


    Hit up a pick n' pull lot. You could usually get a fairly new battery out of a junked car for a third of the price the manufacturer will charge (assuming you don't have a passably rare vehicle). Find a friend who knows how to put it in if you don't.

    I'd invest. Economy's in the ☺☺☺☺ter, houses are pretty cheap. Buy some stock in a real estate company and wait a few years. I'm just speculating, though, and there are probably much better stocks.

    If you're feeling more materialistic, buy something you can use over and over again. A TV or a next gen game system would be a good idea.

    Or a few hookers. /spam
    Posted in: Talk and Entertainment
  • posted a message on I hate Breast Cancer Awareness Month.
    Quote from Galspanic
    As a 33 year old guy that already has to get them every a year until the inevitable positive test comes in, I do not think you are funny. Thanks Dad, Grandpa Ted, Grandpa Forrest, Uncle Jeff, Uncle Steve, and Great-Grandpa Wilberforce for all getting prostate cancer before you were 50. Because of you I started getting probed once a year when I was 29. And I don't enjoy it... or do I?


    Tell me about it. Not even remotely to close to being as sever as cancer, but i've got severe hemorrhoids. I'm a 19 year old get getting fingered by a meat-handed doc now and again. It's rather unpleasant.
    Posted in: Talk and Entertainment
  • posted a message on B/W Sun Titan Control w/ Landfall
    Well, I apologize in advance if this is already up somewhere. I've looked through a couple of pages of this forum, as well as the other two standard deck forums, so I hope this isn't a duplicate.

    This deck is primarily a black/white control deck. After messing around with a sacrifice deck, utilizing Sun Titan, I decided to go for a more control feel. With its ability to return sac engines like Fleshbag Marauder as well as lands, I figured a landfall deck would be great. The deck list is below, followed by individual choices, synergies, and strategies.



    Ok, so the general idea is to stall out and not use any permanent creatures under CMC 4. Using cards like Oblivion Ring, Inquisition of Kozilek, and Fleshbag Marauder help to keep you busy with disruption, while keeping you away from your own Day of Judgment. Then you start dropping bombs.

    Choices:

    Land:

    Tectonic Edge - Basically a little recurring cushion against Emeria, Valakut, and the occasional weak, multicolor manabase.

    Terramorphic Expanse - A little bit of mana fixing in a landfall-friendly package.

    Marsh Flats - Same as above.


    Creatures:

    Fleshbag Marauder - It's creature removal that takes itself off the field anyways, so doesn't really get hit by Day of Judgment. The ability to sacrifice Emeria Angel tokens instead, and recur through Sun Titan and Grim Discovery is fantastic.

    Emeria Angel - A great, in-color landfall abuser. I like her for the evasion aspect. Those birds get by a lot of the time, and tokens are always welcome to sacrifice to Feshbag, when i have no means of recurring him and would prefer to have the 3/1 body around.

    Ob Nixilis, The Fallen - Sick landfall trigger. Dropping him on turn 6, with a turn 7 Sun Titan is usually win. That's a possible 6 saclands, for a total of 18 damage, and a massive pump. He sways games so quickly, it's unbelievable. Great 6 drop after wrathing the field, and slapping a turn 5 Liliana Vess down to wreck their hand.

    Sun Titan - The inspiration for this deck. Recurs Fleshbag for a sacrifice every turn he attacks, recurs fetchlands to trigger both of the great landfall abusers, and recurs everything in the sideboard vs. decks that side in an answer to my answers game three.


    Other:

    Inquisition of Kozilek - A little bit of hand disruption early game. There's not much else to do while you patiently wait for aggro to dump all their stuff on the field.

    Sign in Blood - Much needed card draw. Also helps keep steady land drops to get to that almighty 6 mana.

    Grim Discovery - Creature recursion is fantastic. While Sun Titan and Ob Nixilis, the Fallen have decent bodies, spells like Terminate can wreck it. This helps to smooth out land drops, as well as recurring both Saclands and creatures.

    Liliana Vess - A great drop after a DoJ. She hits the field and wrecks their hand. The tutor effect is invaluable as well, allowing to search up the oblivion ring, sideboard answer (g2 and g3), and the single Suffer the Past, for when you've got all that mana and no way to win.

    Day of Judgment - Without any creatures that stick around under this CMC, it's a no-brainer. Well timed, it just wrecks most aggro builds, and buys enough time to drop the landfallers.

    Oblivion Ring / Suffer the Past - Tutor-able answer and alternate win condition, respectively.


    Sideboard:

    The sideboard options are pretty basic. Wall of Omens and Kor Firewalker come in against anything red, it's just too fast for this deck to get going. Pithing needle vs. manlands and planeswalkers. Luminarch Ascension comes in against the control matchups, and the single, tutor-able Relic of Progenitus comes in against random unearth decks. Like Vengevine. I despise Vengevine.


    Thoughts/Criticism?

    Playtesting is still in progress, but it's performing admirably. I would be happy to here your results / critique.

    Posted in: Standard Archives
  • To post a comment, please or register a new account.