[ITEM]
14.04.2020
14

Avocado ragdoll fighter 3. Daddy long legs poison. As a natural extension of offering Personal Protection Equipment, Combat Solutions offers a myriad of Specialty Training and Security Support Services to those in need of education and protection in applicable high threat situations.

HOME



codecombat is a coding tool that teachers use to let their students know how to code by playing a game. You're trying to code your hero so you can pass certain levels. There's a lot of different courses that your teacher will post in your student dashboard. In this website, you are going to be looking at the answers of computer science #3. There's 62 levels in total in this course but I have not finished them all. But if I finish a level, I will immediately update the website. GOOD LUCK! HAVE FUN!


level 1: FRIEND AND FOE (GOAL: rally the troops)
# Peasants and peons are gathering in the forest.
# Command the peasants to battle and the peons to go away!
while True:
friend = hero.findNearestFriend()
if friend:
hero.say('To battle, ' + friend.id + '!')
# Now find the nearest enemy and tell them to go away.
enemy = hero.findNearestEnemy()
if enemy:
hero.say('To battle, ' + enemy.id + '!')

level 2: DEJA BREW (GOAL: sing along)

# You can add strings together, and add numbers into strings.
# Sing along, using string concatenation:
# X potions of health on the wall!
# X potions of health!
# Take Y down, pass it around!
# X-Y potions of health on the wall.
potionsOnTheWall = 10
numToTakeDown = 1
while True:
hero.say(potionsOnTheWall + ' potions of health on the wall!')
# Sing the next line:
hero.say(potionsOnTheWall + 'potions of health!')
# Sing the next line:
hero.say('Take' + numToTakeDown + 'down, pass it around!')
potionsOnTheWall -= numToTakeDown
# Sing the last line:
hero.say(potionsOnTheWall + ' potions of health on the wall.')


level 3: REWARD AND RUINATION (GOAL: collect all the gems and defeat all the peons)
# It seems like the Ogre Chieftain is stealing your gems!
# Use the two artillery cannons for your goals.
while True:
enemy = hero.findNearestEnemy()
if enemy:
enemyPos = enemy.pos.x + ' ' + enemy.pos.y
hero.say('Enemy at ' + enemyPos)
# Now that you have sweet revenge,
# why not have your cake and eat it, too?
# Find the item's position and
# say it for your artillery to target.
item = self.findNearestItem()
if item:
itemPos = item.pos.x + ' ' + item.pos.y
self.say('Item at ' + itemPos)


Concept challenge: AIR RESCUE SERVICE (GOAL: HUMANS MUST SURVIVE; EVACUATE 7 PEASANTS)
# To save a friend: say 'Friend ' followed by the friend's id property.
# To zap an enemy: say 'Enemy ' followed by the enemy's id property.
while True:
enemy = hero.findNearestEnemy()
if enemy:
hero.say('Enemy ' + enemy.id)
friend = hero.findNearestFriend()
if friend:
hero.say('Friend ' + friend.id)

level 4: THE WIZARD'S DOOR (GOAL: DISCOVER THE DOOR TO THE WIZARDS LAIR)
# Move to 'Laszlo' and get his secret number.
hero.moveXY(30, 13)
las = hero.findNearestFriend().getSecret()
# Add 7 to 'Laszlo's number to get 'Erzsebet's number.
# Move to 'Erzsebet' and say her magic number.
erz = las + 7
hero.moveXY(17, 26)
hero.say(erz)
# Divide 'Erzsebet's number by 4 to get 'Simonyi's number.
# Go to 'Simonyi' and tell him his number.
sim = erz /4
# Multiply 'Simonyi's number by 'Laszlo's to get 'Agata's number.
# Go to 'Agata' and tell her her number.
hero.moveXY(30, 39)
hero.say(sim)
hero.moveXY(43, 26)
hero.say('2')


level 5: THE WIZARD'S HAUNT (GOAL: DISCOVER THE GATE TO THE ASTRAL PLANE)
# Move to 'Zsofia' and get the secret number from her.
hero.moveXY(18, 20)
zso = hero.findNearestFriend().getSecret()
# Divide 'Zsofia's number by 4 to get 'Mihaly's number.
# Move to 'Mihaly' and say his magic number.
mih = zso / 4
hero.moveXY(30, 15)
hero.say(mih)
# Divide 'Mihaly's number by 5 to get 'Beata's number
bea = mih / 5
# Move to 'Beata' and say her magic number.
hero.moveXY(42, 20)
hero.say(bea)
# Subtract 'Beata's number from 'Mihaly's to get Sandor's number.
# Move to 'Sandor' and say his magic number.
san = mih - bea
hero.moveXY(38, 37)
hero.say('8')


