# Need help with chess game

**URL:** <https://forum.makecode.com/t/need-help-with-chess-game/43900>\
**Category:** Help\
**Tags:** game\
**Created:** [May 8, 2026, 11:27pm UTC](https://forum.makecode.com/t/need-help-with-chess-game/43900 "2026-05-08T23:27:40Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThatCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thatcoder/32/29388_2.png) [@ThatCoder](https://forum.makecode.com/u/ThatCoder)\
**Post date:** [May 8, 2026, 11:27pm UTC](https://forum.makecode.com/t/need-help-with-chess-game/43900/1 "2026-05-08T23:27:40Z")

</div>

I need some help with my chess game, it’s been in development for about 3 months now. I’ve challenged myself to not use a SINGLE extension! I’ve run into an issue, where, no matter what I do, none of the pawns say they can take, even though they can. I even switched the “cantake” variable to false to see if that’ll fix it, but nothing changed, can anyone help? (Also, this post is the 4000th post with the “game” tag)

Project Link: [https://makecode.com/\_FY4Uq1g6Ya1j](https://makecode.com/_FY4Uq1g6Ya1j)

---

<div class="post-metadata">

**Author:** ![NeverStopTheCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/neverstopthecoder/32/21194_2.png) [@NeverStopTheCoder](https://forum.makecode.com/u/NeverStopTheCoder)\
**Post date:** [May 8, 2026, 11:58pm UTC](https://forum.makecode.com/t/need-help-with-chess-game/43900/2 "2026-05-08T23:58:26Z")

</div>

i think oh yeah let me call him in @Sofa has made a Chess game maybe he can help

---

<div class="post-metadata">

**Author:** ![Sofa](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sofa/32/30959_2.png) [@Sofa](https://forum.makecode.com/u/Sofa)\
**Post date:** [May 9, 2026, 12:00am UTC](https://forum.makecode.com/t/need-help-with-chess-game/43900/3 "2026-05-09T00:00:48Z")

</div>

Did Someone Summon me

---

<div class="post-metadata">

**Author:** ![Sofa](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sofa/32/30959_2.png) [@Sofa](https://forum.makecode.com/u/Sofa)\
**Post date:** [May 9, 2026, 6:52pm UTC](https://forum.makecode.com/t/need-help-with-chess-game/43900/4 "2026-05-09T18:52:51Z")

</div>

So what I used to do this was to add to my code

```typescript
// Normal move

            if (dx == 0) {

if (dy == dir && target.type == PieceType.None) valid = true;

else if (fy == startRow && dy == 2 \* dir && target.type == PieceType.None && board\[fx\]\[fy + dir\].type == PieceType.None) valid = true;

            }

// Capture

else if (Math.abs(dx) == 1 && dy == dir) {

if (target.side != Side.None && target.side != p.side) valid = true;

// En Passant check

else if (tx === lastPawnDoubleMoveX && ty === lastPawnDoubleMoveY) valid = true;

```

Sorry about all the spaces. I also see you cant Select black peices. (unless your adding some code where an Ai can play) So you can sort out your code and I really don’t mind if you add that code that I pasted in from my code. If that doesn’t work just tell me and I’ll give you a rundown.

---

<div class="post-metadata">

**Author:** ![ThatCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thatcoder/32/29388_2.png) [@ThatCoder](https://forum.makecode.com/u/ThatCoder)\
**Post date:** [May 11, 2026, 2:51pm UTC](https://forum.makecode.com/t/need-help-with-chess-game/43900/5 "2026-05-11T14:51:23Z")

</div>

I haven’t yet made selecting black peices possible, but it will be with player 2!

---

<div class="post-metadata">

**Author:** ![ThatCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thatcoder/32/29388_2.png) [@ThatCoder](https://forum.makecode.com/u/ThatCoder)\
**Post date:** [May 11, 2026, 2:51pm UTC](https://forum.makecode.com/t/need-help-with-chess-game/43900/6 "2026-05-11T14:51:26Z")

</div>

I’m not using javascript, can you show me how to do this is blocks?

---

<div class="post-metadata">

**Author:** ![Sofa](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sofa/32/30959_2.png) [@Sofa](https://forum.makecode.com/u/Sofa)\
**Post date:** [May 12, 2026, 3:56am UTC](https://forum.makecode.com/t/need-help-with-chess-game/43900/7 "2026-05-12T03:56:46Z")

</div>

Sorry I’m not good at blocks. When I first did coding I started with JavaScript because I was advanced in code. So sorry. But I can put that code into blocks if you need it.

---

<div class="post-metadata">

**Author:** ![NeverStopTheCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/neverstopthecoder/32/21194_2.png) [@NeverStopTheCoder](https://forum.makecode.com/u/NeverStopTheCoder)\
**Post date:** [May 12, 2026, 5:38pm UTC](https://forum.makecode.com/t/need-help-with-chess-game/43900/8 "2026-05-12T17:38:27Z")

</div>

the Math.abs is the absolute(number) blockthe Piece.Type.None seems to be a enum (the drop-down list) I’m not sure if that’s possible in blocks if and else if are the logic blocks the dy,dir,dx,fy,startRow etc look to be variables the / is the math block with (number) drop-down Menu(/) (number)

---

<div class="post-metadata">

**Author:** ![ThatCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thatcoder/32/29388_2.png) [@ThatCoder](https://forum.makecode.com/u/ThatCoder)\
**Post date:** [May 12, 2026, 6:03pm UTC](https://forum.makecode.com/t/need-help-with-chess-game/43900/9 "2026-05-12T18:03:03Z")

</div>

You can click the “blocks” button next to the “javascript” button to convert the code to blocks

---

<div class="post-metadata">

**Author:** ![NeverStopTheCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/neverstopthecoder/32/21194_2.png) [@NeverStopTheCoder](https://forum.makecode.com/u/NeverStopTheCoder)\
**Post date:** [May 12, 2026, 9:06pm UTC](https://forum.makecode.com/t/need-help-with-chess-game/43900/10 "2026-05-12T21:06:25Z")

</div>

yeah well not every block has a javascript counter part some only have JavaScript

---

<div class="post-metadata">

**Author:** ![ThatCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thatcoder/32/29388_2.png) [@ThatCoder](https://forum.makecode.com/u/ThatCoder)\
**Post date:** [May 13, 2026, 5:47pm UTC](https://forum.makecode.com/t/need-help-with-chess-game/43900/11 "2026-05-13T17:47:11Z")

</div>

@Sofa said he could put them in blocks if I want, which I do. I don’t think there are any blocks in his javascript code that cannot convert to blocks

---

<div class="post-metadata">

**Author:** ![MeatballDev](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/meatballdev/32/28502_2.png) [@MeatballDev](https://forum.makecode.com/u/MeatballDev)\
**Post date:** [May 13, 2026, 10:49pm UTC](https://forum.makecode.com/t/need-help-with-chess-game/43900/12 "2026-05-13T22:49:54Z")

</div>

i think the neural networks extension would help

---

<div class="post-metadata">

**Author:** ![Sofa](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sofa/32/30959_2.png) [@Sofa](https://forum.makecode.com/u/Sofa)\
**Post date:** [May 13, 2026, 10:51pm UTC](https://forum.makecode.com/t/need-help-with-chess-game/43900/13 "2026-05-13T22:51:58Z")

</div>

No I used javascript but when I try to convert it into blocks it pops up a bunch of problems  
If you want to see what happnes heres the code

> **[♟Chess Grandmaster♟By Sofa 5.0](https://arcade.makecode.com/S34866-90531-55332-14756)**
>
> Chess 5.0

---

<div class="post-metadata">

**Author:** ![ThatCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thatcoder/32/29388_2.png) [@ThatCoder](https://forum.makecode.com/u/ThatCoder)\
**Post date:** [May 14, 2026, 5:29pm UTC](https://forum.makecode.com/t/need-help-with-chess-game/43900/14 "2026-05-14T17:29:19Z")

</div>

I see

---

<div class="post-metadata">

**Author:** ![ThatCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thatcoder/32/29388_2.png) [@ThatCoder](https://forum.makecode.com/u/ThatCoder)\
**Post date:** [May 14, 2026, 5:29pm UTC](https://forum.makecode.com/t/need-help-with-chess-game/43900/15 "2026-05-14T17:29:28Z")

</div>

Is there anyone who can help in the blocks language?

---

<div class="post-metadata">

**Author:** ![ThatCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thatcoder/32/29388_2.png) [@ThatCoder](https://forum.makecode.com/u/ThatCoder)\
**Post date:** [May 26, 2026, 10:45pm UTC](https://forum.makecode.com/t/need-help-with-chess-game/43900/16 "2026-05-26T22:45:57Z")

</div>

Nevermind, it’s fixed now!

---

<div class="post-metadata">

**Author:** ![bobwdmai](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bobwdmai/32/34680_2.png) [@bobwdmai](https://forum.makecode.com/u/bobwdmai)\
**Post date:** [August 27, 2026, 10:33pm UTC](https://forum.makecode.com/t/need-help-with-chess-game/43900/17 "2026-08-27T22:33:05Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/d/f/df1afb51ac7026f8f844c0e00de8f4071e7ecd39.png)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/8/a/8a82e7e6b1f5ea58ed91b1a4ec6bc56cbf80fdbf.png)you can click on “exsplain with AI”
