Coding Challenge #94: 2048 - Part 1

Coding Challenge #94: 2048 - Part 1

The Coding Train

6 лет назад

147,261 Просмотров

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


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

@matteoZattera
@matteoZattera - 27.06.2022 23:20

I have coded this game in Java, great game to earn experience

Ответить
@ashutoshmishra1506
@ashutoshmishra1506 - 30.04.2022 11:55

This was more than the comedy........but learning too

Ответить
@igorstaniszewski835
@igorstaniszewski835 - 05.04.2022 19:51

Where is this random function come frome ?

Ответить
@Sagarkumar-pe1wj
@Sagarkumar-pe1wj - 25.09.2021 20:19

Liked your video within one minute because I know it gonna be great video.

Ответить
@NoxFly
@NoxFly - 06.07.2021 18:28

In all your vids you're doing stuff with ES6 functions like arr = arr.concat(arr2);
why not use arr.push(...arr2); ?

Ответить
@Epicboss16
@Epicboss16 - 15.06.2021 03:18

Hey, what web server are you using? My index.html won't show my sketch.js for some reason.

Ответить
@Ash-bx6kq
@Ash-bx6kq - 22.05.2021 08:11

doing this for a class project, I've got the board set up written, (like place 2s and 4s down in a random spot) and let me just say, my code is WAY messier than the like 50 lines it took you to write it

Ответить
@quepasa498
@quepasa498 - 17.03.2021 18:41

NUMBER 1 VICTORY ROYALE FORTNITE YEAH WE BOUT TO GET DOWN

Ответить
@prakashsahu7067
@prakashsahu7067 - 26.02.2021 08:43

Which plateform do you use

Ответить
@razqalathifpradana18
@razqalathifpradana18 - 19.01.2021 13:06

Hallo The Coding Train

Do you have tutorial create game candy crush with canvas and JS ??

Ответить
@vaim5982
@vaim5982 - 02.01.2021 17:09

what is that random function? where does it come from?

Ответить
@user-gt5st3wh2p
@user-gt5st3wh2p - 20.06.2020 21:52

hey,help me plz.
in my function , my code miss this condition(key == " ")
Where we declared this variuble ,i don't understand .
(problem function)
function keyPressed() {
if (key == ' ') {
console.log("hi")
for(let i = 0; i < 4; i++) {
console.log("hi")
grid[i] = operate(grid[i]);
}
}
addNumber()
}

Ответить
@keshavapiyushprasad5439
@keshavapiyushprasad5439 - 06.05.2020 15:19

If Dan was a teenager in the 1940s, then One Direction was 98 degrees. Lawl

Ответить
@angshu7589
@angshu7589 - 20.03.2020 00:43

This is 2020. I don't know JSON.stringify existed in 2018 but if it did your compare function could have been as simple as:
var compare = (a, b) => JSON.stringify(a) !== JSON.stringify(b);

Quite amusing how you can change a 5-line piece of code with two nested for loops (not even a forEach!) in only one single line.

Ответить
@silentgrove7670
@silentgrove7670 - 18.11.2019 20:20

I have decided to take on the challenge of creating a self learning neural net that can win at 2048.
My grade 10 teacher told me if you want to solve a problem do it yourself OR find someone that has already solved the problem. I am using the latter strategy to deal with the first level of 2048 and then move on


I love your enthusiasm btw. I love that you are open about the journey being adventures and ideas we learn via by trial and error.

Ответить
@gggogopowerrangers
@gggogopowerrangers - 28.07.2019 10:57

Your coding challenge is great, Dan! Honestly, it feels good to see how you code without planning it in advance. I can see your thought process and it's very helpful to improve my problem-solving ability. Thank you so much! Xoxo

Ответить
@cameron6464
@cameron6464 - 13.07.2019 06:30

Your every action puts a mile long smile on my face.

Ответить
@setusof
@setusof - 09.07.2019 10:23

Iwantlearnjavascript.. 🤓

Ответить
@brahmendranchary5852
@brahmendranchary5852 - 24.06.2019 10:22

