Sam Thompson

Ranch Hand
+ Follow
since Jul 05, 2011
Cows and Likes
Cows
Total received
1
In last 30 days
0
Total given
0
Likes
Total received
2
Received in last 30 days
0
Total given
3
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sam Thompson

COW..abunga dude!
Thank You! XD
4 years ago
Thanks for the suggestions. I will keep that in mind.

I am always learning new things with programming, no matter how long I have been doing this
4 years ago
OMG... i just realized what the problem is everyone.

In the method, I AM using it wrong.

Line 20 should read:


when it should REALLY say:



Welll dont i feel stupid...

Thanks everyone for your help!
S.T.
4 years ago
So what do you folks suggest I do instead then?

Because I still need that random number value to deal out a random card from the deck.

Thank you!
S.T.
4 years ago
Sure thing:

javac "Sim_Actions.java" (in directory: /media/sdl5384/TI10690800E/Users/SamuelDavid/Dropbox/Projects and curiosities/Uno)
Sim_Actions.java:20: int cannot be dereferenced
randomCard = this.randNumGen(0, randomCard.size());
^
1 error
Compilation failed.


Thanks in advance!
S.T.
4 years ago
Hey all:

I am currently writing a program for simulating an UNO card game and I am having some difficulty with writing a couple a methods in terms of dealing and shuffling the decks. My code is provided below:

To make it short and sweet... the problem the compiler has is in the randomDeal() method. The compiler says that an int cannot be dereferenced. I know it's something simple I am forgetting but I can't for the life of me figure it out. It has to be something simple that I am missing or forgetting. Does anyone have any ideas?

All your suggestions/help/improvements are greatly appreciated!

Thanks in advance everyone!
S.T.

My code:

4 years ago
Campbell:

Thanks for the response. Believe it or not, I HAVE read the documentation online about the OptionPane windows. But so far it hasn't helped all that much surprisingly.

Here is the error message I get so far (I am sorry if I didn't give this to you earlier.)


You ARE right about the return value. It was expecting that I do remember. I edited the code. Here it is below:


It still comes up with the same error message above.
Any thoughts?

Thanks in advance.

S.T.
6 years ago
Mike:

Thanks a bunch. Your suggestion worked.

I'll use that from now on. I kinda figured it had to be something simpler than what I was doing.

Thanks again

S.T.
6 years ago
Hi everyone:

I am writing a program that requires the use of JOptionPanes.

I do have to admit I am a little rusty because I haven't used it in a bit, so pardon my naivete.

The one pane I want to use is the showOptionDialog. So far it's having a problem with the code I wrote. Here is a snippet of what I have written for you.



What am I doing wrong exactly? How should it be written? I know many things have changed since Java 5. My IDE is still using Java 6 and I am trying to get it to use Java 7 as a default (any idea how to do that?)

Thanks everyone again for your time and help.

S.T.
6 years ago
Hi all:

I am currently writing a small program that will be stored on both my computers and will come up with a list of all the music files I have and store them in an ArrayList of type String.

I know how to import it- for the most part. However, I am having one problem with it so far. Every time I try to run it, I get this:



It says that Access is denied. Why? How do I get around this? My computer IS password protected. I put in a password every time I log on. Does that affect it somehow? Or is it something else that I am not realizing?
What can I do to get around this?

Here is the code:



Any help would be greatly appreciated.

Thanks again everyone!

S.T.
6 years ago
That's right.

I should be good now.

Mack thanks a bunch for your help.

Sam
6 years ago
Ohhhhhhhh.... Now I get what you're saying now.

And just to clarify, to set up each card's rank and suite, you would use a loop with something like this:

deck.get(i).ranks=I;
deck.get(I).suites=suite[j];

Correct?
6 years ago
Ok. How would the code look for a cell though?

So far, I've only heard cells being used in spreadsheets or database programming.

I'm sorry for sounding ignorant at times but I'm still an intermediate programmer haha.

S.T.
6 years ago
How would I create 52 cards in the deck without explicitly declaring them outside the arraylist?
6 years ago
Hi everyone:

I have written two separate classes. One for creating an object for a playing card, and the other for creating a "deck" of cards. So far everything seems to be okay- BUT I am having an issue with the constructor. How i can tell is that when I have the program print out each element, it turns out that it put DUPLICATES of the same element!!

Can anyone tell where I went wrong? Here is my code below:



and...



I went wrong somewhere. Has to be something simple I think. Because these classes are very simple.

Thanks for your help in advance everyone.

S.T.
6 years ago