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

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 ?
3 days 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.
3 days 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 ?
3 days 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.
    1 week 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.
    2 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

  • 2 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
    2 weeks ago
    Each game has it's own challenges.

    Here's my abstract thinking so far:

    2 weeks ago
    While an initial idea comes to mind of creating a multidimensional array.
    I have a vague idea about having a map of 'live' Cells. Each Cell can have a simple Row,Column coordinates. Your game engine has to ensure that no 2 cells 'occupy' the same block (i.e. have the same cell coordinates) by setting the key of the Map to a unique value (maybe a string of row:col). A cell that dies should be removed from your Map and a cell thats born should be added to your Map.
    You can easily 'query' the cell above/below/left/right/diagonal, etc.. from this Map.
    2 weeks ago

    Liutauras Vilda wrote:salvin, I like how we programmers are so protective about our code.

    It's a skillset one earns after countless debates with QA Some bugs are bugs. Some bugs are undiscovered surprise features.
    2 weeks ago