This game was built in UnityEngine, and then the final build is released in WebGL format to showcase. The "Scripts" folder included here is from my Unity Project which has all the code (C# Language) used to build this game.
I have added comments in between the code in the script to help you understand what function does what.
The index.html needs web server to run. So i have added the link here for you to play the final build of the game:- https://The-2048-Game.harshvardhan52.repl.co