level 6: THE WIZARD'S PLANE (GOAL: FIND THE HIDDEN GOLD)
# Move to 'Eszter' and get the secret number from her.
esz = hero.findNearestFriend().getSecret()
# Multiply by 3 and subtract 2 to get 'Tamas's number.
# Remember to use parentheses to do calculations in the right order.
tam = (esz * 3) - 2
hero.say(tam)
# Subtract 1 and multiply by 4 to get 'Zsofi's number.
zso = (tam - 1) * 4
hero.say(zso)
# Add 'Tamas's and 'Zsofi's numbers, then divide by 2 to get 'Istvan's number.
ist = (tam + zso) / 2
hero.say(ist)
# Add 'Tamas's and 'Zsofi's numbers. Subtract 'Istvan's number from 'Zsofi's. Multiply the two results to get 'Csilla's number.
csi = (tam + zso) * (zso - ist)
hero.say(csi)


level 7: COINCRUMBS (GOAL: THE OGRE MUSTN'T CATCH THE HERO; ESCAPE FROM THE STORE)
# Follow the trail of coins to the red X at the exit.
while True:
item = hero.findNearestItem()
# This stores the item's pos, or position in a variable.
# Put the X and Y coordinates of the item into variables.
itemY = itemPosition.y
hero.moveXY(item.pos.x, item.pos.y)


level 8: WHITE RABBIT (GOAL: ESCAPE FROM THE MAZE)
# This finds the nearest item.
if item:
# This stores the item's pos, or position in a variable.
# Put the X and Y coordinates of the item into variables.
itemY = itemPosition.y
hero.moveXY(item.pos.x, item.pos.y)




enemy = hero.findNearestEnemy()
if enemy:
item = hero.findNearestItem()
# If you see a coin or a gem - move to it's X and Y position:
hero.moveXY(item.pos.x, item.pos.y)


level 10: BACKWOODS BOMBRAIDER (GOAL: EXPLORE THE OGRES)
# The pos property is an object with x and y properties.
# pos.x is a number representing the horizontal position on the map
# pos.y is a number representing the vertical position on the map
while True:
if enemy:
# Get the enemy's y position!
hero.say(x + ',' + y)
hero.say('Cease' + ' ' + 'Fire!')


level 11: COINUCOPIA (GOAL: USE FALGS TO COLLECT AT LEAST 20 GOLD) (you have to play this yourself, you don't have to change the code)
# Flag buttons appear in the lower left after pressing Submit.
flag = hero.findFlag()
hero.pickUpFlag(flag)
hero.say('Place a flag for me to go to.')


level 12: COPPER MEADOWS (GOAL: USE FLAGS TO COLLECT ALL THE COINS)
# Use flags to move between meadows.

flag = hero.findFlag()
pass # `pass` is a placeholder, it has no effect.
hero.pickUpFlag(flag)
# Automatically move to the nearest item you see.
if item:
x = position.x
hero.moveXY(x, y)




















[/ITEM]
[/MAIN]
14.04.2020
55

Avocado ragdoll fighter 3. Daddy long legs poison. As a natural extension of offering Personal Protection Equipment, Combat Solutions offers a myriad of Specialty Training and Security Support Services to those in need of education and protection in applicable high threat situations.

HOME



codecombat is a coding tool that teachers use to let their students know how to code by playing a game. You're trying to code your hero so you can pass certain levels. There's a lot of different courses that your teacher will post in your student dashboard. In this website, you are going to be looking at the answers of computer science #3. There's 62 levels in total in this course but I have not finished them all. But if I finish a level, I will immediately update the website. GOOD LUCK! HAVE FUN!


level 1: FRIEND AND FOE (GOAL: rally the troops)
# Peasants and peons are gathering in the forest.
# Command the peasants to battle and the peons to go away!
while True:
friend = hero.findNearestFriend()
if friend:
hero.say('To battle, ' + friend.id + '!')
# Now find the nearest enemy and tell them to go away.
enemy = hero.findNearestEnemy()
if enemy:
hero.say('To battle, ' + enemy.id + '!')

level 2: DEJA BREW (GOAL: sing along)

# You can add strings together, and add numbers into strings.
# Sing along, using string concatenation:
# X potions of health on the wall!
# X potions of health!
# Take Y down, pass it around!
# X-Y potions of health on the wall.
potionsOnTheWall = 10
numToTakeDown = 1
while True:
hero.say(potionsOnTheWall + ' potions of health on the wall!')
# Sing the next line:
hero.say(potionsOnTheWall + 'potions of health!')
# Sing the next line:
hero.say('Take' + numToTakeDown + 'down, pass it around!')
potionsOnTheWall -= numToTakeDown
# Sing the last line:
hero.say(potionsOnTheWall + ' potions of health on the wall.')


level 3: REWARD AND RUINATION (GOAL: collect all the gems and defeat all the peons)
# It seems like the Ogre Chieftain is stealing your gems!
# Use the two artillery cannons for your goals.
while True:
enemy = hero.findNearestEnemy()
if enemy:
enemyPos = enemy.pos.x + ' ' + enemy.pos.y
hero.say('Enemy at ' + enemyPos)
# Now that you have sweet revenge,
# why not have your cake and eat it, too?
# Find the item's position and
# say it for your artillery to target.
item = self.findNearestItem()
if item:
itemPos = item.pos.x + ' ' + item.pos.y
self.say('Item at ' + itemPos)


Concept challenge: AIR RESCUE SERVICE (GOAL: HUMANS MUST SURVIVE; EVACUATE 7 PEASANTS)
# To save a friend: say 'Friend ' followed by the friend's id property.
# To zap an enemy: say 'Enemy ' followed by the enemy's id property.
while True:
enemy = hero.findNearestEnemy()
if enemy:
hero.say('Enemy ' + enemy.id)
friend = hero.findNearestFriend()
if friend:
hero.say('Friend ' + friend.id)

level 4: THE WIZARD'S DOOR (GOAL: DISCOVER THE DOOR TO THE WIZARDS LAIR)
# Move to 'Laszlo' and get his secret number.
hero.moveXY(30, 13)
las = hero.findNearestFriend().getSecret()
# Add 7 to 'Laszlo's number to get 'Erzsebet's number.
# Move to 'Erzsebet' and say her magic number.
erz = las + 7
hero.moveXY(17, 26)
hero.say(erz)
# Divide 'Erzsebet's number by 4 to get 'Simonyi's number.
# Go to 'Simonyi' and tell him his number.
sim = erz /4
# Multiply 'Simonyi's number by 'Laszlo's to get 'Agata's number.
# Go to 'Agata' and tell her her number.
hero.moveXY(30, 39)
hero.say(sim)
hero.moveXY(43, 26)
hero.say('2')


level 5: THE WIZARD'S HAUNT (GOAL: DISCOVER THE GATE TO THE ASTRAL PLANE)
# Move to 'Zsofia' and get the secret number from her.
hero.moveXY(18, 20)
zso = hero.findNearestFriend().getSecret()
# Divide 'Zsofia's number by 4 to get 'Mihaly's number.
# Move to 'Mihaly' and say his magic number.
mih = zso / 4
hero.moveXY(30, 15)
hero.say(mih)
# Divide 'Mihaly's number by 5 to get 'Beata's number
bea = mih / 5
# Move to 'Beata' and say her magic number.
hero.moveXY(42, 20)
hero.say(bea)
# Subtract 'Beata's number from 'Mihaly's to get Sandor's number.
# Move to 'Sandor' and say his magic number.
san = mih - bea
hero.moveXY(38, 37)
hero.say('8')


level 6: THE WIZARD'S PLANE (GOAL: FIND THE HIDDEN GOLD)
# Move to 'Eszter' and get the secret number from her.
esz = hero.findNearestFriend().getSecret()
# Multiply by 3 and subtract 2 to get 'Tamas's number.
# Remember to use parentheses to do calculations in the right order.
tam = (esz * 3) - 2
hero.say(tam)
# Subtract 1 and multiply by 4 to get 'Zsofi's number.
zso = (tam - 1) * 4
hero.say(zso)
# Add 'Tamas's and 'Zsofi's numbers, then divide by 2 to get 'Istvan's number.
ist = (tam + zso) / 2
hero.say(ist)
# Add 'Tamas's and 'Zsofi's numbers. Subtract 'Istvan's number from 'Zsofi's. Multiply the two results to get 'Csilla's number.
csi = (tam + zso) * (zso - ist)
hero.say(csi)


level 7: COINCRUMBS (GOAL: THE OGRE MUSTN'T CATCH THE HERO; ESCAPE FROM THE STORE)
# Follow the trail of coins to the red X at the exit.
while True:
item = hero.findNearestItem()
# This stores the item's pos, or position in a variable.
# Put the X and Y coordinates of the item into variables.
itemY = itemPosition.y
hero.moveXY(item.pos.x, item.pos.y)


level 8: WHITE RABBIT (GOAL: ESCAPE FROM THE MAZE)
# This finds the nearest item.
if item:
# This stores the item's pos, or position in a variable.
# Put the X and Y coordinates of the item into variables.
itemY = itemPosition.y
hero.moveXY(item.pos.x, item.pos.y)




enemy = hero.findNearestEnemy()
if enemy:
item = hero.findNearestItem()
# If you see a coin or a gem - move to it's X and Y position:
hero.moveXY(item.pos.x, item.pos.y)


level 10: BACKWOODS BOMBRAIDER (GOAL: EXPLORE THE OGRES)
# The pos property is an object with x and y properties.
# pos.x is a number representing the horizontal position on the map
# pos.y is a number representing the vertical position on the map
while True:
if enemy:
# Get the enemy's y position!
hero.say(x + ',' + y)
hero.say('Cease' + ' ' + 'Fire!')


level 11: COINUCOPIA (GOAL: USE FALGS TO COLLECT AT LEAST 20 GOLD) (you have to play this yourself, you don't have to change the code)
# Flag buttons appear in the lower left after pressing Submit.
flag = hero.findFlag()
hero.pickUpFlag(flag)
hero.say('Place a flag for me to go to.')


level 12: COPPER MEADOWS (GOAL: USE FLAGS TO COLLECT ALL THE COINS)
# Use flags to move between meadows.

flag = hero.findFlag()
pass # `pass` is a placeholder, it has no effect.
hero.pickUpFlag(flag)
# Automatically move to the nearest item you see.
if item:
x = position.x
hero.moveXY(x, y)