i try this same code but i couldn't not achieve the output

Ответить
@meghanstrudwick4100
@meghanstrudwick4100 - 22.06.2019 10:06

when did this happen!?!?!?

Ответить
@WarnetVioletStarTlogowungu
@WarnetVioletStarTlogowungu - 07.04.2019 10:42

i like this game... i find them in faucet ctyptocurrency like bitcoin, litecoin etc hhhh

Ответить
@XnoobSpeakable
@XnoobSpeakable - 25.02.2019 18:19

Loop Poo
Over = Lover

Ответить
@edidumitru989
@edidumitru989 - 22.12.2018 15:54

poti face acest joc in visual studio in c#??

Ответить
@TecuGo
@TecuGo - 14.10.2018 02:13

I think first you should have called combine(); then slide(); Please correct me if I am wrong.

Ответить
@MasterLemon98
@MasterLemon98 - 26.09.2018 04:18

gabriele's surname pronunciation is Ci like chill, ru like room, lli like lli. Chi-Roo-lli

Ответить
@hectorsmith8269
@hectorsmith8269 - 11.09.2018 20:09

this:
function combine(row){
for(let i = 3; i >= 1; i--){
let a = row[i-1];
let b = row[i];
if(a == b){
row[i] = a + b;
row[i-1] = 0;
}
}

return row;
}

should be:
function combine(row){
for(let i = 3; i >= 1; i--){
let a = row[i-1];
let b = row[i];
if(a == b){
row[i-1] = a + b;
row[i] = 0;
}
}

return row;
}
and then you can just slide and combine without a problem

Ответить
@hectorsmith8269
@hectorsmith8269 - 11.09.2018 19:32

with textAlign(CENTER);
text(val, i * w - w/2 + w, j * w - w/2 + w+20);
is correct

Ответить
@jerryf196
@jerryf196 - 27.07.2018 04:42

does random method even exist?

Ответить
@joshuaharvey4956
@joshuaharvey4956 - 21.07.2018 10:16

Just finished this challenge myself, now to see how you implement the tile shifting! (I was stuck on it for longer than I'm proud to admit, considering how simple it sounds).

Ответить
@ionmorosan796
@ionmorosan796 - 01.06.2018 11:46

how i cand do it in Angular 4 ?

Ответить
@franmaric
@franmaric - 18.05.2018 13:35

I made mine in python!

Ответить
@unhott1893
@unhott1893 - 09.05.2018 01:22

"I'm gonna take a short break, and have a part two of the 2048 challenge where I deal with the rotation of the matrix, and I hope you enjoy watching that part and then the game will be finished!"
lul

Ответить
@longvuong9395
@longvuong9395 - 12.04.2018 22:10

For me, in the console, there's an error that says, "Uncaught ReferenceError: past is not defined". Var works, but let doesn't, how do you fix that?

Ответить
@adriansitorus9862
@adriansitorus9862 - 09.04.2018 18:53

Halo
If i wanna try something like this
What kinds of software that i need?

Ответить
@ch3rag
@ch3rag - 06.04.2018 01:03

completed my own version today😊😊 please upload a video on how to animate the tiles.. thank you

Ответить
@mint-o5497
@mint-o5497 - 22.03.2018 22:19

give me 2 kg of whatever u snorted before this video pls

Ответить
@budhachandrayumkhaibam6079
@budhachandrayumkhaibam6079 - 13.03.2018 00:11

you are like a comic.

Ответить
@konakzizu
@konakzizu - 04.03.2018 00:46

next time i propose Tetris

Ответить
@charbelsarkis3567
@charbelsarkis3567 - 03.03.2018 20:01

figured it out

let options = new Array(4).fill().map( x => Array(4).fill(0) )

Ответить
@matheusepstein2973
@matheusepstein2973 - 03.03.2018 18:29

i love you

Ответить
@govardhan123
@govardhan123 - 03.03.2018 18:21

it has === .. how it is compiling sir ?

Ответить