Hey guys! I am currently new, 'cause I created an account a few minutes ago, and anyway, I need help! I wanted to start from the beginning. Just so you know, I am just a kid that is 8 years old. Here is the code:
# Get all your troops to the end of the path by passing over the mines.
# You can locate duds by finding the mines that have a value that is a prime number.
# Check the guide for clarification.
Please help! Oh yeah, I am NOT a subscriber, and don’t tell me to buy it because I am just a KID.
I am not that good at coding, but I want to learn! SO, Please help!
Welcome. I guess I’m a little confused. When you say you just created an account a few minutes ago, is that for CodeCombat or the Forum? That level is an advanced level and you have some good gear.
One way do complete this level is creating a huge list of all the Prime numbers to check against. I didn’t feel like trying to figure out an algorithm to find Prime numbers. Once you know what traps are duds, command your hero and friends to walk through them.
On a side note, is it alright if I remove the {SOLVED} from the title @The_Master_Coder? It’s clear this problem isn’t solved.
And, as Eric said, topics only close within 12 hours if it’s solved with the solution button that you can get by clicking on the three dots next to a post. Please only use this if the topic actually is solved.
Thank you,
Danny
Welcome to the forum, and well done for getting as far as you have (particularly if you’re 8 ). You should be able to solve this with good code and the equipment you have!
You want to write a function to check whether a number is prime. Two bits of information that will help:
You want to check whether your big number leaves a remainder when you divide it by a smaller number - if it divides exactly then the big number isn’t a prime. How do you check for a remainder?
You need to check all the small numbers from 2 upwards towards your big number, so you’ll need a for loop. However a hint - you only need to check up to the square root of the big number. So if you were trying to find out if 119 was prime, you’d only need to check the small numbers up to 10 (the square root of 119 is 10.9).
Have a go at writing some code, and post again if you’re stuck.
Actually @Deadpool198, I was trying to say that I solved it yesterday, but it said that I reached the limit of replying for one day and it muted me for the day. Sorry about that! but I am done with it.