# Help me! (pls)

**URL:** <https://forum.makecode.com/t/help-me-pls/19685>\
**Category:** Help\
**Created:** [May 4, 2023, 8:45pm UTC](https://forum.makecode.com/t/help-me-pls/19685 "2023-05-04T20:45:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChimbroDaPro](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/chimbrodapro/32/15852_2.png) [@ChimbroDaPro](https://forum.makecode.com/u/ChimbroDaPro)\
**Post date:** [May 4, 2023, 8:45pm UTC](https://forum.makecode.com/t/help-me-pls/19685/1 "2023-05-04T20:45:22Z")

</div>

Hi y’all!

So… I need help. I’m making this territorial game where at the end of the game, the amount of territory the player has is counted, and the player with the most territory wins! The only problem… I don’t know how to count the amount of specified tiles in a tilemap!  
Pls help… 😢

---

<div class="post-metadata">

**Author:** ![BoostedGames](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/boostedgames/32/29419_2.png) [@BoostedGames](https://forum.makecode.com/u/BoostedGames)\
**Post date:** [May 5, 2023, 3:48am UTC](https://forum.makecode.com/t/help-me-pls/19685/2 "2023-05-05T03:48:20Z")

</div>

maybe make a variable for each time a tile is taken then if taken lose one.

---

<div class="post-metadata">

**Author:** ![PixelDoodle](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/pixeldoodle/32/24129_2.png) [@PixelDoodle](https://forum.makecode.com/u/PixelDoodle)\
**Post date:** [May 5, 2023, 3:49am UTC](https://forum.makecode.com/t/help-me-pls/19685/3 "2023-05-05T03:49:55Z")

</div>

You can use a **FOR ELEMENT OF VALUE** block to determine how many blocks are in a game!

For example:

 ![Example](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/3/37c544d1f89a950b53af311620a6814ad2186d28.jpeg)

This should count how many blocks are in a Tilemap!

---

<div class="post-metadata">

**Author:** ![Blobbey](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/blobbey/32/20831_2.png) [@Blobbey](https://forum.makecode.com/u/Blobbey)\
**Post date:** [May 5, 2023, 3:51am UTC](https://forum.makecode.com/t/help-me-pls/19685/4 "2023-05-05T03:51:38Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/d/d763303bd912b9cad99a591bfb4c70f0b083dd6c.png)  
This should work! 🙂

---

<div class="post-metadata">

**Author:** ![randomuser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/randomuser/32/32505_2.png) [@randomuser](https://forum.makecode.com/u/randomuser)\
**Post date:** [May 5, 2023, 3:53am UTC](https://forum.makecode.com/t/help-me-pls/19685/5 "2023-05-05T03:53:43Z")

</div>

Ah this is pretty easy! You take the length of the array of all of that tile. The ‘Array of all \_ tiles’ block should be in the tilemap catagory, and the ‘length of array’ should be in the array catagory. (Explaining because i’m too lazy to make it and screenshot lol)

---

<div class="post-metadata">

**Author:** ![ChimbroDaPro](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/chimbrodapro/32/15852_2.png) [@ChimbroDaPro](https://forum.makecode.com/u/ChimbroDaPro)\
**Post date:** [May 5, 2023, 3:49pm UTC](https://forum.makecode.com/t/help-me-pls/19685/6 "2023-05-05T15:49:23Z")

</div>

Oooh! Thank you! This seriously helps!

---

<div class="post-metadata">

**Author:** ![PixelDoodle](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/pixeldoodle/32/24129_2.png) [@PixelDoodle](https://forum.makecode.com/u/PixelDoodle)\
**Post date:** [May 8, 2023, 4:38pm UTC](https://forum.makecode.com/t/help-me-pls/19685/7 "2023-05-08T16:38:00Z")

</div>

Never knew about this method! Guess This helps me with something to!
