Search:

Type: Posts; User: dianac

Search: Search took 0.09 seconds.

  1. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,392

    [SOLVED] Re: Lagnton Ant

    how to do this?
  2. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,392

    [SOLVED] Re: Lagnton Ant

    package simulation;

    import core.Direction;

    /**
    *
    * Ant class
    *
    *
    */
  3. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,392

    [SOLVED] Re: Lagnton Ant

    package simulation;

    import core.Direction;

    /**
    *
    * Ant class
    *
    *
    */
  4. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,392

    [SOLVED] Re: Lagnton Ant

    Sorry, still in EAST:

    The member enum EAST can only be defined inside a top-level class or interface
    Syntax error, insert "EnumBody" to complete BlockStatements
  5. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,392

    [SOLVED] Re: Lagnton Ant

    package simulation;

    import core.Direction;

    /**
    *
    * Ant class
    *
    *
    */
  6. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,392

    [SOLVED] Re: Lagnton Ant

    It worked because I imported direction I suppose. That's why I don't understand. I have imported it as well in 24 and is showing error on EAST.
  7. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,392

    [SOLVED] Re: Lagnton Ant

    I am not sure. It is not showing any errors, but I did not run. It won't compile because it depends on Ant.java which is the one with this error on EAST
  8. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,392

    [SOLVED] Re: Lagnton Ant

    21 is in another class.

    Here is the one the is not working:

    package simulation;

    import core.Direction;


    /**
  9. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,392

    [SOLVED] Re: Lagnton Ant

    No need to answer my last question as I already imported Direction. I am trying to stub methods just to have the program running first. But I am having a problem.


    package simulation;

    import...
  10. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,392

    [SOLVED] Re: Lagnton Ant

    In:

    public void executeStep() {
    switch (originalDirection) {
    case NORTH:
    antcurrentI++;
    break;
    case SOUTH:
    antcurrentJ++;
    break;
  11. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,392

    [SOLVED] Re: Lagnton Ant

    public void executeStep() {
    switch (originalDirection) {
    case NORTH:
    antcurrentI++;
    break;
    case SOUTH:
    antcurrentJ++;
    break;
    case EAST:
    antcurrentJ++;
  12. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,392

    [SOLVED] Re: Lagnton Ant

    Now I defined it at the class level:

    public void executeStep() {
    switch (originalDirection) {
    case NORTH:
    antrow=antcurrentI+1;
    break;
    case SOUTH:
    antrow = antcurrentI-1;...
  13. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,392

    [SOLVED] Re: Lagnton Ant

    Thanks.

    But how to set this variables to the ants new position.

    to execute step i wrote:


    public void executeStep() {
    switch (originalDirection) {
    case NORTH:
  14. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,392

    [SOLVED] Re: Lagnton Ant

    It could go Right, Left, Below and Up.

    I know how to change rows and columns values, I just don't understan which variables refer to column and row in this code since I am supposed to follow what...
  15. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,392

    [SOLVED] Re: Lagnton Ant

    I have to fullfill with code a package called simulation with 3 classes. The first is in post 1

    Tha seconde is




    package simulation;

    /**
  16. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,392

    [SOLVED] Re: Lagnton Ant

    The idea is that the ant is in a 2 dim array, but no array is declared

    I don't understand this question:

    Would a move be to an adjacent square?
    Would there be 4 possible squares to move to...
  17. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,392

    [SOLVED] Re: Lagnton Ant

    I am starting with simulation on post 1, trying to do it by parts because I am really confused. I tried to write execute step, but I can't figure out how to make the ant move one step. I put switch...
  18. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,392

    [SOLVED] Re: Lagnton Ant

    This is the program


    package langton;

    import simulation.Ant;
    import simulation.Grid;
    import simulation.Simulation;
    import core.Direction;
  19. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,392

    [SOLVED] Re: Lagnton Ant

    Sorry for the lack of information
    The original position is 5,5
    Direction is



    package core;

    public enum Direction {
    NORTH, SOUTH, EAST, WEST;
  20. Thread: Lagnton Ant

    by dianac
    Replies
    41
    Views
    4,392

    [SOLVED] Lagnton Ant

    Hi I am a begginner in java and have an assignment to simulate a Langton Ant. Would like some help where to start.



    package simulation;

    /**
    *
    * Simulation class
    *
Results 1 to 20 of 20