Sorry for the false alarm but I still hope we can get the list of pet’s methods. Need help with a CodeCombat Python level This video shows you step-by-step how to beat this level from the Python Computer Science 2 course in CodeCombat.
16: 6321: NovemWhat is wrong with my code Python, Sand Snakes.
Related Topics Topic Replies Views Activity Metal Detector - Python. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. If our glasses doesn’t have findNearestItem/findNearestEnemy, than the pet can’t use it too, am I correct?Įdit: I reload the level and it works with the default code (pet.findNearestByType). Contribute to Metalero-py/CodeCombat-ComputerScience3-python development by creating an account on GitHub. CodeCombat Discourse Metal Detector - Help Needed. A tag already exists with the provided branch name. In the previous levels I think it depends on our glasses. Var soldier = pet.findNearest(hero.findByType("soldier")) Īlso, it would be helpful if we can get the list of methods our pet can do. var archer = pet.findNearest(hero.findByType("archer")) After that doesn’t work, I switch to hero.findByType. I’m not sure if pet also has findByType method. In CodeCombat, using strings and hero. Strings are structures of 'text inside quotes'.Students will use the string concatenation operator, + to build a longer string out of two shorter strings, or to combine a string and a variable. Var soldier = pet.findNearest(pet.findByType("soldier")) String concatenation is used to add, or combine, two strings together. Var soldier = pet.findNearestByType("soldier") īut the pet doesn’t seem to recognize this method (findNearestByType)? So I changed it to: var archer = pet.findNearest(pet.findByType("archer")) while True: enemy hero.findNearestEnemy () friend hero.findNearest (hero. In the default code, I have: var archer = pet.findNearestByType("archer") It won’t go left or right, even after I use pet.moveXY.