Created
January 29, 2015 09:01
-
-
Save c-j-j/60a3d73548439bafaaf2 to your computer and use it in GitHub Desktop.
Revisions
-
c-j-j created this gist
Jan 29, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ def get_validated_user_input while true input = get_user_input break if yield(input) print_invalid_message end input end user_move = get_validated_user_input {|input| move_valid?(input, board)} board_size = get_validated_user_input {|input| board_size_valid?(input, board_size_options)}