Тёмный

How to Build Sudoku JavaScript Tutorial 

Kenny Yip Coding
Подписаться 23 тыс.
Просмотров 47 тыс.
50% 1

A beginner friendly tutorial on how to code sudoku in javascript! How to build a sudoku game in javascript!
Code: github.com/ImKennyYip/Sudoku
Demo: imkennyyip.github.io/Sudoku/
Website: www.kennyyipcoding.com/
Java Game Programming Projects Playlist:
• Java Game Programming ...
JavaScript Game Programming Projects Playlist:
• JavaScript Game Progra...
Subscribe for more coding tutorials 😄!
sudokuo.herokuapp.com/
var board = [
"--74916-5",
"2---6-3-9",
"-----7-1-",
"-586----4",
"--3----9-",
"--62--187",
"9-4-7---2",
"67-83----",
"81--45---"
]
var solution = [
"387491625",
"241568379",
"569327418",
"758619234",
"123784596",
"496253187",
"934176852",
"675832941",
"812945763"
]
#codesudoku #sudokujavascript #howtocodesudoku

Опубликовано:

 

3 фев 2022

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 56   
@KennyYipCoding
@KennyYipCoding 2 года назад
Check out the playlist of web project tutorials here! ru-vid.com/group/PLnKe36F30Y4bLhA-st9sC4ZthyV7nsL2Q Got a tutorial suggestion? Let me know down below!
@ajmkuba
@ajmkuba 2 года назад
Maybe u can show how to make button which solves it ?
@MahadGul-rh1co
@MahadGul-rh1co Год назад
Loved the tutorial! thank you for this. Keep doing great, would love to keep on watching more of your content.
@ruihenig
@ruihenig Год назад
Came across your channel. You explain so well. Thanks. I subscribed!
@davidgm7042
@davidgm7042 2 года назад
Bro I love your tutorials! You surely deserve more views!
@KennyYipCoding
@KennyYipCoding 2 года назад
Thanks man! Glad you found these tutorials helpful!
@MrEd-qc7vr
@MrEd-qc7vr Год назад
Oh this was so beautiful. I enjoyed every second of it. Gonna try to translate this into C#
@douglasvilela285
@douglasvilela285 2 года назад
very nice, trully loved these 'homeworks' ideas
@techlon
@techlon Год назад
creating a tutorial at 2am! legend :D
@saravananj3898
@saravananj3898 2 года назад
This helped me a lot !!!
@tylerbrown1089
@tylerbrown1089 11 месяцев назад
Thanks man!
@buseee5785
@buseee5785 Год назад
what is the usage of tileSelected in the code, cuz i haven't seen it used
@YacineZerimi
@YacineZerimi 11 месяцев назад
I'm more impressed that this is recorded at 3am
@adrielbermas2293
@adrielbermas2293 Год назад
Last with 3 dots function selectTile can you fix it to es6?
@fukyoutubestupidfuckinghandles
@fukyoutubestupidfuckinghandles 2 года назад
this saved my adv higher comp sci project
@talbahar5257
@talbahar5257 Год назад
Thanks You ! You help me a lot ! , can you explain how to do finish game when all the board = soluation ?
@erickdantecastellonjimenez7998
Please part 2 with notes and difficult selection
@lizel3324
@lizel3324 Год назад
Like it lots, thanks
@JerrySpann-fn4kw
@JerrySpann-fn4kw Месяц назад
In VS Code, once you create an html file, you can type a "!" and it will fill out your html boilerplate.
@deegas
@deegas Год назад
you are amazing! Thanks for Brazil
@martinmeland2029
@martinmeland2029 2 года назад
Can you explain to me what 'this' and 'null' means?
@julianmanera5427
@julianmanera5427 5 месяцев назад
hi bro, i have a question, for the sudoku of the end of the video, the full one, do you wrote by hand differents solutions and randomly choose one? or do you implement a function that generates differents digits distributions? hope you can response, greetings from Argentina!
@KennyYipCoding
@KennyYipCoding 5 месяцев назад
They are hardcoded puzzles that I put inside an array. This is more efficient for loading a game. You can create a script to generate puzzle designs but this should never be done in real time for a player.
@Lucifer009
@Lucifer009 Год назад
how can we add timer to this ??
@serhii_barabash
@serhii_barabash 5 месяцев назад
thanky 😃😃😃
@harelzharia1372
@harelzharia1372 2 года назад
why when i copy the exact code from the github, it dosent show any buttons?
@KennyYipCoding
@KennyYipCoding 2 года назад
you prob have a typo/missed something. But if you download the repo on github and open it, everything there works.
@yavuz7486
@yavuz7486 6 месяцев назад
Hey bro, how can i add the function that i can click on a square and add a number on the keyboard
@KennyYipCoding
@KennyYipCoding 6 месяцев назад
Check out my wordle tutorial, there is something similar where I show how to take keyboard inputs
@rajshah1811
@rajshah1811 Месяц назад
Hey bro , did it help if it did can you assist me too .
@Edelity
@Edelity Год назад
bro i want to ask about the bug the red number iw working but i can still place the number how can i fix it, please answer
@KennyYipCoding
@KennyYipCoding Год назад
When selecting a tile, you could do another check: check if current tile value is equal to number selected AND is not correct if (this.innerText == numSelected. id && solution[r][c] != numSelected. id) { return; }
@Edelity
@Edelity Год назад
@@KennyYipCoding bro the error is still the same
@Edelity
@Edelity Год назад
bro i just forget to detele the innertext function lol
@Edelity
@Edelity Год назад
but thx bro
@martinmeland2029
@martinmeland2029 2 года назад
Why do you use 'var' instead of 'let' in the beginning? Please answer in a way that a beginner can understand (a beginner who is not fluent in English). :)
@napal3043
@napal3043 Год назад
thank you so much , i subcribe u and like
@veronikak513
@veronikak513 Год назад
my sudoku didn't work,,, I tried your function but still isn't working, i have diff numbers, as i wanted to be my project for bootcamp, but it didn't work ...
@KennyYipCoding
@KennyYipCoding Год назад
Hi, I have the code in the GitHub link in the video description if you want to compare.
@KennyYipCoding
@KennyYipCoding 2 года назад
If you enjoyed the video, don't forget to like, subscribe, and share! :) Check out my other tutorials! WORDLE: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-ckjRsPaWHX8.html CONNECT 4: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-4ARsthVnCTg.html 2048: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-XM2n1gu4530.html Code: github.com/ImKennyYip/Sudoku
@andreiborky3676
@andreiborky3676 2 года назад
Man just keep doing this. You're doing an amazing job and your logic so good. You explain everything perfect. Hope the algorithm will bring you to the first results !
@KennyYipCoding
@KennyYipCoding 2 года назад
@@andreiborky3676 glad you found the tutorial helpful!
@andreiborky3676
@andreiborky3676 2 года назад
Very helpful ! I'm here just to find other ways of thinking. If i can say my opinion, the thing is that normally u must create an empty board with few numbers ( depending of the difficulty, lets say 30 ) and then the user must to fill the board. For example in the very beginning, if i put "1" in 0-0 maybe there is no "1" verticaly, horizontally or in the little matrix. So that time "1" is correct. Doesn't matter if the result matrix it's the same or not. Your game is leaded by the result matrix. But still, a very good job 💪👍👍👍
@KennyYipCoding
@KennyYipCoding 2 года назад
@@andreiborky3676 that would be a traditional pencil and paper way to do it! You could implement it like that and only check in the end once the board is filled but it is much more user friendly to tell the player when they make an error. So the goal would be to fill the board with 0 errors!
@rushikasuram5980
@rushikasuram5980 7 месяцев назад
2:56
@rushikasuram5980
@rushikasuram5980 7 месяцев назад
2:78
@sisterii4221
@sisterii4221 Год назад
1 question : Will every time the sudoku will be same ?
@KennyYipCoding
@KennyYipCoding Год назад
Yes because there’s only one sample sudoku puzzle given in this tutorial. Feel free to add more sudoku puzzles in your code
@ahmednaga8189
@ahmednaga8189 2 года назад
Make it solved
@ahmednaga8189
@ahmednaga8189 2 года назад
Make it solved with backtracking
@KennyYipCoding
@KennyYipCoding 2 года назад
that's on my list of videos that I will make but it will be a while since I have a long list!
@ahmednaga8189
@ahmednaga8189 2 года назад
@@KennyYipCoding Well, I listened to this video and applied it, but I need the code that solve it. It is necessary to send it to me.
@xzex2609
@xzex2609 2 месяца назад
it would be great if you make your font a little bigger in your future videos. they are all great and inspiring.
@KennyYipCoding
@KennyYipCoding 2 месяца назад
Yes I have increased the font in my later videos :)
Далее
How to make 2048 Game with Javascript HTML CSS
37:49
Просмотров 45 тыс.
Pass Your Next Tech Interview With Valid Sudoku
6:42
MIRAVI - Ивы 31.05.2024
00:14
Просмотров 98 тыс.
MLA Tutorial - Loops
5:16
Просмотров 2
Sudoku game in Python and Pygame
1:32:51
Просмотров 1,1 тыс.
Build this JS calculator in 15 minutes! 🖩
15:20
Просмотров 343 тыс.
Sudoku problem (Hard) | Solve problems with Leetcode
33:43