# Help! I can't figure out why one program runs but another has errors

**URL:** <https://forum.makecode.com/t/help-i-cant-figure-out-why-one-program-runs-but-another-has-errors/22659>\
**Category:** Arcade\
**Tags:** game\
**Created:** [September 21, 2023, 6:14pm UTC](https://forum.makecode.com/t/help-i-cant-figure-out-why-one-program-runs-but-another-has-errors/22659 "2023-09-21T18:14:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MrDGuy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mrdguy/32/9274_2.png) [@MrDGuy](https://forum.makecode.com/u/MrDGuy)\
**Post date:** [September 21, 2023, 6:14pm UTC](https://forum.makecode.com/t/help-i-cant-figure-out-why-one-program-runs-but-another-has-errors/22659/1 "2023-09-21T18:14:44Z")

</div>

I am working with students and having them code the game of Pig with dice. I keep getting a Function Redeclaration error when I run identical Python code. I am working with students and they are typing the code line by line and I don’t know if this causes errors since they are not working with blocks.

[Code with Errors](https://makecode.com/_Hfxbrt2W05jp)

[Code with No Errors](https://arcade.makecode.com/S90490-33052-96507-09839)

---

<div class="post-metadata">

**Author:** ![Vegz78](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/vegz78/32/1201_2.png) [@Vegz78](https://forum.makecode.com/u/Vegz78)\
**Post date:** [October 5, 2023, 4:54pm UTC](https://forum.makecode.com/t/help-i-cant-figure-out-why-one-program-runs-but-another-has-errors/22659/2 "2023-10-05T16:54:23Z")

</div>

Welcome, @MrDGuy!

The erroneous code seems to contain in extension import of the whole project itself, called _dice-pig-assets-1_. This causes duplication of the whole code base, not only the function as in the error message(a student trying to take a short cut, maybe? 😉 )

Removing this extension from the _Explorer menu_ and then reimporting this seems to fix it.  
[https://github.com/microsoft/arcade-tutorial-extensions/adventure](https://github.com/microsoft/arcade-tutorial-extensions/adventure)

However, the code with no errors has also the extension _pxt-arcade-playing-cards_ imported.

Not sure if that is also needed in the one that had errors? But at least the errors are gone now, code seems to work without having done further investigations and you can convert the “typed” Python code back to blocks or JavaScript.

> **[Dice Pig Assets with Errors(FIXED?)](https://arcade.makecode.com/30727-06599-45556-19022)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.
