User Profile

Collapse

Profile Sidebar

Collapse
falconsx23
falconsx23
Last Activity: Nov 11 '09, 06:02 PM
Joined: Nov 15 '08
Location: Cleveland, Ohio
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Ok I finished my game of set. If anyone is still looking at this thread I just wanna say thanks for the help.

    GameOfSet Class
    Code:
    import java.util.Scanner;
    import java.util.*;
    import javax.swing.*;
    import java.awt.*;
    
    /**
     * Write a description of class GameOfSet here.
     * @author (Michael Brown) 
     * @version (a version number or a date)
     */
    public class GameOfSet
    ...
    See more | Go to post

    Leave a comment:


  • ok I figured that part. I just placed my program in a while loop using a Boolean.
    Now I need help with how can I actually determine a set. I just dont see how can I say if card one's color, number, and pattern equals card two's color , number, and pattern Then it is a set.

    By the look of this I know I have to use an if statement. I'm just dont know how to code it.

    Code:
      public void playGame()
          {
    ...
    See more | Go to post

    Leave a comment:


  • So far I got my game to ask a user to input a card to determine a set. It first asks the user to enter one card (0 - eleven making 12). It asks the user to enter one card and then another and then a third card.

    What I am stuck on is how do I get my program to ask the user to enter again if the user enters the wrong data. For instance the only way you can enter card one is by typing one. If the user enters 1 or fg instead of one, how...
    See more | Go to post

    Leave a comment:


  • Thanks I got that part done. Now Im trying to have the program ask the user to enter an actually set. For 3 cards to form a set they must be all different or all alike within each category. For example.

    Code:
    0  number:3 color:green pattern:open shape:squiggle 
    1  number:1 color:red pattern:open shape:diamond 
    2  number:1 color:purple  pattern:solid shape:squiggle 
    3  number:1 color:green pattern:striped shape:diamond
    ...
    See more | Go to post

    Leave a comment:


  • Ok what you are saying is making a little more sense. But before I am able to fully understand what you are saying,


    Code:
        ArrayList<Card> randomCards = createRandomNumberOfCards();
        for(int i= 0; i < randomCards.size(); i++){
           String cardDetails = randomCards[i].toString();
           System.System.out.println(cardDetails);
        }
    where should this be placed. To...
    See more | Go to post

    Leave a comment:


  • Yes, but in my public ArrayList<Card> createRandomNum berOfCards()method I have 12 random cards being created. Which means my randomCards arrayList holds 12 random cards from the deck of cards arrayList.

    So what I am trying to say is I am not sure how to print those 12 random cards from the randomCards ArrayList using the toString method.

    Here is what I doing now
    Code:
       public String toString ()
    ...
    See more | Go to post

    Leave a comment:


  • Before I explain what I am stuck on, I will try to explain what I do. I agree with you Jos that going with the ToString method. Just in case you didn't know I have another class named Card, which is for creating a Card. I think it will make sense if I place the toString method inside the card class. I will use the toString method to create 12 random cards.

    Then, inside my GameOfSet class I will create a main method to call the toString...
    See more | Go to post

    Leave a comment:


  • Ok its been about three weeks since we talked about this program. I made a couple of adjustments like creating the deck of cards inside the constructor and creating a method that creates 12 random cards. Each card that is created randomly will be different meaning each card will have a different number, color, pattern and shape.

    Now I am trying to create the actual play of the game. I am going to have the game played by using the...
    See more | Go to post

    Leave a comment:


  • Ok Thanks for the response I can probably figure it, Ill get back to you if i am still stuck
    See more | Go to post

    Leave a comment:


  • Yes I am following you so far. I did create a seperate class called Card like you said here is the code for it just in case you need to see it:

    Code:
    public class Card
    {
        public String number;        
        public String color;   
        public String pattern;
        public String shape;
        
        public Card(String number, String color, String pattern, String shape)
        {
    ...
    See more | Go to post

    Leave a comment:


  • No we have not learned about scopes yet nor recursion. And yes what you are saying about for each possibility create 1 card and add it to the ArrayList<Card> that represents the deck of cards is what I was trying to do.

    That was what I am stuck on. I wasn't sure how to set up the for loops and also where to place the add method to add the card that is created to the deck.

    I am thinking that I should only have...
    See more | Go to post

    Leave a comment:


  • Ok Frinavale, while I was working on this program my Lab Teacher Assistant suggested that using nested for loops will help me out, and what I have up there he said I was on the right track. Also keep in mind that I am still a beginner at Java and no expert. So what may be obvious to you is not to me and I apologize for that.

    JosAH thanks alot for the response and I will try out the way you did as soon as I can get my program up.
    See more | Go to post

    Leave a comment:


  • ok you are right that is bad programming on my part... sorry
    See more | Go to post

    Leave a comment:


  • Right now I want to just create a deck of 81 cards for that method. Im not sure If i should be returning anything yet. Also I am confused on the Enums link to help clean up the code. I will continue looking at it though.
    See more | Go to post

    Leave a comment:


  • Game of Set program, need help with for loop nesting and more

    I am making a game called Set, it is a card game: here is a brief description of the rules:

    The game of Set is played with 81 cards, each of which has 4 properties (number, pattern,
    color and shape). The number of objects is 1, 2, or 3. The 3 possible patterns are solid,
    striped, and open. The 3 possible colors are red, green, and purple. The 3 possible
    shapes are diamond, squiggle, and oval. The 81 cards comprise...
    See more | Go to post

  • falconsx23
    replied to Phone directory remove directory
    in Java
    Well besides making an array list, is there anyway that I can remove an entry. I was thinking of another idea where I could overwrite an element in the array. Like it searches for a name, once the array is found, it takes the name before the found name and replaces moves it up. For instance:

    Bob, Ray, Jill

    Ray was found, but the remove method allows Bob to replace Ray, thus making it

    Bob, Bob, Jill
    See more | Go to post

    Leave a comment:


  • falconsx23
    replied to Phone directory remove directory
    in Java
    Ok if that is what is wrong, then How can I make it delete the entry? I thought decrementing the size of the array would be deleting an entry out of the array. Or do I just decrement the size? Im confused.
    See more | Go to post

    Leave a comment:


  • falconsx23
    started a topic Phone directory remove directory
    in Java

    Phone directory remove directory

    I am trying to write a code for a Phone Directory program. This program is suppose to allow the user to enter a name or directory and then program can either add, save or even delete an entry. Also this program has more then one class and also uses an interface. Right now I am working on
    ArrayBasedPD class. I am trying to write a code for the remove method (line 158) that allows the user to enter a name, once the program sees that the name...
    See more | Go to post

  • Ok I believe I have it now. I did make a while loop and inside that while loop I also had the number of guesses incremented. So the program would also have output how many times the user tried to guess the correct number.


    Code:
    import java.util.*; 
      
    public class GuessingGame 
    {    
        int maxNumber;     
    /** 
     * Constructor setting the input number 
     * and the max number
    ...
    See more | Go to post

    Leave a comment:


  • Ok I understand what you are saying, but what do you mean by "make sure you save it."
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...