salvin francis

+ Follow
since Jan 12, 2009
salvin likes ...
Eclipse IDE Google Web Toolkit Java
Forum Moderator
salvin francis currently moderates these forums:
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
(keep public parts private until JForum day)
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by salvin francis

Jim Venolia wrote:...Works because 90-99% of your board isn't going to change generation to generation.

Well, its not always about making it work. While your approach is correct, Liutauras rightly pointed out that you don't need 2 arrays to represent your data. Your data can be a single array.
All you need to do is to figure out the elements to delete or elements to add and update your data structure.

I don't know why you would create a new data structure to just update your current one.
2 days ago

ras oscar wrote:...I have written a batch file that changes to the current directory and then compiles the class containing main()...

Have you tried simply writing :

in your script ?
1 week ago

Pete Letkeman wrote:This depends on what IDE you are using ...

I suspect (I may be wrong), the OP is manually compiling it with javac.
1 week ago
Well that's an interesting question. However, I believe the answer can be simply verified by writing a short 3 line code.

Can you try it and share your experience with us ?
1 week ago

Zachary Kang wrote:I have not done any of it yet, for I am trying to understand how I would go about starting this.  What is the notation?  How would I write something like this?

Hi Zachary Kang,
Are you aware of the following ?
  • Writing a program that simply prints "Hello world"
  • Using variables in your code
  • Doing calculations on one variable and assigning the result to another
  • Using classes
  • Using methods

  • You may have to look at the java tutorials here: to learn the basics of Java.
    Keep us updated on your progress and we can help you out if you are stuck.
    1 week ago
    Let me understand correctly, if user enters : a=2, b=3, c=4, your program would do

    (3 * 3)– (4 *2 *4 ) = -23

    And your output will be "The equation has no real roots" since its negative 23.

    I would break your code into 3 parts:
    1. Taking entry from user for a,b,c
    2. Calculating equation result.
    3. Giving an output based on the result

    Which part are you stuck at ?
    What have you done so far ?

    Hint, You can use Math.sqrt() for the square root.
    2 weeks ago
    Or is it based on scanning the whole board and noting down items to be created, destroyed and then doing it 'all at once' ?
    2 weeks ago
    One thing that I am unable to understand about this game is that is there a sequence to the Rules application ?
    Specifically, I am looking at the Blinker (period 2) period oscillator in wiki.

    If this was the original state :

    Rule#1 says to kill (Any live cell with fewer than two live neighbors dies as if caused by underpopulation.)
    It should turn to:

    but wiki follows the Rule#4 first and then Rule#1 making it :

    2 weeks ago
    It uses the logic that a cell can be born only in the vicinity of live cells and not any other location on the board.
    3 weeks ago

    Carey Brown wrote:...Where I think your approach runs into difficulty is in generating new life where you must visit each cell to determine if it should be changed to a live cell. This would be trivial in a 2D array (array-of-arrays) but be much more difficult with your approach.

    I see what you mean. But here too I have a different approach in mind. I think that instead of checking all cells on the 'board' to see they are surrounded by 3 live neighbors one can do the following:
  • Get a list of all live cells
  • Loop and populate a list of adjacent 'dead' cells to the live ones (maybe a new method is needed in my interface "getAdjacentDeadCellsFor")
  • Loop through this deal cells list and check if any of them need to be born and add them

  • 3 weeks ago
    Just realized that "Generation" is a bad name since it may mean the verb "to generate" or the noun "Generation". Maybe I could think of some better name
    3 weeks ago
    Each game has it's own challenges.

    Here's my abstract thinking so far:

    3 weeks ago