#Java help with Clara

19 messages ยท Page 1 of 1 (latest)

devout fiberBOT
#

โŒ› This post has been reserved for your question.

Hey @coral goblet! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

#

Please format your code to make it more readable.
For java, it should look like this:
```โ€‹โ€‹โ€‹`โ€‹java
public void foo() {

}
โ€‹โ€‹โ€‹`โ€‹```

sullen island
#

why not just

while(!onLeaf()){
    if(!treeRight()){
        turnRight();
    }
    if(!treeFront()){
        move();
    } else {
        turnLeft();
    }
}

?

#

no need to check left

terse hearth
sullen island
#

which always works

terse hearth
#

no

sullen island
#

ah hold on

terse hearth
#

suppose this kind of corridor

+---+---+
|       |
+   +   +
|๐Ÿ€| ^ |
+---+---+

treeFront() false, move() (^)
treeFront() true, turnRight() (>)
treeFront() true, turnRight() (v)
treeFront() false, move() (v)
treeFront() true, turnRight() (<)
treeFront() true, turnRight() (^)
returned to start

sullen island
#

fixed

terse hearth
#

anyways it could be improved though, you have duplicate checks

terse hearth
sullen island
terse hearth
#

oh whoops

#

no that goes backwards

#

wait

#

i keep reading it as else if lmao

sullen island
#

it needs to go backwards if there's no other way