Prime Pathing PLZ help... [Python]

You did not understand what I said. number = mine.value. You have to use the format range(x,y), not a single number. Furthermore, you haven’t checked if the modulo of the trap value and i is equal to 0. If it is 0, then return False, not True. Otherwise, return True.

1 Like

Like this?:

def checkIfPrime(number):
    for i in range(2,(number**0.5)):
        if number % i == 0:
            return False
    return True

Mumbo_6

Isn’t that just the first function you used? :rofl:
Replace the range(2,(number**0.5)) with range(2,number):, and also add a check to return False if the number is less than or equal to 1 at the very start of the function. Then, put an else statement after that if statement and drop that for loop in the else statement. Make sure to return True only if doing number % i == 0 isn’t true.

1 Like
def checkIfPrime(number):
    if number <= 1:
        return False
    else:
        for i in range(2,number):
            if number % i == 0:
                return False
        return True

Seems correct. Have you tried running the code?

1 Like

It works, but now were back to my first problem: I can get past the top mines, but not the bottom ones.

Mumbo_6

1 Like

Maybe try using your own code? Leaving this to @xython to say something. :slight_smile: I feel pretty disappointed. All I’ll say is that you’d probably want to create a function to check the dud, and another to command the troops to the dud.

1 Like

I wrote the code myself. I dont even know how to go to github to get free codes.

Also, why does everyone think I copied every single level help code I have from GitHub? Can anyone explain? @xython also accused me for this when I needed help on Kelvintaph Defiler.

Sincerely,
Mumbo_6

Who said everyone?

2 Likes

“everyone” is an exxageration. You dont say: @… and @… also @… accused this, because it would be way to long and you also want to mention specific people when it comes to “negative” feedback.

Mumbo_6

Yeah, I understand, just…

1 Like

Same amount of spacing. Same variable naming. Same coordinates. Literally the same code…

2 Likes

look, Ill add you to a discussion by @AnSeDra and me, so that you can see why I have the same code. Please do not tell what you see in the chat in public. I will not trust you anymore if you do.

1 Like

I’m a bit confused here. If Mumbo did copy the code then why wouldn’t he (you) copy all of it? It doesn’t make sense. And if you could have, but you chose to try and understand it, then I respect that :smile:. Please do tell the truth and it will make more sense for everyone…
Thanks
Danny

3 Likes

@xython Why did you check these things? They are my privacy. When did I brag about how good I am in school?

someone please close this topic, I do not want to continue this discussion @Deadpool198? @Chaboi_3000?