Implementation of (2048) in Ruby On Rails