Tim Chaung

Greenhorn
+ Follow
since Sep 19, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Tim Chaung

Ah, ok that makes sense... Should have known better too... I had to make a program that had cards, and a deck.... deck wasn't extended from card... deck was just an array of cards...

So in this case, twodice would simply contain two die. Literally.

again correct me if I'm wrong.
12 years ago
If you make the die.java correctly. To make twodie.java, all you need to do is extend it and then modify what's needed...
You can probably make a constructor to make all the possible sides. (probably array of size n) and then proceed to make other methods based on that....

Correct me if I'm wrong... I'm still relatively new.
12 years ago
I know it is in C/C++... and this naming style was recommended to me by my prof....

I'm chugging along nicely now.... I'll drop the interface here after the due date though.
12 years ago
@ Ritchie

What I meant as in, I plan it out, it works in theory. You write it, but you never really know if it works until you test it.

Well, at least from my view, I'm sure with practice I'll pass the "never really know" part...

On a side note, I've made progress on making my nodes class. I'm now stuck on writing my own "Next()" method to reference objects/nodes to each other.
12 years ago
I realized why Node didn't work.... I also have to make a Node class. Manually. My brain is fried....

My current attempt at making a Node class involves making a constructor, giving it an object.... However I'm unsure if this is a right path.... Trial and Error! The way of most programmers!
12 years ago
Not really related but _ shouldn't matter. It's a character right? o.O

And I'm not really allowed to change the method... It was an interface I was forced to implement.
12 years ago


Would casting it like



be a valid? It would keep it as whatever the object was, except now it's a node... so it can be referenced to another?
12 years ago
I feel like I'm doing something stupid.... but I'm unable to assign a Node an object..... what am I doing wrong?

I could use a MapSet but.... isn't that not the point of assignment? There isn't any rules against it.... or is there another way around this?
12 years ago
Thanks, I'll make some progress with this, and I don't like it when other people do the work for me since it makes me feel bad, and it also doesn't let me learn anything.
12 years ago
The program I'm required to do is to make a LinkedList. Manually.

The easiest way to do this is just to make a node since they can be referenced to each other.

The problem is that I have no idea how to start the head or even instantiate a node (I think). Yes, I've stared at the java API like a boss. I'm stuck...

Another issue is that after declaring it, I'm unable to stick an object into the node.... Help is greatly appreciated.
12 years ago
Is there a way to compare a large quantity of strings? Such as if you were to see if the user input string was a valid pet.

Is there a way to compare it to "dog" "cat" "bird" etc without using A LOT of if statements?

I could use string.split but then how exactly is that stored in an array?
12 years ago
I'm guessing at what you're trying to say....
and I think your problem is that in your second series of for loops.. you have
for (int row = 2; row > MIN_ROWS; row--)

it will make 3 stars because it takes 3 steps to get to below zero. changing it to a '>=' should fix it?
12 years ago

fred rosenberger wrote:it's kind of hard to tell you what you're doing wrong without you posting your code. we can only guess what you are doing, and odds are we are going to guess wrong.

If you have converted your String to a char[], then you don't need to convert that to a char again.

The only thing i can GUESS that you are doing is something like

myArray[1] == "a"

and yes, that will not work, because you are creating a String. if you want to compare a char to a char, you need to use single quotes:

myArray[1] == 'a'



I love you. said the random stranger on the internet. Thank you so much for clarifying this.
12 years ago
Yeah I JUST got the definition of primitives.... and I'm back to ground zero on the idea of counting the number of a certain character into a string...
So I has string blarg... convert it to a char array...

use charat to compare a element the char[] blarg to a character... <-- this is where I'm, stuck at.... again.... because it doesn't like the fact that the character "a" is a string. Would I then also convert that to a chararray?
12 years ago
Thanks for the welcome...

Oh and I'm forbidden to use that class in this assignment or at least discouraged to use it. ^___^;;;;;
12 years ago