Ok then i had an idea today that i would try and make a card game. Before I start programing the game properly i started experimenting with things. First i got it into my head that i would represent each card in the deck by using two arrays - one for suit and one for the card number.
Then i kind of just started jamming and learning. Here i was trying to make a way so that once the card had been dealt it wouldn't be dealt again. Anyway i'll post the code first before i continue.
There is one other class that has the main method, that starts another method that invokes the dealRandomCard method.
Please just think of this as a rough draft, more like a doodle. Or an experiment to see what is possible using array lists and arrays.
The problem is that when i compile and run the program (either in eclispe or using command promt, the program runs fine, but then one of my processors (i have a quadcore) maxes out to 100%, and then it stays there until i either close eclispse or exit the command prompt.
What an earth is going on? Why is it doing this?
Sorry if the code seems a bit random. Maybe i should add some comments to say what is doing what. Or maybe it will be obvious to a none beginner i don't know.
Then i kind of just started jamming and learning. Here i was trying to make a way so that once the card had been dealt it wouldn't be dealt again. Anyway i'll post the code first before i continue.
There is one other class that has the main method, that starts another method that invokes the dealRandomCard method.
Please just think of this as a rough draft, more like a doodle. Or an experiment to see what is possible using array lists and arrays.
The problem is that when i compile and run the program (either in eclispe or using command promt, the program runs fine, but then one of my processors (i have a quadcore) maxes out to 100%, and then it stays there until i either close eclispse or exit the command prompt.
What an earth is going on? Why is it doing this?
Sorry if the code seems a bit random. Maybe i should add some comments to say what is doing what. Or maybe it will be obvious to a none beginner i don't know.