Tomas Elpacio

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

Recent posts by Tomas Elpacio

Thanks, Peter, but it is not quite getting through my thick nugget. Would you mind showing me an example of what a decimal, let's say -7, would look like in binary code for a 32 bit program/machine. Thanks in advance.
22 years ago
Does anyone know where I can find info about doing decimal to binary conversions and vice-versa for negative numbers. I understand that the high-order bit determines if it is negative or not, but I have not seen any illustrations/diagrams of this, which would help me with the learning process. Thanks in advance.
22 years ago
Thanks for your responses Arun and Chad. I tried your suggestions but could not get it to work. Below is the code I currently have, along with the Shape and Box class from the Shapes example in the Code Barn. In the line where I create a new Box object, I currently draw the shapes by incrementing the variable 'i'. I'd like to be able to insert random values in here for the boxes' x,y,wide,high variables and run through 100 iterations of drawing random boxes. Seems like it should be easy to do, but my application of Java has left a bit to be desired thus far. Here is the code:

Any help would be much appreciated.
22 years ago
Hi Marilyn,
I apologize for not having better specifics for you as I have gone through multiple -- albeit unfruitful -- iterations, since I posted my last message. I was receiving an error message about not being able to "de-reference" a double. The crux of my problem is that I am trying to find a way to randomize any of the Box, Circle, or Poly objects in the Shapes sample code, and cannot do it. I was hoping to make a sort of kaleidoscope with random Shape patterns --- kind of like a poor man's version of a Pink Floyd laser light show, but to no avail.
22 years ago
I have been toying around with the Shapes code in the code barn, and have run into a bit of a snag. In the ShowShapes class I am trying to generate and use random numbers for at least one of the Box objects and have been getting errors. I am using Math.random to generate the random double and then using intValue to downcast it to an integer. Any guidance someone can provide would be most helpful. Thanks.
22 years ago