debugging - Ruby Error: Expecting keyword_end? -



debugging - Ruby Error: Expecting keyword_end? -

hey i've got little ruby programme wrote , except syntax error life of me can not debug.obviously, because of programme nor running.

my code below, help appreciated!

def print_game_header # print header print "\n" print "welcome math buddy\n" print "\n" end def make_game_array game_array x in 0..4 y in 0..4 game_array[x][y] = "*" end end end def make_mines game_array x in 0..4 game_array[x][rand(0..4)] = '!' end end def print_game_board game_array x in 0..4 y in 0..4 game_array[x][rand(0..4)]="!" end end def print_game_board game_array x in 0..4 y in 0..4 print game_array[x][y] end print "\n" end end def compute_results game_array print "\nfor 5x5 grid above, please give guesses location of mines in next format #,#,#,#,# # value of 1 through 5: " game_array = gets.chomp.split(',') print "\n" the_guess = 0 hits = 0 x in 0..4 if game_array[x][guess_array[the_guess].to_i-1] == '!' print "[#{x+1},#{guess_array[the_guess]}] hit!\n" else print "[#{x+1},#{guess_array[the_guess]}] miss!\n" end the_guess+=1 end if hits > 0 print "\nyour nail rate ", (hits.to_f/5*100).to_s, "%\n" else print "\nyour nail rate 0%\n" end end columns, rows = 5, 5 game_array = [] rows.times { game_array << array.new( columns ) } print_game_header make_game_array game_array print_game_board game_array make_mines game_array compute_results print "\nhere actual locations of mines:\n\n" print_game_board game_array

the first definition of print_game_board missing , end.

note: define method twice.

ruby debugging syntax

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -