️ Code CHESS in JavaScript (Super simple!)

️ Code CHESS in JavaScript (Super simple!)

Code with Ania Kubów

1 год назад

137,351 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Aayush Prakhar
Aayush Prakhar - 09.11.2023 10:40

why did you make your videos unavailable??????

Ответить
Jankoholic
Jankoholic - 07.11.2023 00:09

i appreciate people using more and more javascript, keep up the good work!

Ответить
yuri g0n
yuri g0n - 03.11.2023 02:02

muito foda, very foda, vou fazer um projeto assim.

Ответить
Haroon Khan
Haroon Khan - 26.10.2023 22:19

I can’t add the svg into my JavaScript file

Ответить
MrMacIsaac
MrMacIsaac - 22.10.2023 04:58

Everything you provide our community is pure gold!Thank you Ania!!!

Ответить
Gebretnsae Sibhatu
Gebretnsae Sibhatu - 21.10.2023 17:10

Impressive Ania,
Could you make them into all in one game zone including the admin dashboard?

Ответить
Atiq
Atiq - 18.10.2023 03:43

Love from 🇧🇩

Ответить
Rishabh Thapliyal
Rishabh Thapliyal - 13.10.2023 22:15

your rook's logic is wrong ... i am damn sure

Ответить
Chetan Rathi
Chetan Rathi - 09.10.2023 11:16

can't decide what is more beautiful, you or the code. So, i watched the video twice, once for the code and second time i just looked at you... So distracting...

Ответить
Veljko Marković
Veljko Marković - 06.10.2023 13:57

You really should not code logic for figures in that way it is obvious that it is too repetitive and redundant and hard to debug, and when there is repeating you should be using loops.

example for bishop :


case 'bishop':
// Calculate the difference between the target and start squares
const diff = Math.abs(targetId - startId);

// Check if the move is along a diagonal (difference is a multiple of width + 1 or width - 1)
if (diff % (width + 1) === 0 || diff % (width - 1) === 0) {


const step = diff % (width + 1) === 0 ? (width + 1) : (width - 1);

// Determine the direction of the step (positive or negative)
const direction = targetId > startId ? 1 : -1;

// Loop through each square along the diagonal to check for blocking pieces
for (let i = startId + step * direction; i !== targetId; i += step * direction) {
const square = document.querySelector(`[square-id="${i}"]`);

// If a square contains a piece, the path is blocked
if (square.firstChild) {
return false;
}
}


return true;
}


return false;

Ответить
lolmolsol
lolmolsol - 01.10.2023 21:33

i thought we would write html and style with grid css

Ответить
DAS
DAS - 30.09.2023 05:52

Did you ever do a follow up for check logic? I was thinking of making chess in something (JS made sense so I'd have a GUI), but the thing I was finding the most difficult was determining what moves were legal, mainly due to stuff like pins on the king.

Ответить
Ansh Vashisht
Ansh Vashisht - 22.09.2023 21:28

i need to pay 499 dollars to access the source code?

Ответить
Delta Force
Delta Force - 18.09.2023 23:23

Thank you Madam !! i was dreaming with this chess program !! i will do it !!

Ответить
calmggfdhotmail caprgglh
calmggfdhotmail caprgglh - 12.09.2023 09:36

Hello, could you add subtitles in your language and then translate it into my language, your class is very interesting, thank you

Ответить
UnathiGX
UnathiGX - 03.09.2023 12:52

Red and mud-brown?

Ответить
codewithmoiz
codewithmoiz - 30.08.2023 21:37

I've just found one gem of a playlist. Very thankful!

Ответить
Benyamin
Benyamin - 28.08.2023 11:39

té surman 1 trap toa mé ze te ve kom proféseur tte ma vi keur keur lodeur de ta kilot hmmmmmmmm

Ответить
Divyansh Jitpure
Divyansh Jitpure - 26.08.2023 16:23

does someone have the complete code from this video

Ответить