Extremely simple movement.

I'm working on a grid-based movement system. I have a regular 1x1x1 cube. Let's say I want it to move forward 1 unit. I'll press the W key, and the cube will set a new position 1 unit forward relative to its initial position. All the movement systems I've seen here are smooth. I want one that "teleports" the object in a certain direction and distance.

An easy way is telling the distance in whatever (x, y or z) you are using and then use this code,

function Update () {

    if (Input.GetKey ("up")) {

        transform.position.x += the_distance;

    }

}