Working Ruby solution scripts to programming word problems