Move to ruby

`return` missing? or assign current_state here, rather than in `compute_word`