# I need help with cubic minefield

**URL:** <https://discourse.codecombat.com/t/i-need-help-with-cubic-minefield/12082>\
**Category:** Level Help\
**Created:** [August 3, 2017, 1:37am UTC](https://discourse.codecombat.com/t/i-need-help-with-cubic-minefield/12082 "2017-08-03T01:37:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajzachar](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/ajzachar/32/6644_2.png) [@ajzachar](https://discourse.codecombat.com/u/ajzachar)\
**Post date:** [August 3, 2017, 1:37am UTC](https://discourse.codecombat.com/t/i-need-help-with-cubic-minefield/12082/1 "2017-08-03T01:37:07Z")

</div>

i can’t figure out cubic minefield i can’t figure out 1 line of code ☹.

---

<div class="post-metadata">

**Author:** ![Hellenar](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/hellenar/32/9100_2.png) [@Hellenar](https://discourse.codecombat.com/u/Hellenar)\
**Post date:** [August 3, 2017, 2:42am UTC](https://discourse.codecombat.com/t/i-need-help-with-cubic-minefield/12082/2 "2017-08-03T02:42:23Z")

</div>

What is your current code? 🙂

---

<div class="post-metadata">

**Author:** ![ajzachar](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/ajzachar/32/6644_2.png) [@ajzachar](https://discourse.codecombat.com/u/ajzachar)\
**Post date:** [August 3, 2017, 12:11pm UTC](https://discourse.codecombat.com/t/i-need-help-with-cubic-minefield/12082/3 "2017-08-03T12:11:45Z")

</div>

![47 AM](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/2X/3/35255e0e326c60650fb0fa16053d7336ecce0f13.png)

---

<div class="post-metadata">

**Author:** ![Hellenar](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/hellenar/32/9100_2.png) [@Hellenar](https://discourse.codecombat.com/u/Hellenar)\
**Post date:** [August 3, 2017, 6:01pm UTC](https://discourse.codecombat.com/t/i-need-help-with-cubic-minefield/12082/4 "2017-08-03T18:01:25Z")

</div>

Look at the first function:

```python
def mult(number, times):
    total = 0 # have not multiplied yet
    while times > 0: # while you have not yet multiplied the number by the total amount of times
        total += number # because multiplication is just repeated addition
        times -= 1 # you've added the number one time, so subtract one from the number of times because it's already done
    return total # returns the product

```

Now look at your second function and answer the key questions I added to the code:

```python
def power(number, exponent):
    total = 1 # because exponents are repeated multiplication, you need to start with 1 unlike the first function, or else you just multiply by 0 over and over
    # You have not yet multiplied the number by itself for x (exponent) times. What do you do WHILE that is true?
        # Exponents are repeated multiplication. Look at the first function again. In there, you add and assign the number to the total. (For example, the total is 0 and the number is 3, so adding and assigning 3 to 0 will get you 3. Repeating the process will just keep adding 3 to the total, whatever it may be now.) Now do the same thing, but with multiplication instead of addition.
        # You have now successfully multiplied the number by itself once. Now make sure that you don't go looping forever by subtracting and assigning 1 to the exponent.
    return total # You are done calculating the answer! :D

```

Sorry for the long comments, but hope this helps! 🙂

---

<div class="post-metadata">

**Author:** ![ajzachar](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/ajzachar/32/6644_2.png) [@ajzachar](https://discourse.codecombat.com/u/ajzachar)\
**Post date:** [August 3, 2017, 9:49pm UTC](https://discourse.codecombat.com/t/i-need-help-with-cubic-minefield/12082/5 "2017-08-03T21:49:41Z")

</div>

i passed the level! thanks!

---

<div class="post-metadata">

**Author:** ![tv337](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/tv337/32/12147_2.png) [@tv337](https://discourse.codecombat.com/u/tv337)\
**Post date:** [May 8, 2020, 1:42pm UTC](https://discourse.codecombat.com/t/i-need-help-with-cubic-minefield/12082/6 "2020-05-08T13:42:18Z")

</div>

if you have good gear and over 1000 hp you can walk onto one mine and walk around its easy.
