Ruby ASCII maze solver