2048 from Rosetta Code

I understood the code is not really scala code, but more translated Java code. What would be a good way to rewrite it?