No video

How to Code a Sudoku Solver in Javascript

  Рет қаралды 23,979

Jack Tech

Jack Tech

Күн бұрын

► EXPLANATION: • How to Build an Algori...
►Project link: jackhetech.io/...
► Check out the live website here: projectsbyjack...
► My Super low-budget camera: amzn.to/37PhFo9
► The book I am currently reading: amzn.to/2KsHeTq
► Follow me on instagram: / jack_he_hd
► Check out how I got an internship at Microsoft: • How I Got a Software E...
► About me:
College: University of British Columbia
Major: Computer Science

Пікірлер: 41
@GiantTripod
@GiantTripod 4 жыл бұрын
I swear reddit reads my mind sometimes. I was just brainstorming a checker game when I came across this. This is actually incredible. Keep going man, KZbin and myself love quirky stuff like this.
@lowercaseguy3578
@lowercaseguy3578 3 жыл бұрын
Unlike other geniuses I have to copy geniuses , repeat repeat and make the knowledge mine . It's such an hards process to learn .
@angry_moose94
@angry_moose94 2 жыл бұрын
calling yourself a genius sounds like such an hards process to really say quite the opposite.
@frankhen
@frankhen 3 жыл бұрын
Remember Frank? We were on the same flight last yr from Vancouver to Toronto. I'm in U of T computer engineering now so this video is actually useful. (Thumbs up)
@JackHeTech
@JackHeTech 3 жыл бұрын
wtf how tf do u still remember holy shit LMAO. That was jokes, spent $3000 to compete in a local hackathon only to win nothing LOOOOL
@JackHeTech
@JackHeTech 3 жыл бұрын
yo thanks for the support btw LMAO
@Shubham-xh9nz
@Shubham-xh9nz 4 жыл бұрын
saw your chess video and now watching this, can you create a vid about how you approch a problem , those architecture and all , i just dont know how to do that , most of time I start coding and then get stuck , would love to l earn how to preplan things like what you need for that code :)
@hoyinli7462
@hoyinli7462 2 жыл бұрын
great video! I love the way you give friendly explanation on syntax!
@JackHeTech
@JackHeTech 2 жыл бұрын
Thanks!
@sidikriders3007
@sidikriders3007 2 жыл бұрын
Thank you so muchhh, now I understand what backtrack is
@toursincasablanca
@toursincasablanca Жыл бұрын
hey, pro I try to learn from this tool you put in get hup but I want to change the design of the board to be like function initiate can you tell me how, please. and thank you for your help to us. I'm waiting for you answer
@souravpatel1324
@souravpatel1324 3 жыл бұрын
actually it is always giving false statement so will you please review it once ?
@hughpadmore960
@hughpadmore960 4 жыл бұрын
If you don't mind me asking, how does "var cur" inside rowsGood() get the value of 1-9? I'm assuming that's how it works where the function checks that each row contains all numbers 1 through 9
@JackHeTech
@JackHeTech 4 жыл бұрын
So it actually checks whether each row contains a duplicate number or not. The rows are good if there is no duplicate number for each row. The outer for loop goes through each array (top to bottom) in the 2D array, and the inner one goes through the individual array (left to right) and appends all not-null numbers into cur, and checks to see if there are any repeats.
@funnycommentary7167
@funnycommentary7167 3 жыл бұрын
You are the best! Thanks for all the helpful tips!
@darknessheart230
@darknessheart230 9 ай бұрын
I need your help
@zeno5053
@zeno5053 3 жыл бұрын
I found a flaw. I'm not sure what causes it though... Some Sudoku puzzles will take the algorithm very long, if not forever to solve. Here's an example: [0, 0, 0, 0, 0, 7, 3, 0, 0], [0, 0, 0, 0, 0, 4, 0, 0, 0], [0, 0, 0, 0, 0, 0, 2, 0, 0], [0, 0, 0, 0, 1, 8, 0, 0, 3], [0, 0, 0, 0, 0, 9, 5, 0, 0], [0, 0, 0, 0, 0, 0, 6, 0, 0], [0, 0, 0, 0, 5, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 0, 3, 9], [0, 0, 0, 2, 0, 0, 0, 0, 0] Maybe the algorithm can only solve a sudoku puzzle that can also be solved by a human? But there are no such things as that right? Edit: oops, forgot to replace the 0 with null
@AgengDPrastyawan
@AgengDPrastyawan 3 жыл бұрын
lol
@jacobmees5637
@jacobmees5637 3 жыл бұрын
Wow, amazing Algorithmen... But there is a problem I don't understand! If I visit your Website everythingis runing fast and smooth, but when I run the same code on my Laptop it slows down and nothing is happening!...
@JackHeTech
@JackHeTech 3 жыл бұрын
Hmm, check and make sure you're not backtracking AFTER you have found a solution.
@bojjabheemaraju387
@bojjabheemaraju387 2 жыл бұрын
Excellent!
@haqiqatizlab2809
@haqiqatizlab2809 Жыл бұрын
Very good. I want to create before but I can't
@beksultanomirzak9803
@beksultanomirzak9803 3 жыл бұрын
Good Job! Bro
@alimshogen6712
@alimshogen6712 4 жыл бұрын
Nice job, man! You are very cool!)
@artursh4791
@artursh4791 4 жыл бұрын
very cool, thank you!
@JackHeTech
@JackHeTech 4 жыл бұрын
you're welcome!
@abdallahel-feky373
@abdallahel-feky373 4 жыл бұрын
dude, I wanna replace the numbers with pictures would you help me with that?
@JackHeTech
@JackHeTech 4 жыл бұрын
hmm.. should be pretty easy. Use a hashmap that maps a number to it's corresponding picture URL when you render the sudoku board.
@abdallahel-feky373
@abdallahel-feky373 4 жыл бұрын
@@JackHeTech sorry but how because I'm new to this
@abdallahel-feky373
@abdallahel-feky373 4 жыл бұрын
@@JackHeTech and wouldn't this change the solving mechanism
@JackHeTech
@JackHeTech 4 жыл бұрын
@@abdallahel-feky373 You don't need to do anything to the solving mechanism. Think about model vs UI. I think your question mainly pertains to the actual rendering of the board. So pass in data as numbers and whatever output you get from the algorithm you would just map those numbers to its corresponding image.
@abdallahel-feky373
@abdallahel-feky373 4 жыл бұрын
Okay how I do this mapping would tell me please or maybe send me a description link
@eugensunic
@eugensunic 4 жыл бұрын
Keep it up man
@JackHeTech
@JackHeTech 4 жыл бұрын
thanks!
@anujchaudhary4724
@anujchaudhary4724 2 ай бұрын
I tried with the worst method by trying to calculate every possible combos but the code is gr8 but need ton of time and lots of ram 😂
@GerardDruiven
@GerardDruiven 3 жыл бұрын
Just great
@JackHeTech
@JackHeTech 3 жыл бұрын
thanks! glad you enjoyed!
@fukyoutubestupidfuckinghandles
@fukyoutubestupidfuckinghandles 2 жыл бұрын
thank you, sir! :)
@oliviameza3
@oliviameza3 4 жыл бұрын
amazing (L)
@rahulmaheshwari9185
@rahulmaheshwari9185 3 жыл бұрын
Giving false
How to Build an Algorithm to Solve ANY Sudoku Puzzle
10:05
Jack Tech
Рет қаралды 9 М.
Sudoku Solver in Python (using 10 different solving strategies)
18:22
Games Computers Play
Рет қаралды 37 М.
Touching Act of Kindness Brings Hope to the Homeless #shorts
00:18
Fabiosa Best Lifehacks
Рет қаралды 17 МЛН
У ГОРДЕЯ ПОЖАР в ОФИСЕ!
01:01
Дима Гордей
Рет қаралды 4,5 МЛН
Incredible Dog Rescues Kittens from Bus - Inspiring Story #shorts
00:18
Fabiosa Best Lifehacks
Рет қаралды 33 МЛН
ASMR Programming - Sudoku Solver in JavaScript - No Talking
22:47
Coding a Sudoku solver in Python using recursion/backtracking
15:02
Faster than Rust and C++: the PERFECT hash table
33:52
strager
Рет қаралды 557 М.
Solving Wordle using information theory
30:38
3Blue1Brown
Рет қаралды 10 МЛН
Python Sudoku Solver - Computerphile
10:53
Computerphile
Рет қаралды 1,2 МЛН
Touching Act of Kindness Brings Hope to the Homeless #shorts
00:18
Fabiosa Best Lifehacks
Рет қаралды 17 МЛН